Author Topic: opencv in c:b  (Read 6687 times)

Offline Souradeep

  • Single posting newcomer
  • *
  • Posts: 3
opencv in c:b
« on: February 06, 2011, 05:28:23 pm »
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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: opencv in c:b
« Reply #1 on: February 06, 2011, 05:52:45 pm »
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++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5910
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: opencv in c:b
« Reply #2 on: February 08, 2011, 09:02:25 am »
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.