Ask Your Question
0

About import OpenCV to Dev C++

asked 2013-12-04 02:44:26 -0600

XReijiX gravatar image

I'm newbie in C++ programming and I've already followed to some web. After that I can't using OpenCV Libraries.

Does anyone help me by explain about importing to Dev C++ please?

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted
2

answered 2013-12-04 05:53:15 -0600

updated 2013-12-04 05:55:18 -0600

I think that Dev-C++ should be quite similar to other IDE's out there. Basically you should pay attention to the following things (asuming you have windows OS x64, if not let me know)

  1. Download the latest openCV release which is 2.4.7 at this location and extract it to a folder under your root, for example C:/opencv/.
  2. Make sure that your windows operating system actually knows where the OpenCV dll's can be found by adding the following to your PATH variable: C:/opencv/build/x64/vc10/bin/. If you do not know how to add elements to PATH variable follow this link.
  3. In your Dev-C++ environment you need to set your project properties. You should first make sure that the include directories are added to the additional include directories (C:/opencv/include/, C:/opencv/include/opencv/ and C:/openc/include/opencv2/). And secondly you need to add information into your linker options. First you need to provide the additional linker path libraries (C:/opencv/build/c64/vc10/lib/) and then specify every included or needed module by its corresponding .lib name.

Does this help solving your problems?

EDIT:

A good tutorial with video on how to set the OpenCV compiler options in Dev-C++ can be found here

edit flag offensive delete link more
0

answered 2014-09-03 15:02:26 -0600

Saman gravatar image

updated 2014-09-19 14:27:38 -0600

Dear OpenCV and DEV C++ experts, I'm trying to set up DEV C++ for using OpenCV but it doesn't work! I searched a lot and used different instruction from different websites but I'm still getting some errors such as fatal error C1083: Cannot open include file: 'opencv2/imgproc/imgproc.hpp': No such file or directory
the same for highgui.

Could somebody please share a link or correct instruction for DEV C++ / OpenCV?

Your prompt help is much appreciated! Thank you, Saman

Update 1: It should definitely a linker problem but how can I fix it? I tried to follow the instructions posted online. Could you please send a good one for setting DEV C++ for OpenCV? Thanks,

Update 2: Hi berak , I'm still having the linker problem in DEV C++ , when I compile the code it can't find the header file . I think I have included the right folders. Do you have any idea or could you please send the best way to set up the linker stuff in DEV C++ for Open CV ? Thanks, Saman

edit flag offensive delete link more

Comments

which compiler is it using ? (if that's mingw, you will have to build the opencv libs from src first)

berak gravatar imageberak ( 2014-09-04 00:43:01 -0600 )edit

first guess, you are using the 3.0 download? If so then your includes are wrong. If not, then there is probably a linking error, since the IDE doesn't find your OpenCV installation.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-09-04 03:02:40 -0600 )edit

Dear Berak, Sorry for asking this basic question. Could you please let me know how I should build OpenCV from scratch? I went over the video tutorials but I honestly didn't get it!!! Do I need to install all those things (Python , Numphy...) ? Or just CMake? could you please send me a link or something describing that? I honestly got stuck !!! Thanks, Saman

Saman gravatar imageSaman ( 2014-09-06 09:08:50 -0600 )edit

"Do I need to install all those things (Python , Numphy...) ?" - if you don't need python support - no.

"Or just CMake?" - yes, you will need that. and look here for a receipe

berak gravatar imageberak ( 2014-09-06 09:37:35 -0600 )edit

Hi Berak, I did the CMake stuff and I think it was done correctly but when using mingw I got the following errors: Linking CXX shared library ....\bin\libopencv_core300.dll c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot fin d -lRunTmChk collect2.exe: error: ld returned 1 exit status modules\core\CMakeFiles\opencv_core.dir\build.make:1257: recipe for target 'bin/ libopencv_core300.dll' failed mingw32-make[2]: * [bin/libopencv_core300.dll] Error 1 CMakeFiles\Makefile2:1325: recipe for target 'modules/core/CMakeFiles/opencv_cor e.dir/all' failed mingw32-make[1]: [modules/core/CMakeFiles/opencv_core.dir/all] Error 2 Makefile:136: recipe for target 'all' failed mingw32-make: ** [all] Error 2

Saman gravatar imageSaman ( 2014-09-07 10:23:20 -0600 )edit

C:\Users\SaMaN\Downloads\opencv>mingw32-make install [ 2%] Built target zlib [ 6%] Built target libtiff [ 10%] Built target libjpeg [ 15%] Built target libwebp [ 19%] Built target libjasper [ 21%] Built target libpng [ 28%] Built target IlmImf [ 28%] Built target opencv_core_pch_dephelp [ 29%] Built target pch_Generate_opencv_core Linking CXX shared library ....\bin\libopencv_core300.dll c:/mingw/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot fin d -lRunTmChk collect2.exe: error: ld returned 1 exit status modules\core\CMakeFiles\opencv_core.dir\build.make:1257: recipe for target 'bin/ libopencv_core300.dll' failed mingw32-make[2]: * [bin/libopencv_core300.dll] Error 1 CMakeFiles\Makefile2:1325: recipe for target 'modules/core/CMakeFiles/opencv_cor e.dir/all' faile

Saman gravatar imageSaman ( 2014-09-07 10:23:37 -0600 )edit

recipe for target 'modules/core/CMakeFiles/opencv_cor e.dir/all' failed mingw32-make[1]: * [modules/core/CMakeFiles/opencv_core.dir/all] Error 2 Makefile:136: recipe for target 'all' failed mingw32-make: * [all] Error 2

Saman gravatar imageSaman ( 2014-09-07 10:24:17 -0600 )edit

just for letting you know I have downloaded the latest version of OpenCV. Does it cause any problem ?

Saman gravatar imageSaman ( 2014-09-07 10:25:00 -0600 )edit
berak gravatar imageberak ( 2014-09-07 10:37:02 -0600 )edit

Hi guys, I did the following steps but sill I'm getting this error 2 C:\Users\SaMaN\Documents\opencv_test01.cpp opencv2/imgproc/imgproc.hpp: No such file or directory.

1 - downloaded CMake 2- downloaded OpenCV_2.4.9 3- Using CMake gui , configured and generated OpenCV without any error 4- in the OpenCV folder : mingw32-make . This commend was working till 92 or 93 % then failed but I did : 5- mingw32-make install and it was completed 100% without any error. 6- in DEV C++ , created new compiler with this config: 6-1 Add following command when compiling -L "C:\Users\SaMaN\Documents\opencv_2.4.9\install\x86\mingw\lib" -lcxcore249 -lcv249 -lhighgui249 -lml249 -lcvaux249 -lcxts249 6-2 Add these commands to linker : -lhighgui -lcv -lcxcore -lcvaux -lcvcam

Saman gravatar imageSaman ( 2014-09-10 14:15:48 -0600 )edit
0

answered 2014-09-04 23:27:19 -0600

Saman gravatar image

I think I'm using OpenCV as compiler ... In "compiler options" I have OpenCV to compile this piece of code. So is there anything wrong with it? Sorry for asking basic questions.

and honestly the version of OpenCV I'm using is "vc11", this is the version works on my Visual Studio but doesn't work on DEV c++.

What is the best way to sort out the linking error ?

Thanks a lot, S.

These are the errors I get:

2 C:\Users\SaMaN\Documents\opencv_test01.cpp opencv2/imgproc/imgproc.hpp: No such file or directory. 3 C:\Users\SaMaN\Documents\opencv_test01.cpp opencv2/highgui/highgui.hpp: No such file or directory. 6 C:\Users\SaMaN\Documents\opencv_test01.cpp highgui.h: No such file or directory.

edit flag offensive delete link more

Comments

Ok remark 1, do not add multiple answers to start communicating. Use the comment tab or edit a previous answer to add more info. Besides that , OpenCV is not a compiler, it is a library that can be compiled by gcc mingw vc ... tons of compilers possible. vc11 indicates you are using visual studio 2010 or 2012, while you are trying to set up OpenCV for DEV C++. This is incorrectly! You will need to build openCV from scratch using mingw and couple that compiler.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-09-05 03:47:58 -0600 )edit

Hi Steven, Thanks for you advice. It seems I should go back and re-install OpenCV for DEV C++. I hope the problem is gone. If not, I bug you again. Best, Saman

Saman gravatar imageSaman ( 2014-09-05 15:18:25 -0600 )edit

Question Tools

Stats

Asked: 2013-12-04 02:44:26 -0600

Seen: 12,229 times

Last updated: Sep 19 '14