Zamaster
31st March 2014, 22:55
I'm attempting to use OpenCV 248 within my Qt Creation application and am hitting a linking snag. In the .pro file I have the following defined:
#--------------- specifying opencv libs -----------------
CV_LIB_PATH = ../../Libs/x64/opencv/build/x64/vc12/staticlib/
CV_VERSION = 248
CV_LIBS += opencv_core \
opencv_features2d \
opencv_highgui \
opencv_imgproc \
#--------------------------------------------------------
CV_DEBUG =
debug {
CV_DEBUG += d
}
cvpaths =
cvlibs =
for(libName, CV_LIBS){
cvpaths += -L$${CV_LIB_PATH}$${libName}$${CV_VERSION}$${CV_DEB UG}
cvlibs += -l$${libName}$${CV_VERSION}$${CV_DEBUG}
}
INCLUDEPATH += ../../Includes \
../../Includes/opencv/includes \
LIBS += $${cvpaths} $${cvlibs}
-and qmake seems to find everything just fine, no errors. Then in an unassuming object file:
#include "autoslicer.h"
#include "opencv2/core/core.hpp"
Autoslicer::Autoslicer()
{
cv::Mat2d a;
}
It finds the include just fine. So I know I've got my path's right.
When I go to build I get a bunch of unresolved's for instantiating that Mat2d. What did I miss? Thanks!
Added after 1 32 minutes:
So I did notice that I had an extra "\" after my last include path line, fair enough. After checking for other inconsistencies, I ran again, and now Qt is hitting me with a linker 1104, "cannot open output file 'opencv_core248d.lib".
This puzzled me as the CV_LIB_PATH variable I created seemed correct. So then I put the static libs in with the .pro and changed CV_LIB_PATH to "". (NOTE: CV_LIB_PATH is my own variable I define in the .pro file) Still Qt cannot locate the file (and I would imagine the others). Is there anything glaringly wrong that I did?
#--------------- specifying opencv libs -----------------
CV_LIB_PATH = ../../Libs/x64/opencv/build/x64/vc12/staticlib/
CV_VERSION = 248
CV_LIBS += opencv_core \
opencv_features2d \
opencv_highgui \
opencv_imgproc \
#--------------------------------------------------------
CV_DEBUG =
debug {
CV_DEBUG += d
}
cvpaths =
cvlibs =
for(libName, CV_LIBS){
cvpaths += -L$${CV_LIB_PATH}$${libName}$${CV_VERSION}$${CV_DEB UG}
cvlibs += -l$${libName}$${CV_VERSION}$${CV_DEBUG}
}
INCLUDEPATH += ../../Includes \
../../Includes/opencv/includes \
LIBS += $${cvpaths} $${cvlibs}
-and qmake seems to find everything just fine, no errors. Then in an unassuming object file:
#include "autoslicer.h"
#include "opencv2/core/core.hpp"
Autoslicer::Autoslicer()
{
cv::Mat2d a;
}
It finds the include just fine. So I know I've got my path's right.
When I go to build I get a bunch of unresolved's for instantiating that Mat2d. What did I miss? Thanks!
Added after 1 32 minutes:
So I did notice that I had an extra "\" after my last include path line, fair enough. After checking for other inconsistencies, I ran again, and now Qt is hitting me with a linker 1104, "cannot open output file 'opencv_core248d.lib".
This puzzled me as the CV_LIB_PATH variable I created seemed correct. So then I put the static libs in with the .pro and changed CV_LIB_PATH to "". (NOTE: CV_LIB_PATH is my own variable I define in the .pro file) Still Qt cannot locate the file (and I would imagine the others). Is there anything glaringly wrong that I did?