Add new comment

Compile and use with mingw

Hello,
May I ask a question about using libraw with mingw?
My OS is Windows 7 and I installed MSYS and mingw492_32.
I download LibRaw-0.17.2.zip and extract it.
On command prompt, I executed
sh ./configure
mingw32-make -f Makefile.mingw
and could get lib\libraw.a

I tried to test this static library with simple_dcraw.cpp in samples folder.
g++ simple_dcraw.cpp -o simple.exe -Ilibraw -Llib -lraw

I got the following error messages:

C:\Users\ssd\AppData\Local\Temp\ccQ5HLLa.o:simple_dcraw.cpp:(.text+0x6e): undefined reference to `_imp___ZN6LibRawC1Ej'
C:\Users\ssd\AppData\Local\Temp\ccQ5HLLa.o:simple_dcraw.cpp:(.text+0x82): undefined reference to `_imp___ZN6LibRaw11cameraCountEv'
C:\Users\ssd\AppData\Local\Temp\ccQ5HLLa.o:simple_dcraw.cpp:(.text+0x8b): undefined reference to `_imp___ZN6LibRaw7versionEv'
C:\Users\ssd\AppData\Local\Temp\ccQ5HLLa.o:simple_dcraw.cpp:(.text+0x267): undefined reference to `_imp___ZN6LibRaw10cameraListEv'
C:\Users\ssd\AppData\Local\Temp\ccQ5HLLa.o:simple_dcraw.cpp:(.text+0x2f7): undefined reference to `_imp___ZN6LibRaw9open_fileEPKcx'
C:\Users\ssd\AppData\Local\Temp\ccQ5HLLa.o:simple_dcraw.cpp:(.text+0x315): undefined reference to `_imp__libraw_strerror'
C:\Users\ssd\AppData\Local\Temp\ccQ5HLLa.o:simple_dcraw.cpp:(.text+0x363): undefined reference to `_imp___ZN6LibRaw6unpackEv'
C:\Users\ssd\AppData\Local\Temp\ccQ5HLLa.o:simple_dcraw.cpp:(.text+0x37e): undefined reference to `_imp__libraw_strerror'
C:\Users\ssd\AppData\Local\Temp\ccQ5HLLa.o:simple_dcraw.cpp:(.text+0x3d0): undefined reference to `_imp___ZN6LibRaw12unpack_thumbEv'
C:\Users\ssd\AppData\Local\Temp\ccQ5HLLa.o:simple_dcraw.cpp:(.text+0x3eb): undefined reference to `_imp__libraw_strerror'
C:\Users\ssd\AppData\Local\Temp\ccQ5HLLa.o:simple_dcraw.cpp:(.text+0x4b5): undefined reference to `_imp___ZN6LibRaw18dcraw_thumb_writerEPKc'
C:\Users\ssd\AppData\Local\Temp\ccQ5HLLa.o:simple_dcraw.cpp:(.text+0x4d3): undefined reference to `_imp__libraw_strerror'
C:\Users\ssd\AppData\Local\Temp\ccQ5HLLa.o:simple_dcraw.cpp:(.text+0x51d): undefined reference to `_imp___ZN6LibRaw13dcraw_processEv'
C:\Users\ssd\AppData\Local\Temp\ccQ5HLLa.o:simple_dcraw.cpp:(.text+0x533): undefined reference to `_imp__libraw_strerror'
C:\Users\ssd\AppData\Local\Temp\ccQ5HLLa.o:simple_dcraw.cpp:(.text+0x60c): undefined reference to `_imp___ZN6LibRaw21dcraw_ppm_tiff_writerEPKc'
C:\Users\ssd\AppData\Local\Temp\ccQ5HLLa.o:simple_dcraw.cpp:(.text+0x62a): undefined reference to `_imp__libraw_strerror'
C:\Users\ssd\AppData\Local\Temp\ccQ5HLLa.o:simple_dcraw.cpp:(.text+0x661): undefined reference to `_imp___ZN6LibRaw7recycleEv'
C:\Users\ssd\AppData\Local\Temp\ccQ5HLLa.o:simple_dcraw.cpp:(.text+0x684): undefined reference to `_imp___ZN6LibRawD1Ev'
C:\Users\ssd\AppData\Local\Temp\ccQ5HLLa.o:simple_dcraw.cpp:(.text+0x699): undefined reference to `_imp___ZN6LibRawD1Ev'
C:/Qt/Qt5.6.2/Tools/mingw492_32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: C:\Users\ssd\AppData\Local\Temp\ccQ5HLLa.o: bad reloc address 0xd in section `.text$_ZNSt8auto_ptrISt15basic_streambufIcSt11char_traitsIcEEEC2ERS4_[__ZNSt8auto_ptrISt15basic_streambufIcSt11char_traitsIcEEEC2ERS4_]'
C:/Qt/Qt5.6.2/Tools/mingw492_32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: final link failed: Invalid operation
collect2.exe: error: ld returned 1 exit status

Did I set something incorrectly? And I saw Qt project files on buildfiles. I
tried to compile in Qt, but only gives error messages.

ST

Forums: