I've got a Camera (thorlabs dcc1645c) which comes with a "uc480.h" + "uc480.lib" to program it with c++. My problem is that I need to use the Camera with Python, so I tried to call a C++ Class with Python as told by Florian:
This is my c++ code (Cam2.cpp):
\#include "uc480.h"
class Cam{
public:
UC480_CAMERA_LIST* pucl;
int nNumberOfCameras;
int GetNumberOfCameras(){
return is_GetNumberOfCameras(&nNumberOfCameras);
}
};
extern "C" {
Cam* Cam_new(){ return new Cam(); }
int Cam_GetNumberOfCameras(Cam* cam){ cam->GetNumberOfCameras(); }
}
I tried to compile with g++:
g++ -fPIC -c Cam2.cpp -o Cam2.o
g++ -shared -Wl,-soname,libCam2.so -o libCam2.so Cam2.o
The second line gives an error:
Cam2.o:Cam2.cpp:(.text$_ZN3Cam18GetNumberOfCamerasEv[Cam::GetNumberOfCameras()]+
0x1a): undefined reference to `__imp_is_GetNumberOfCameras'
collect2.exe: error: ld returned 1 exit status
'is_GetNumberOfCameras' is defined in "uc480.lib", so in my opinion there is a problem with the linking. How do I fix it?
Also tell me please, if you now other possibilities to use the Camera with Python.