I have recently obtained an SDK to interface with cameras made by Lumenera. They provide a .dll and .lib file for MSVC and also claim the library could be used with Borland C++. My project, however, is using MinGW (g++) and they do not provide support for that.
I know similar questions have been asked before (such as here, here, and here), but I have hope that I will be able to use the libraries in MinGW because of these lines in the api header:
#ifdef __cplusplus
#define LUCAM_API
extern "C" __declspec(dllexport)
#else
#define LUCAM_API __declspec(dllexport)
#endif
#else
#ifdef __cplusplus
#define LUCAM_API
extern "C" /*__declspec(dllexport)*/
#else
#define LUCAM_API /*__declspec(dllexport)*/
#endif
#define LUCAM_EXPORT __stdcall
I have read that it's unlikely to get C++ libraries to work between different compilers, but these lines suggest to me that the libraries are in C. Is that a fair interpretation?
Following the steps suggested on the MinGW MSVC and MinGW DLLs page results in an error such as:
undefined reference to `LucamNumCameras()@0'
I have tried both the reimp and pexports and dlltool procedure, and they both give the same response. I am unable to get the source code, and before I begin trying to migrate all of my pre-existing code into MSVC, are there any last suggestions to get this to work?
EDIT
I am using the CodeLite IDE and have given its linker the library "liblucamapi.a" and given its path in the appropriate field as well. I can confirm from the build output that the library path was given to g++ with -L../../Lib/lib32
and the library itself as "-llucamapi"
. No other flags were given to g++ besides -o ./Debug/v2 @"v2.txt"
.