2 Replies - 401 Views - Last Post: 02 August 2012 - 08:05 PM Rate Topic: -----

#1 gokigenyou  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 02-August 12

Invalid argument error when compiling in wxDev-C++ with OpenCV 2.4.2

Posted 02 August 2012 - 06:31 PM

I am currently trying using OpenCV with wxDev-C++, and I have tried compiling the following code:

 #include <"C:\OpenCV\build\include\opencv2\core\core_c.h">
#include <"C:\OpenCV\build\include\opencv\cxcore.h">
#include <"C:\OpenCV\build\include\opencv\highgui.h">


int _tmain(int argc, _TCHAR* argv[])
{
    IplImage *img = cvLoadImage("D:\Projects\display_image\lel.bmp");
    cvNamedWindow("OpenCV",1);
    cvShowImage("OpenCV",img);

    cvWaitKey(0);
    cvDestroyWindow("OpenCV ");
    cvReleaseImage(&img);

    return 0;
}


I get this error when I compile the code: "Invalid argument" and "D:\Projects\display_image\Makefile.win [Build Error] [Objects/MingW/display_image.o] Error 1"

I think this might be because of how I modified the compiler options. Here are the stuff I added under Compiler options:

I have added the following commands to the linker command line under Compiler options:
-lcxcore -lcv -lhighgui -lcvaux -lcxts -lml

And added this directory to the "Binaries": C:\OpenCV\build\x86\mingw\bin

Added this to "Libraries": C:\OpenCV\build\x86\mingw\lib

And added the following directories to C and C++ Includes:
C:\OpenCV\include\opencv
C:\OpenCV\build\include\opencv
C:\OpenCV\include\opencv2
C:\OpenCV\build\include\opencv2

I'm not sure if what I did is correct.

Thanks in advance

Is This A Good Question/Topic? 0
  • +

Replies To: Invalid argument error when compiling in wxDev-C++ with OpenCV 2.4.2

#2 Skydiver  Icon User is online

  • Code herder
  • member icon

Reputation: 1933
  • View blog
  • Posts: 5,759
  • Joined: 05-May 12

Re: Invalid argument error when compiling in wxDev-C++ with OpenCV 2.4.2

Posted 02 August 2012 - 07:51 PM

I don't use wxDev-C++, so this maybe a stupid question. Is there a way to tell the IDE to give you verbose build logs? If so, use that option so that it will show you how it is exactly calling the compiler and/or the linker.

If you don't understand the output, don't worry. I'm quite sure that if you post the verbose logs here, somebody will be able to decipher it and lead you to a fix.
Was This Post Helpful? 0
  • +
  • -

#3 jimblumberg  Icon User is online

  • member icon

Reputation: 3057
  • View blog
  • Posts: 9,303
  • Joined: 25-December 09

Re: Invalid argument error when compiling in wxDev-C++ with OpenCV 2.4.2

Posted 02 August 2012 - 08:05 PM

Try removing the <> from your includes.
#include "C:\OpenCV\build\include\opencv2\core\core_c.h"


If you give the full path you should be using quotes, But you should never use both quotes and <>.

Jim
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1