HBadertscher / Matlab_BaslerCamDriver

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

Build error of make.m #19

Closed cmg83 closed 7 years ago

cmg83 commented 8 years ago

Hi there,

I checked some similar issues, but I didn't find a solution for my problem. When it gets to mex on the make file, the error message is "??? Error using ==> mex at 207 Unable to complete successfully"

with a possible hint before the error message saying

" C:\PROGRA~1\MATLAB\R2008A\BIN\MEX.PL: Error: Unrecognized switch: -std=c++0x."

I checked all the arguments for mex (flags{:},libraries{k,3},ipaths,lpaths,libraries{k,2}) and they seem alright (k =2). I'm supposing the problem is in ipaths and lpaths. This is what mex is receiving from both:

ipaths =

-I"C:\Program Files\Basler\pylon 4\pylon\include" -I"C:\Program Files\Basler\pylon 4\genicam\library\CPP\include" -I"C:\Program Files\boost\boost_1_60_0" lpaths =

-L"C:\Program Files\Basler\pylon 4\pylon\lib\Win32" "C:\Program Files\Basler\pylon 4\genicam\library\CPP\Lib\win32_i86" "C:\Program Files\boost\boost_1_60_0\stage\lib"

In terms of directories, the paths should be fine. Is it missing some space between -I and "C:..." ? Thanks!

sochummy commented 8 years ago

I got the same error! I am using MATLAB R2010b to compile. By the way where did you get the Boost? I got it here but not sure how to install it properly: http://www.boost.org/users/history/version_1_55_0.html

Thank you.

cmg83 commented 8 years ago

Hi sochummy,

I'm running on Matlab 2008a on Windows 7 32bits. I got boost from the same place as you, only the newer version (1.60.0) and I followed this [http://www.boost.org/doc/libs/1_60_0/more/getting_started/windows.html] to build it. You can also get pre-built binaries (just type it on google and you'll have some options). I'll try that as well to see if the problem relies on a bad build from my part. thanks!

cmg83 commented 8 years ago

I found this tutorial in one of the other comments here https://github.com/Lansbergen/BaslerCamDriver_Installation_Tutorial_Windows_7.git and it is really usefull. I found out my problem is with the compiler and problably due to the fact that I'm not on a 64bit machine.

sochummy commented 8 years ago

Hi cmg83,

Thanks to the tutorial you showed me I have successfully compiled the driver!

It turns out that my MATLAB R2010b 64bit is too old for this work. I still got this error in MATLAB R2010b: C:\PROGRA~1\MATLAB\R2010B\BIN\MEX.PL: Error: Unrecognized switch: -std=c++0x. eventhough everything else was set correctly.

I had to download MATLAB 2016a trail 64bit version to run the make.m file. Good news is I can capture images from my Basler camera in MATLAB now. Bad news is my MATLAB trial version will expire soon. After I compiled the driver, I tried to run the functions in my old MATLAB 2010 but only the functions "baslerFindCameras" and " baslerCameraInfo" work.

I am wondering if there is any workarounds for this issue... to make the compiled files work in MATLAB 2010 or older.