HBadertscher / Matlab_BaslerCamDriver

A universal MATLAB driver for Basler cameras
MIT License
21 stars 5 forks source link

Compilation issue #9

Closed njw500 closed 8 years ago

njw500 commented 9 years ago

I cannot currently get the code to "make" successfully. I have tried : MEX configured to use 'Microsoft Visual C++ 2012' for C++ language compilation and VisualStudio 2010.

With Visual C++ 2012 I get for the compilation of the Function baslerGetData.cpp

Error using mex Creating library baslerGetData.lib and object baslerGetData.exp baslerGetData.obj : error LNK2019: unresolved external symbol "class boost::system::error_category const & cdecl boost::system::system_category(void)" (?system_category@system@boost@@YAAEBVerror_category@12@XZ) referenced in function "void __cdecl boost::system::`dynamic initializer for 'native_ecat''(void)" (??Enative_ecat@system@boost@@YAXXZ) baslerGetData.obj : error LNK2019: unresolved external symbol "class boost::system::error_category const & cdecl boost::system::generic_category(void)" (?generic_category@system@boost@@YAAEBVerror_category@12@XZ) referenced in function "void __cdecl boost::system::`dynamic initializer for 'errno_ecat''(void)" (??Eerrno_ecat@system@boost@@YAXXZ) baslerGetData.obj : error LNK2019: unresolved external symbol "void cdecl boost::filesystem::path_traits::convert(wchar_t const ,wchar_t const ,class std::basic_string<char,struct std::char_traits,class std::allocator > &,class std::codecvt<wchar_t,char,int> const &)" (?convert@path_traits@filesystem@boost@@YAXPEB_W0AEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV?$codecvt@_WDH@5@@Z) referenced in function "void cdecl boost::filesystem::path_traits::convert(wchar_t const ,wchar_t const ,class std::basic_string<char,struct std::char_traits,class std::allocator > &)" (?convert@path_traits@filesystem@boost@@YAXPEB_W0AEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) baslerGetData.obj : error LNK2019: unresolved external symbol "public: static class std::codecvt<wchar_t,char,int> const & cdecl boost::filesystem::path::codecvt(void)" (?codecvt@path@filesystem@boost@@SAAEBV?$codecvt@_WDH@std@@XZ) referenced in function "void cdecl boost::filesystem::path_traits::convert(wchar_t const ,wchar_t const ,class std::basic_string<char,struct std::char_traits,class std::allocator > &)" (?convert@path_traits@filesystem@boost@@YAXPEB_W0AEAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) baslerGetData.mexw64 : fatal error LNK1120: 4 unresolved externals

AND With VisualStudio2010 I get: Error using mex baslerGetParameter.cpp C:\projects\Basler\baslerGetParameter.cpp(13) : error C2332: 'enum' : missing tag name C:\projects\Basler\baslerGetParameter.cpp(13) : error C2236: unexpected 'class' 'ParamType'. Did you forget a ';'? C:\projects\Basler\baslerGetParameter.cpp(13) : error C3381: 'ParamType' : assembly access specifiers are only available in code compiled with a /clr option

I guess this one is due to C++11 ?

But I dont know how to solve either.

I also have VisualStudio 2015 Community (not professional), but I am not sure if Matlab mex can run with this.

njw500 commented 9 years ago

I have now got VisualStudioPro2013 installed and have rebuilt the boost libraries to -vc120- .

Unfortunately I get the same error as above.

Any suggestions ?

MIngPAPA commented 8 years ago

Hello, @njw500 I don't know whether you have solved the issue.I just met the same promblem last night,almost the same as yours.After several efforts, I finally conquered it. Well,I want to share my solution with you! The errors are caused by the boost library which lacks some libraries needed.Personally speaking,it may blame to the compiling process which omits some parameters when building the Boost.(I don't know well about the Boost Library so that I just give the reason with the most probability I guess) As a result,I choose the pre-compiled Boost Library.Since you are using VS 2013 PRO,you can go to sourceforge to download the msvs-12 version. Then,follow Lansbergen's tutorial BaslerCamDriver_Installation_Tutorial_Windows_7. Pay great attention to Step 5 to change the library folder. Wish you can deal with it !

P.S. Environment: OS: Windows 8.1 x64 IDE:VS2013 PRO MATLAB:2015b BOOST:1.60-msvc-12.0