nikolaseu / neuvision

Structured Light based 3D scanner
GNU General Public License v3.0
288 stars 81 forks source link

Cannot find "-lopencv_..." #4

Closed ziqB closed 7 years ago

ziqB commented 7 years ago

Hello, I am a student very new in this area and currently facing a few errors while running this software on QT creator for my project.

Initially I have assigned the libraries to PATH, but when i run them. My QT is unable to find the lib which already exist in my computer, hence i manually type down the full address of the library into the code, and the QT will than be able to find the lib.

secondly, i received this error: C:/test/Tools/mingw530_32/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lopencv_core300d C:/test/Tools/mingw530_32/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lopencv_imgproc300d C:/test/Tools/mingw530_32/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lopencv_imgcodecs300d C:/test/Tools/mingw530_32/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lopencv_videoio300d C:/test/Tools/mingw530_32/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lopencv_calib3d300d C:/test/Tools/mingw530_32/bin/../li cannot find -lopencv_calib3d300d C:/test/Tools/mingw530_32/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lopencv_features2d300d C:/test/Tools/mingw530_32/bin/../lib/gcc/i686-w64-mingw32/5.3.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lopencv_flann300d collect2.exe: error: ld returned 1 exit status mingw32-make[4]: [........\neuvision-master\bin\debug5\zcameraacquisitiond1.dll] Error 1 mingw32-make[3]: [debug] Error 2 mingw32-make[2]: [sub-src-make_first] Error 2 mingw32-make: [sub-lib-make_first] Error 2 15:34:45: The process "C:\test\Tools\mingw530_32\bin\mingw32-make.exe" exited with code 2. Error while building/deploying project NEUVision (kit: Desktop Qt 5.9.0 MinGW 32bit) When executing step "Make"

I reinstalled OpenCV3.0, but the issue isn't solved. May i know that do i need to do to solve this error...Is it my manual change of code caused this problem? Or do i need to add extra lines of codes to solve this issue.

Thankiew for your time!!!

nikolaseu commented 7 years ago

Hi, it's been a few months (years maybe) since I last tried this in windows. Are you setting the right paths in the include and lib dir in https://github.com/nikolaseu/neuvision/blob/master/3rdparty/opencv.pri ? What else have you changed?

nikolaseu commented 7 years ago

Also see the version number. How are the lib and dll files named in your opencv installation?

ziqB commented 7 years ago

I've changed the #include "Full address" and the include and lib dir on opencv.pri according to my files location:

win32 { !contains(QMAKE_TARGET.arch, x86_64) { OPENCV_INCLUDE_DIR = "C:/OpenCV3.0/opencv/build/include" OPENCV_LIB_DIR = "C:/OpenCV3.0/opencv/build/x64/vc12/lib" OPENCV_VER = 300 message('Using OpenCV x86 version '$$OPENCV_VER) } else { OPENCV_INCLUDE_DIR = "C:/OpenCV3.0/opencv/build/include" OPENCV_LIB_DIR = "C:/OpenCV3.0/opencv/build/x64/vc12/lib" OPENCV_VER = 300 message('Using OpenCV x86_64') }}

The names of my lib and dll files are "opencv_(name)300d", so i assume that they are version 300. However i still received the same error as my first post. I tried to re-run a new clean code without my edition and the error became:

_\3rdparty\3rdparty.pro was unexpected at this time. Makefile:47: recipe for target 'sub-3rdparty-make_first' failed mingw32-make: *** [sub-3rdparty-make_first] Error 255 09:53:51: The process "C:\test\Tools\mingw53032\bin\mingw32-make.exe" exited with code 2. Error while building/deploying project NEUVision (kit: Desktop Qt 5.9.0 MinGW 32bit) When executing step "Make"

nikolaseu commented 7 years ago

I've changed the #include "Full address"

What do you mean with this? The #include in .h/.cpp files should not need any change!

I'm not sure, but seems you're mixing qt & mingw 32bits with opencv binaries built for 64bits and visual studio (2015 I guess). So even if libs were found, I don't think it'll work.

I can't help you much since I don't have a windows machine, but I suggest you first try to have a working test project with only your opencv and Qt installation.

Keep in mind that opencv is only one of the dependencies (depending what you want to build), so make sure you have every library built for the correct compiler you're trying to use.

What are you expecting from this project? What are you interested in? Calibration? The 3d scanner? I ask because I wanted to split this in diff projects to reduce dependencies when you want only one of the apps. Maybe it's a good time to do it

ziqB commented 7 years ago

My project is to combine multiple 3D cameras into a single output, so that it can scan a wider area at one time. I am using RTAB map currently and now finding ways to combine the cameras..