Ask Your Question
0

Eclipse Neon c++ openCV 3.0.0+ install and usage

asked 2017-06-11 18:49:39 -0500

I am trying to work on a project for myself this summer and at its core, I am planning to use the NVIDIA Jetson platform and need the benefits of the CUDA acceleration. I am primarily a Java / C# programmer but due to the support issues this is the first time I am really working on the c++ side of things. During the process of setting up my environment for use in eclipse neon.3 everything seems fine, I used the install package and then added the libraries with the setx command in the tutorial. When I attempt to build any c++ application using OpenCV I get an error on the namespace and any other OpenCV references. Any help would be appreciated.

here is the output form the compiler:

19:46:43 **** Incremental Build of configuration Debug for project testproj2 ****
Info: Internal Builder is used for build
g++ "-IC:\\Users\\cole\\Documents\\opencv\\build\\include\\opencv2" -O0 -g3 -Wall -c -fmessage-length=0 -o "src\\test.o" "..\\src\\test.cpp" 
g++ "-LC:\\Users\\cole\\Documents\\opencv\\build\\include\\opencv2" -o testproj2.exe "src\\test.o" -lopencv_core -lopencv_imgproc -lopencv_highgui 
c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe: cannot find -lopencv_core
c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe: cannot find -lopencv_imgproc
c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe: cannot find -lopencv_highgui
collect2.exe: error: ld returned 1 exit status

19:46:43 Build Finished (took 255ms)
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-06-11 18:58:03 -0500

berak gravatar image

updated 2017-06-11 18:58:41 -0500

well, for your jetson platform, you'll have to cross-compile (i got no idea about it), but right now, eclipse is trying to build a native windows program using mingw, and the libs are versioned , like:

-lopencv_core320 -lopencv_imgproc320 -lopencv_highgui320
edit flag offensive delete link more

Comments

it would be helpful if the tutorials are updated. I will add those and try again

Coalman321 gravatar imageCoalman321 ( 2017-06-11 19:02:10 -0500 )edit

if you want my 2 ct. - eclipse is a monster, which only adds additional complexity.

(also, opencv devs gave up on mingw long time ago, don't expect much support there)

berak gravatar imageberak ( 2017-06-11 19:06:30 -0500 )edit

I added the versioning tags and that part seems to work out but the inclusions are now throwing errors. any ideas?

20:10:57 **** Incremental Build of configuration Debug for project testproj2 ****
Info: Internal Builder is used for build
g++ "-IC:\\Users\\cole\\Documents\\opencv\\build\\include\\opencv2" -O0 -g3 -Wall -c -fmessage-length=0 -o "src\\test.o" "..\\src\\test.cpp" 
..\src\test.cpp:7:16: fatal error: cv.h: No such file or directory
compilation terminated.

20:10:57 Build Finished (took 82ms)
Coalman321 gravatar imageCoalman321 ( 2017-06-11 19:12:13 -0500 )edit

please never try to do anything with the deprecated opencv1.0 c-api. use #include "opencv2/opencv.hpp" , not the c-api headers(cv.h, highgui.h, cxcore.h, etc)

if you spot any IplImage in the code - burn the whole thing immediately.

berak gravatar imageberak ( 2017-06-11 19:16:44 -0500 )edit

btw, 3.0.0 is almost 2 years old, quite outdated. why use that ?

berak gravatar imageberak ( 2017-06-11 19:20:17 -0500 )edit

by 3.0.0+ i meant 3.2.0

Coalman321 gravatar imageCoalman321 ( 2017-06-11 19:24:41 -0500 )edit

also what do you mean about minGW. That's what the eclipse tutorial tells you to use.. also i changed to the new inclusions and am still getting a build error

22:41:29 **** Incremental Build of configuration Debug for project testproj2 ****
Info: Internal Builder is used for build
g++ "-IC:\\Users\\cole\\Documents\\opencv\\build\\include\\opencv2" -O0 -g3 -Wall -c -fmessage-length=0 -o "src\\test.o" "..\\src\\test.cpp" 
In file included from ..\src\test.cpp:8:0:
C:\Users\cole\Documents\opencv\build\include\opencv2/opencv.hpp:48:38: fatal error: opencv2/opencv_modules.hpp: No such file or directory
compilation terminated.

22:41:29 Build Finished (took 82ms)
Coalman321 gravatar imageCoalman321 ( 2017-06-11 20:22:17 -0500 )edit

So I spent some time messing with the settings and have made it back to the original compiler issue where the libraries do not seem to be included but the code is throwing no errors in eclipse.

it looks like this: imgur image

Coalman321 gravatar imageCoalman321 ( 2017-06-11 22:20:18 -0500 )edit

did you BUILD the opencv libs using mingw ? you cannot use the prebuild version, those are for VS2015 only.

after that, it should be -IC:\\Users\\cole\\Documents\\opencv\\build\\install\\include

berak gravatar imageberak ( 2017-06-11 23:23:06 -0500 )edit

Ok stupid question i guess, but how do I do that? Is that the whole cmake thing? if so i couldn't get it to work. it would just spit out some sort of versioning or file not found errors.

Coalman321 gravatar imageCoalman321 ( 2017-06-12 09:03:25 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-06-11 18:49:39 -0500

Seen: 280 times

Last updated: Jun 11 '17