Unsolved Compile libraw on windows 7
-
Hi,
You need to pass the include dir as well as library dir when you are compiling the plugin inside the sources.
-
@SGaist
It seems the line
PKGCONFIG +=
libraw
in src.pro causes the problem. I don't know exactly what PKGCONFIG means but
after googling it seems setting system library. So I commented out those two lines and compiled again, then I got another error message,release/datastream.o:datastream.cpp:(.text+0x1): undefined reference to
_imp___ZTV26LibRaw_abstract_datastream' release/datastream.o:datastream.cpp:(.text+0x117): undefined reference to
_imp___ZTV26LibRaw_abstract_datastream'
c:/Qt/Qt5.6.2/Tools/mingw492_32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: release/datastream.o: bad reloc address 0x0 in section `.rdata$_ZTI26LibRaw_abstract_datastream[__ZTI26LibRaw_abstract_datastream]'
collect2.exe: error: ld returned 1 exit status
Makefile.Release:68: recipe for target 'imageformats/qtraw.dll' failed
mingw32-make[2]: Leaving directory 'd:/qqes/qtraw-master/build-qtraw-Desktop_Qt_5_6_2_MinGW_32bit-Release/src'
Makefile:34: recipe for target 'release' failed
mingw32-make[1]: Leaving directory 'd:/qqes/qtraw-master/build-qtraw-Desktop_Qt_5_6_2_MinGW_32bit-Release/src'
mingw32-make[2]: *** [imageformats/qtraw.dll] Error 1
mingw32-make[1]: *** [release] Error 2
makefile:39: recipe for target 'sub-src-make_first' failed
mingw32-make: *** [sub-src-make_first] Error 2I don't know what to do with this.
-
It's for the pkg-config tool that is not standard on Windows but that you can install.
Hence you need to add to
LIBS
the path and library to link to for libraw. -
I think I added the path and library to LIBS as
else:win32: LIBS += $$PWD/libraw/win32/libraw.a -
LIBS += -L$$PWD/libraw/win32/ -lraw
-
@SGaist
The contents of libraw.pc.in isprefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@Name: libraw
Description: Raw image decoder library (non-thread-safe)
Requires: @PACKAGE_REQUIRES@
Version: @PACKAGE_VERSION@
Libs: -L${libdir} -lraw -lstdc++@PC_OPENMP@
Cflags: -I${includedir}/librawso I set
INCLUDEPATH += $$PWD/libraw
LIBS += -L$$PWD/libraw/win32/ -lraw -lstdc++
but that gives me the same error. -
Which version of MinGW did you use to build libraw ?
-
@SGaist
I used mingw 4.9.2. -
The one provided with Qt ?
-
This post is deleted! -
@SGaist
Yes, It came with 5.6.2 -
Can you check against the latest version of LibRaw ?
There might be a problem with their handling of the imported/exported symbol.