Ask Your Question
0

running a program in codeblock (dasad

asked 2013-07-11 07:13:22 -0600

scream2ice gravatar image

updated 2013-07-11 07:14:01 -0600

I have set up code block and mingw in windows8 (64 bit), then using CMake, created a build folder for opencv source, then in code block done all the adjustments and settings ( the ones required for adding libraries and includes), but when running a simple program in opencv, the compiler doesn't seem to recognise any of the code syntax used in opencv the code i run is here:

#include <opencv2/highgui/highgui.hpp>
int main( int argc, char** argv )
{

IplImage* img = cvLoadImage( "~/x.jpg" ,CV_LOAD_IMAGE_UNCHANGED );
cvNamedWindow( "Example1", CV_WINDOW_AUTOSIZE );
cvShowImage( "Example1", img );
cvWaitKey(0);
cvReleaseImage( &img );
cvDestroyWindow( "Example1" );

}

I have exactly the same problem when running the program in visual studio it appears that there is a problem with the include and lib files created,

here's one of the errors i get (in codeblock) CV_LOAD_IMAGE_UNCHANGED was not declared in this scope|

i'd appreciate any help in advance

edit retag flag offensive close merge delete

Comments

have you tried cvLoadImage( "~/x.jpg" , -1 ); . And correct me if I am wrong, but does the symbol "~" exists under Windows at all?

Guanta gravatar imageGuanta ( 2013-07-11 09:32:35 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2013-07-11 23:23:34 -0600

scream2ice gravatar image

i've just used '~'here in the code, the path was quite long, so i just put this sign here instead, im actually beginning to think that maybe the latest version opencv249 which is released by source <link/> https://github.com/Itseez/opencv.git has some problems with the libraries and binaries that you make using cmake, they just don't work

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-07-11 07:13:22 -0600

Seen: 410 times

Last updated: Jul 11 '13