Author Topic: opencv in c:b  (Read 5304 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 :(
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 );
    cvReleaseImage( &img );
    cvDestroyWindow( "Example1" );
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 ===|

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6996
    • 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.

C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
When in doubt, read the CB WiKi FAQ.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5242
  • 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.