Is anyone using libraw with mingw? I am trying to compile a program and get the following errors:
obj\Release\inc\img\cimg.o:cimg.cpp|| undefined reference to `_imp___ZN6LibRawC1Ej'|
obj\Release\inc\img\cimg.o:cimg.cpp|| undefined reference to `_imp___ZN6LibRaw9open_fileEPKcx'|
obj\Release\inc\img\cimg.o:cimg.cpp|| undefined reference to `_imp___ZN6LibRaw6unpackEv'|
obj\Release\inc\img\cimg.o:cimg.cpp|| undefined reference to `_imp___ZN6LibRaw13dcraw_processEv'|
obj\Release\inc\img\cimg.o:cimg.cpp|| undefined reference to `_imp___ZN6LibRaw20dcraw_make_mem_imageEPi'|
obj\Release\inc\img\cimg.o:cimg.cpp|| undefined reference to `_imp___ZN6LibRaw7recycleEv'|
obj\Release\inc\img\cimg.o:cimg.cpp:(.text$_ZN6LibRawD1Ev[LibRaw::~LibRaw()]+0xf)||undefined reference to `_imp___ZN6LibRaw7recycleEv'|
||=== Build finished: 7 errors, 0 warnings ===|
I added libraw.a to my project. Can’t figure the problem out.
Has anyone an idea?
From those symbol names, it looks like you’re trying to compile against a DLL version of libraw (hinted at by the
_imp___prefix). Check your libraw header files and make sure that the function names don’t have anything like__declspec(dllimport)or__attribute__((dllimport))in front of them. These are sometimes hidden by a macro definition, so check the header files to see if there’s another macro you can define which will cause it not to use that attribute in the function prototypes.