0

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".

Community
  • 1
  • 1
EP_Guy
  • 95
  • 7
  • You can't be the first programmer that uses this toolset on the vendor's libraries. The obvious place to find help first is with the vendor. Pick up the phone and dial +1 613-736-4077 – Hans Passant Feb 01 '14 at 08:11
  • You need to make an import library. Use the Mingw tools to do that. – David Heffernan Feb 01 '14 at 08:30
  • @HansPassant I've already been in contact with the vendor. They have simply said that if I import the functions directly and create my own wrapper, it should work after resolving all dependencies with their API. I'm new to that, so was wondering how people usually handle these cross-compiler library problems. – EP_Guy Feb 01 '14 at 09:28
  • You are not giving us good info. It is very unlikely that the linker error message actually contain the () parentheses. Nor did you tell us what options you passed to the linker, they matter. There are IDEs that take the sting out of getting this right, recommended. – Hans Passant Feb 01 '14 at 09:32
  • @HansPassant The error message does indeed contain the parentheses, I just tried recompiling to confirm. I added an edit to the question to include that I'm using the CodeLite IDE and only the library name and directory are given as arguments to g++. – EP_Guy Feb 02 '14 at 10:05

0 Answers0