I want to ask a question about my recent attempt to configure OpenCV with Eclipse. After configuring, generating and installing a MinGW-based makefile opencv project, launching it shows Eclipse can't find the opencv include files to build the new project. In fact Eclipse is using a MingW path I don't recall setting. I need some assistance to move on into the programming phase - stuck here. I've even tried hard coding an include for testing and Eclipse still can't find the include.
> it shows Eclipse can't find the opencv include files to build the new project
No, it doesn't.
> In fact Eclipse is using a MingW path I don't recall setting.
The "path" you are showing is the path to the linker. You can tell this by noting the "ld.exe" at the end of it. The message is that the linker cannot find the libraries you are specifying. Ensure that they exist in the directory you've told it to look in.
The linker is called after all of the code in your project has been compiled (therefore, it found all of the include/header files necessary for compilation.)
> "-lopencv_calib3d340 "
¿why that space at the end?
-l is just a shortcut, you may write the full path to the library g++ C:\\opencv_src\\opencv-3.4.0\\Mingw_build\\install\\x64\\mingw\\lib\\libopencv_calib3d340.a
Why? I've got it searching the OpenCV install, but no it isn't.
Hey Ne555 how do I execute that statement (in my IDE)?:
g++ C:\\opencv_src\\opencv-3.4.0\\Mingw_build\\install\\x64\\mingw\\lib\\libopencv_calib3d340.a
I don’t know what happened but I rebuilt the library, making sure Eclipse was pointing to all of the correct libs/bins, made sure all header files were included. Maybe the most important was making sure I had a path in the main system the pointed to both the bin & lib folders. Cleaned out a few paths that weren’t used anymore. And boom, we have launch (except I don’t know where the image/image file is) for demo.
The build was also missing a lib folder in the install directory.
The problem may be that you are trying to use a relative path. It would have to be relative to the directory where make is running the GCC linker. Try using the full path to the libraries. If you think you must use relative paths, temporarily change the linker command to display the current working directory then calculate the necessary relative path to it from the working directory of the link. http://www.cetpainfotech.com/technology/c-language-training