News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

opencv in c:b

Started by Souradeep, February 06, 2011, 05:28:23 PM

Previous topic - Next topic

Souradeep

I want to use opencv1.1pre1a in c:b. I went through the wiki about running opencv and followed the steps. But I got the following errors when I tried to build a program on dislaying an image. Please help me out ... Really frustrated :(
/code
include <stdio.h>
#include <stdlib.h>
#include "cv.h"
#include "highgui.h"
int main( int argc, char** argv )
{
    IplImage* img = cvLoadImage( argv[1],1 );
    cvNamedWindow( "Example1", CV_WINDOW_AUTOSIZE );
    cvShowImage( "Example1", img );
    cvWaitKey(0);
    cvReleaseImage( &img );
    cvDestroyWindow( "Example1" );
}
/code
error
/code
obj\Debug\main.o||In function `main':|
C:\Users\AGM-P\cv\loo\main.c|7|undefined reference to `cvLoadImage'|
C:\Users\AGM-P\cv\loo\main.c|8|undefined reference to `cvNamedWindow'|
C:\Users\AGM-P\cv\loo\main.c|9|undefined reference to `cvShowImage'|
C:\Users\AGM-P\cv\loo\main.c|10|undefined reference to `cvWaitKey'|
C:\Users\AGM-P\cv\loo\main.c|12|undefined reference to `cvDestroyWindow'|
||=== Build finished: 5 errors, 0 warnings ===|
/code

stahta01

Turn on Full Compiler Logging; then find a site that supports your Compiler, OS, and the third party library.

http://wiki.codeblocks.org/index.php?title=FAQ#Q:_How_do_I_troubleshoot_an_compiler_problem.3F

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

ollydbg

also, read this CodeBlocks - OpenCV Wiki
and post the full build log here as stahta01 said.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.