- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I got this error message when building my DLL with static link to IPP and static link to OpenCV.
Pre-built library from OpenCV v2.4.0, build\\x86\\vc10\\staticlib\\opencv_core240d.lib Static link to parallel flavors of IPP v7.0.205 libs via _IPP_PARALLEL_STATIC macro. Static link to CRT (/MTd) in Visual Studio 2010. Got this error:
error LNK2005: _log already defined in libmmt.lib(log_stub.obj)
No error appears when linking against non-parallel IPP libs using _IPP_SEQUENTIAL_STATIC macro. I added libmmt.lib to /nodefaultlib linker option and error disappeared. By commenting out parts of my code I found out this error begins to appear when there is a call to the constructor of cv::Mat class in my code.
Since it is the default built of OpenCV libs without any support of IPP, I wonder, why I had this error.
Pre-built library from OpenCV v2.4.0, build\\x86\\vc10\\staticlib\\opencv_core240d.lib Static link to parallel flavors of IPP v7.0.205 libs via _IPP_PARALLEL_STATIC macro. Static link to CRT (/MTd) in Visual Studio 2010. Got this error:
error LNK2005: _log already defined in libmmt.lib(log_stub.obj)
No error appears when linking against non-parallel IPP libs using _IPP_SEQUENTIAL_STATIC macro. I added libmmt.lib to /nodefaultlib linker option and error disappeared. By commenting out parts of my code I found out this error begins to appear when there is a call to the constructor of cv::Mat class in my code.
Since it is the default built of OpenCV libs without any support of IPP, I wonder, why I had this error.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
The problem happened likely because two math libraries were linked into the application. With adding the _IPP_PARALLEL_STATIC, the libmmt.lib library was implicitly included into linking line. While the static link to CRT (/MTd) in Visual Studio 2010 will also add the VS runtime libraries. The _log function are defined in both libraries, and report such error. It is right that you can use /nodefaultlib option to remove the problem.
Thanks,
Chao
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page