HBadertscher / Matlab_BaslerCamDriver

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

Can't get it compiled on Windows 7 and Matlab2014a #7

Closed t4qjXH8N closed 9 years ago

t4qjXH8N commented 9 years ago

Hi folks,

I can't get the Basler driver compiled on my system. Please help! This is what I have done so far: I have downloaded Boost 1.55.0 and Pylon 4.2 . Since boost does not compile on my system (don't know why), I downloaded the precompiled binaries and supposed that the binaries are in the folder "lib64-msvc-10.0" (there is no folder stage/libs in my Boost folder). Hence I changed in the make script the line with "stage/libs" to "lib64-msvc-10.0". No effect. The linker paths to the pylon stuff are correct. Any ideas?

Here is the Matlab output:

>> make
=> Creating Libraries
Building with 'Microsoft Windows SDK 7.1 (C++)'.
MEX completed successfully.
Building with 'Microsoft Windows SDK 7.1 (C++)'.
MEX completed successfully.
=> Creating Functions
Building with 'Microsoft Windows SDK 7.1 (C++)'.
MEX completed successfully.
Building with 'Microsoft Windows SDK 7.1 (C++)'.
MEX completed successfully.
Building with 'Microsoft Windows SDK 7.1 (C++)'.
Error using mex
baslerGetParameter.cpp
D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(13)
: error C2332: 'enum' : missing tag name
D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(13)
: error C2236: unexpected 'class' 'ParamType'. Did you forget a ';'?
D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(13)
: error C3381: 'ParamType' : assembly access specifiers are only
available in code compiled with a /clr option
D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(14)
: error C4430: missing type specifier - int assumed. Note: C++ does
not support default-int
D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(15)
: error C4430: missing type specifier - int assumed. Note: C++ does
not support default-int
D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(16)
: error C4430: missing type specifier - int assumed. Note: C++ does
not support default-int
D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(18)
: error C2143: syntax error : missing ';' before '}'
D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(18)
: error C4430: missing type specifier - int assumed. Note: C++ does
not support default-int
D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(40)
: error C2039: 'Float' : is not a member of 'ParamType'
        D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(13)
        : see declaration of 'ParamType'
D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(40)
: error C2065: 'Float' : undeclared identifier
D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(41)
: error C2039: 'Int' : is not a member of 'ParamType'
        D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(13)
        : see declaration of 'ParamType'
D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(41)
: error C2065: 'Int' : undeclared identifier
D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(42)
: error C2039: 'Bool' : is not a member of 'ParamType'
        D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(13)
        : see declaration of 'ParamType'
D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(42)
: error C2065: 'Bool' : undeclared identifier
D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(43)
: error C2039: 'String' : is not a member of 'ParamType'
        D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(13)
        : see declaration of 'ParamType'
D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(43)
: error C2065: 'String' : undeclared identifier
D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(86)
: error C2450: switch expression of type 'ParamType' is illegal
        No user-defined-conversion operator available that can perform
        this conversion, or the operator cannot be called
D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(88)
: error C2039: 'Float' : is not a member of 'ParamType'
        D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(13)
        : see declaration of 'ParamType'

D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(88)
: error C2065: 'Float' : undeclared identifier

D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(88)
: error C2051: case expression not constant
D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(95)
: error C2039: 'Int' : is not a member of 'ParamType'
        D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(13)
        : see declaration of 'ParamType'
D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(95)
: error C2065: 'Int' : undeclared identifier
D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(95)
: error C2051: case expression not constant
D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(104)
: error C2039: 'Bool' : is not a member of 'ParamType'
        D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(13)
        : see declaration of 'ParamType'
D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(104)
: error C2065: 'Bool' : undeclared identifier
D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(104)
: error C2051: case expression not constant
D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(111)
: error C2039: 'String' : is not a member of 'ParamType'
        D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(13)
        : see declaration of 'ParamType'
D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(111)
: error C2065: 'String' : undeclared identifier
D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(111)
: error C2051: case expression not constant
D:\Mitarbeiter\Christian\HBadertscher-Matlab_BaslerCamDriver-419332a\baslerGetParameter.cpp(124)
: warning C4065: switch statement contains 'default' but no 'case'
labels

Error in make (line 63)
            mex(flags{:},ipaths,lpaths,libraryObjects{:},drivers{k})

>>
HBadertscher commented 9 years ago

Hi, thank you for the bug report. I'll try to reproduce the error and get back to you asap.

smwasser commented 9 years ago

Hi - I've just come across the same error and was wondering if there were any updates yet to resolving it? Also, did you use 32 or 64bit Matlab and does it matter? Thank you.

HBadertscher commented 9 years ago

Sorry for the delay. Now, from the posted log I assume that you are using the Microsoft Windows SDK 7.1, which is recommended by MATLAB. Is this correct? This would lead to the following problem: SDK 7.1 includes the Visual Studio 2010 compilers, which are quite old by now. The BaslerCamDriver however relies on the C++11 standard, which is not available in SDK 7.1. Could you install and use Microsoft Visual Studio? Visual Studio Community is available free of charge for non-commercial applications. With that the compilation should work fine, as from the error message I don't think this problem is related to Boost.

About 32bit / 64bit: I am using a 64bit version of MATLAB and use the 64-bit Boost and Pylon libraries. With 32bit MATLAB you will need to use the 32bit libraries, so please change according library paths. I am hoping to create a more intelligent build script which would detect the paths automatically, but this is will take some more time.

smwasser commented 9 years ago

Thank you very much for your help! Using the 2013 SDK version worked to talk to the camera.

On Wed, Jul 29, 2015 at 12:40 AM, Hannes Badertscher < notifications@github.com> wrote:

Sorry for the delay. Now, from the posted log I assume that you are using the Microsoft Windows SDK 7.1, which is recommended by MATLAB. Is this correct? This would lead to the following problem: SDK 7.1 includes the Visual Studio 2010 compilers, which are quite old by now. The BaslerCamDriver however relies on the C++11 standard, which is not available in SDK 7.1. Could you install and use Microsoft Visual Studio http://www.visualstudio.com/? Visual Studio Community is available free of charge for non-commercial applications. With that the compilation should work fine, as from the error message I don't think this problem is related to Boost.

About 32bit / 64bit: I am using a 64bit version of MATLAB and use the 64-bit Boost and Pylon libraries. With 32bit MATLAB you will need to use the 32bit libraries, so please change according library paths. I am hoping to create a more intelligent build script which would detect the paths automatically, but this is will take some more time.

— Reply to this email directly or view it on GitHub https://github.com/HBadertscher/Matlab_BaslerCamDriver/issues/7#issuecomment-125871116 .

Sara Wasserman, PhD Postdoctoral Fellow - Frye Lab Howard Hughes Medical Institute UCLA Department of Integrative Biology and Physiology http://sarawasserman.virb.com/

http://www.physci.ucla.edu/research/frye

HBadertscher commented 9 years ago

Great to hear. If you have any further problems, questions or ideas for improvement, please let me know.

smwasser commented 9 years ago

Hi - I know our lab would love the option to be able to do a live real time continuous preview to be able to watch an experiment as we run it. Thank you again for your help and time, it is much appreciated!

On Sun, Aug 2, 2015 at 11:02 PM, Hannes Badertscher < notifications@github.com> wrote:

Great to hear. If you have any further problems, questions or ideas for improvement, please let me know.

— Reply to this email directly or view it on GitHub https://github.com/HBadertscher/Matlab_BaslerCamDriver/issues/7#issuecomment-127133396 .

Sara Wasserman, PhD Postdoctoral Fellow - Frye Lab Howard Hughes Medical Institute UCLA Department of Integrative Biology and Physiology http://sarawasserman.virb.com/

http://www.physci.ucla.edu/research/frye

jrehak commented 9 years ago

Hi, I posted yesterday on the Mathworks site regarding being unable to successfully run make.m. I realized I needed to add BOOST_ROOT to the Windows environment variables path. After doing this, I installed VS 2015 Community as you recommended, but I still get this error. I only selected Visual C++ when prompted with what additional features to install. I followed the steps at this website in order to add VS 2015 to my list of compilers. I only have limited knowledge in C++ so this is all very confusing to me. Thanks again!

babaz123 commented 8 years ago

@HBadertscher Could you please help me compile your driver with VS 2015? (I've never used it before.)

Lansbergen commented 8 years ago

Hi,

I came a cross the same (and unfortunately many more) error as you did. After some struggling I finally managed to create the mex-files by removing the type class in when stated enum class ParamType in line 13 of baslerGetParameter.cpp. It worked just fine for me.

Check out the tutorial I wrote on the topic.

https://github.com/Lansbergen/BaslerCamDriver_Installation_Tutorial_Windows_7.git

Let me know if it worked

smwasser commented 8 years ago

Thank you very much for sharing this. We decided to use a USB 2 camera but I will let you know if we try this in the future!

On Sat, Feb 13, 2016 at 11:51 AM, Lansbergen notifications@github.com wrote:

Hi,

I came a cross the same (and unfortunately many more) error as you did. After some struggling I finally managed to create the mex-files by removing the type class in when stated 'enum class ParamType' in line 13 of baslerGetParameter.cpp. It worked just fine for me.

Check out the tutorial I wrote on the topic.

https://github.com/Lansbergen/BaslerCamDriver_Installation_Tutorial_Windows_7.git

Let me know if it worked

— Reply to this email directly or view it on GitHub https://github.com/HBadertscher/Matlab_BaslerCamDriver/issues/7#issuecomment-183701938 .

Sara Wasserman, PhD Postdoctoral Fellow - Frye Lab UCLA Department of Integrative Biology and Physiology Research: http://sarawasserman.virb.com Outreach: http://www.swirlss.org http://www.physci.ucla.edu/research/frye

babaz123 commented 8 years ago

Hello,

I had finally managed to compile the files (cf https://github.com/HBadertscher/Matlab_BaslerCamDriver/issues/12).

However, I couldn't manage to use this program usefully because of https://github.com/HBadertscher/Matlab_BaslerCamDriver/issues/10

Thanks