Issue with build on symbols OpenCV 3.2.0 / VS2015 / Release (x64)
Hey all
I've been hitting a problem for a couple of days now of getting OpenCV to run within a project with VS2015 but am having library linking problems.
Specifically, I'm the maintainer of the ofxCvMin addon for openFrameworks, and am currently trying to upgrade the libraries from 2.4.x to 3.2.0. (I've built and linked opencv libs a few times for windows and osx over the years).
I can successfully build Debug and Release libs (this wasn't an issue at all). (note : current setup is static libs, not using static CRT)
I managed to build an application linking the debug libraries (with a little extra help on #opencv IRC), but Release is still is not working. VC++ doesn't seem to recognise the imported symbols.
Diggiging deeper, it seems that the C++ application is looking for :
?deallocate@Mat@cv@@QAEXXZ
public: void __thiscall cv::Mat::deallocate(void)
when building. But in opencv_core320.lib
we have:
?deallocate@Mat@cv@@QEAAXXZ
public: void __cdecl cv::Mat::deallocate(void) __ptr64
which VC++ doesn't consider to be a compatible symbol. I presume there are some project settings which affect the symbol naming strategy (__thiscall <> __cdecl hints at a C++ vs C style).
Is anybody aware of project settings which affect how the symbols are decorated when using OpenCV with VC++?
Thank you
NB : CMAKE is not an option here as the projects/solutions need to be openFrameworks generated (although could be used to look into which build settings are present)
also i posted the question on SO http://stackoverflow.com/questions/42... (i imagine more general C++ experience with name mangling there, and more experience with opencv building here :)
"NB : CMAKE is not an option here" -- ok, up to you, but that seems to be a useful hint, that we have to look at your build pipeline / makefile, whatever you use there. could you shed some light on this ?
can it be, your ofx project builds a 32bit binary ?
also, with static linking, oreder matters (opencv_core has to go behind anything, that references it)
hi berak. Thank you for helping on this! I now tried moving opencv_core320.lib to front and end of lib list but same result. definitely using all 64bit (checked dumpbin and all application project settings). I'll try CMAKE now as a sanity check + if it works i can compare project differences.