Ask Your Question
0

Need help on GCC C++ Linker

asked 2012-11-09 10:52:55 -0500

Karl gravatar image

Hello, I'm using OpenCV2.4.3 on Eclipse. I need to add the correct path to GCC C++ Linker on MINGW libraries as shown in the figure below. Where is the location of the opencv lib and the libraries needed to add on GCC Linker? Please guide meimage description.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
1

answered 2012-11-09 11:51:24 -0500

vlattson gravatar image

updated 2012-11-09 11:56:38 -0500

Hi Karl. I use openCV on Linux, not Windows and the configuration may differ a little bit, but it should be possible to find an analogy. If you have added compiler's includes then try only to add libraries names (assuming that these libraries are in some standard system's location, if not, then add also the directory to search path in the lower field). In my case it is:

image description

The names probably are the same both on Windows and Linux, even though they have different extensions (.dll on Windows and .so on Linux), but I am not quite sure. If it won't be work - ask google and youtube. There is plenty of configuration tutorials. On the other hand, try to consider changing your IDE. Eclipse with CDT is not exactly the most convienient one for C++. I have no big experience with Windows but maybe MS Visual Studio would be better? Or Code::Blocks, it's free.

edit flag offensive delete link more

Comments

Hello Macbie. Thanks for your reply. I wonder where did you get the names opencv_core, opencv_imgproc? Here is the link to my original question. http://answers.opencv.org/question/3947/errors-in-displayimagecpp-tutorial-in-eclipse/

Karl gravatar imageKarl ( 2012-11-09 13:13:26 -0500 )edit

@Karl, did you mean where I get these names FROM? On Linux libraries of openCV are named libopencv_core.so.2.4, libopencv_imgproc.so.2.4 etc. And while typing you ommit the 'lib' prefix, just because. On Windows there are .dll extensions. Whatever, did you read tutorial? http://docs.opencv.org/2.4.3rc/doc/tutorials/introduction/windows_install/windows_install.html Maybe on Windows there is totally different method, I don't know. Try to figure it out and post here when you solve it, please. Just for my curiosity. Good luck!

vlattson gravatar imagevlattson ( 2012-11-09 13:52:46 -0500 )edit

Hello again Macbie! I'm using Eclipse-Indigo. What will I put in library search path(-L)? The folders in my OpenCV 2.4.3 are 3rdparty, android,apps,build,cmake,data,doc,include,ios,modules,samples. No lib folder found.

Karl gravatar imageKarl ( 2012-11-09 15:02:54 -0500 )edit

Probably some path to directories with openCV libs, or nothing if the system knows it somehow. I cannot help you more, I rarely work on Windows and even then I have neither openCV nor Eclipse installed on that platform. Search on google, youtube, StackOverflow etc.

Didn't you have some .dll files in your OpenCV directory?

vlattson gravatar imagevlattson ( 2012-11-10 11:52:06 -0500 )edit

Thanks macbie. I've been searching on google, stackoverflow for weeks. No luck at all. I think OpenCV must update their installation tutorials.

Karl gravatar imageKarl ( 2012-11-11 00:53:27 -0500 )edit

@Karl As I can see it's exe file here: http://sourceforge.net/projects/opencvlibrary/files/opencv-win/2.4.3/ But after installation, does it appear some summary or whatever to inform you which files have been installed and at which location? Because from Eclipse point of view the platform shouldn't make such a big difference. Could you reinstall your openCV and make a few printscreens when any valuable information appears during installation process? It shouldn't be such a pain to get it running.

vlattson gravatar imagevlattson ( 2012-11-11 02:50:31 -0500 )edit
0

answered 2012-11-13 08:26:23 -0500

manmedia gravatar image

@Karl For the linker you always have to use specify {names}.lib files, and {names} can be found from %OpenCV_Directory%\build\{x86|x64}\minGW\lib directory. And the library search path would be the same. For example, when you go to the path above, you will see:

   opencv_core243d.lib
   opencv_highgui243d.lib
   ...
   ...

Any file name with 'd' suffix means they are linked at the Debug configuration of your build. You should only paste the debug .lib files in debug configuration and release .lib files in release configuration. That should do the job for you. If you still cannot do it, let me know.

edit flag offensive delete link more

Comments

I can't find the solution to my problem. It's about ndk-build.cmd. Here is the link http://answers.opencv.org/question/4137/error-cannot-run-program-ndk-buildcmd/

Karl gravatar imageKarl ( 2012-11-13 14:28:44 -0500 )edit

@Karl So this NDK environment variable, did you check if it is actually correct/doing something? It seems like you have the ndk-build shell but cannot link to it due to path error? am I getting it wrong?

Also, I think it is more linke ndk-build.bat NOT ndk-build.com...can you find where it is looking for .com file and change it to .bat file? May be it is the extension of the file that is getting wrong?

manmedia gravatar imagemanmedia ( 2012-11-13 15:37:02 -0500 )edit
1

Yes man, there is. I don't know why Eclipse can't recognize the path to my ndk-build.cmd.

Karl gravatar imageKarl ( 2012-11-13 16:32:18 -0500 )edit

@Karl sorry If I am making you frustrated, did you use the (boring) OpenCV's installation manual for Android Development with Eclipse? In case you haven't http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/android_dev_intro.html and also http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/O4A_SDK.html

(Apologies in advance if you have done these) I know how frustrating it can be as I was in your stage too.....

manmedia gravatar imagemanmedia ( 2012-11-13 17:07:22 -0500 )edit

Yes man, I followed the manual. No worries about the frustration. I tried using the commandline. I can't post the picture here. So, kindly go to the original link. http://answers.opencv.org/question/4137/error-cannot-run-program-ndk-buildcmd/

Karl gravatar imageKarl ( 2012-11-13 17:17:17 -0500 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2012-11-09 10:52:55 -0500

Seen: 1,695 times

Last updated: Nov 13 '12