Hi,
I'm a developer of Luminance HDR and in the next release (2.0.2, hopefully coming soon) we decided to use LibRaw has RAW converter instead of using dcraw as an external command line tool (old solution). After a bit of work, we implemented what we needed and it worked fine with Linux and OS X, but we are having problems in Windows, because our code is multithread so we need the thread-safe version.
When I tried to link (using MinGW) the DLL you provide (0.11.3), I get these errors:
./generated_obj\pfsinraw.o: In function `Z19readRawIntoPfsFramePKcS0_P16LuminanceOptionsb':
C:\Qt\luminance\luminance-v2.0.2-pre1/src/Fileformat/pfsinraw.cpp:43: undefined reference to `LibRaw::LibRaw(unsigned int)'
C:\Qt\luminance\luminance-v2.0.2-pre1/src/Fileformat/pfsinraw.cpp:94: undefined reference to `LibRaw::open_file(char const*, long
long)'
./generated_obj\pfsinraw.o: In function `~LibRaw':
C:\Qt\luminance\luminance-v2.0.2-pre1/src/Fileformat/pfsinraw.cpp:180: undefined reference to `LibRaw::recycle()'
./generated_obj\pfsinraw.o: In function `Z19readRawIntoPfsFramePKcS0_P16LuminanceOptionsb':
C:\Qt\luminance\luminance-v2.0.2-pre1/src/Fileformat/pfsinraw.cpp:99: undefined reference to `LibRaw::unpack()'
C:\Qt\luminance\luminance-v2.0.2-pre1/src/Fileformat/pfsinraw.cpp:104: undefined reference to `LibRaw::dcraw_process()'
C:\Qt\luminance\luminance-v2.0.2-pre1/src/Fileformat/pfsinraw.cpp:118: undefined reference to `LibRaw::dcraw_make_mem_image(int*)'
C:\Qt\luminance\luminance-v2.0.2-pre1/src/Fileformat/pfsinraw.cpp:165: undefined reference to `LibRaw::dcraw_ppm_tiff_writer(char
const*)'
C:\Qt\luminance\luminance-v2.0.2-pre1/src/Fileformat/pfsinraw.cpp:167: undefined reference to `LibRaw::unpack_thumb()'
C:\Qt\luminance\luminance-v2.0.2-pre1/src/Fileformat/pfsinraw.cpp:171: undefined reference to `LibRaw::dcraw_thumb_writer(char con
st*)'
C:\Qt\luminance\luminance-v2.0.2-pre1/src/Fileformat/pfsinraw.cpp:177: undefined reference to `LibRaw::dcraw_clear_mem(libraw_proc
essed_image_t*)'
C:\Qt\luminance\luminance-v2.0.2-pre1/src/Fileformat/pfsinraw.cpp:178: undefined reference to `LibRaw::recycle()'
./generated_obj\pfsinraw.o: In function `~LibRaw':
C:\Qt\luminance\luminance-v2.0.2-pre1/../DEPs/include/libraw/libraw/libraw.h:133: undefined reference to `LibRaw::recycle()'
collect2: ld returned 1 exit status
mingw32-make[1]: *** [release\luminance.exe] Error 1
Any idea?
Thanks!
There are two different Win32
There are two different Win32 distributions of 0.11:
-Win32, compiled and linked by Visual Studio 2008
-Win32-MinGW - made by MinGW with gcc 4.4
These versions are not compatible.
MinGW version does not contain any .dll, only libraw.a for static linking.
You need either rebuild LibRaw from sources using mingw (mingw32-make -f Makefile.mingw) or download already built -MinGW version.
Direct link to 0.11.3/MinGW: http://www.libraw.org/data/LibRaw-0.11.3-Win32-MinGW.zip
-- Alex Tutubalin @LibRaw LLC
Unfortunately, the static
Unfortunately, the static build made by MinGW (I did it already) of the thread-safe library (libraw_r) gives me exactly the same error during the linking. I'll try with the one included in your link this evening and I'll let you know.
Thanks,
Davide
----
Davide Anastasia
Developer of Luminance HDR
Oh, MinGW library is compiled
Oh,
MinGW library is compiled without thread-safeness. You may try:
1) Add -pthread to CFLAGS in Makefile.mingw
2) Remove -DLIBRAW_NOTHREADS from all compilation rules.
I've added it to TODO for 0.12-Beta3 too
-- Alex Tutubalin @LibRaw LLC
What does -pthread stays for?
What does -pthread stays for? My compiler (GCC 4.4.0 on MinGW) says that it is a unrecognized option.
----
Davide Anastasia
Developer of Luminance HDR
for gcc compiler, -pthread is
for gcc compiler, -pthread is for generating thread-safe code. At least, it should
- define _REENTRANT, so many #includes will change behaviour
- link with thread-safe C runtime
I'm not sure that MinGW has multi-thread safe runtime.
-- Alex Tutubalin @LibRaw LLC
Finally, I've buildt it. If
Finally, I've buildt it. If somebody else is interested in building the thread-safe library using MinGW, here the Makefile (for v. 0.11.3). It works fine.
Thanks for your help,
Davide
Luminance HDR Developer
--------------------------------------
all: library samples
# OpenMP support
#OPENMP_CFLAGS=-fopenmp
#NO_THREADS=-DLIBRAW_NOTHREADS
# LCMS support
#LCMS_DEF=-DUSE_LCMS -I/usr/local/include
#LCMS_LIB=-L/usr/local/lib -llcms
# Common flags
# WARNING: library order matters
COMMON_LIBS=-lws2_32 -lm ${LCMS_LIB}
CLIBS=-L./lib -lraw_r ${COMMON_LIBS}
CFLAGS=-O3 -I. -w -DLIBRAW_NODLL ${OPENMP_CFLAGS} ${NO_THREADS} -lpthread -D_REENTRANT
DCRAW_LIB_OBJECTS=object/libraw_cxx.o object/libraw_c_api.o object/dcraw_common.o object/dcraw_fileio.o
library: lib/libraw_r.a
samples: bin/raw-identify bin/simple_dcraw bin/dcraw_emu bin/dcraw_half bin/mem_image bin/mem_image bin/unprocessed_raw bin/4channels
install: library
@if [ -d /usr/local/include ] ; then cp -R libraw /usr/local/include/ ; else echo 'no /usr/local/include' ; fi
@if [ -d /usr/local/lib ] ; then cp lib/libraw_r.a /usr/local/lib/ ; else echo 'no /usr/local/lib' ; fi
install-samples: samples
@if [ -d /usr/local/bin ] ; then cp bin/[a-z]* /usr/local/bin/ ; else echo 'no /usr/local/bin' ; fi
# Samples
bin/raw-identify: lib/libraw_r.a samples/raw-identify.cpp
g++ ${LCMS_DEF} ${CFLAGS} -o bin/raw-identify samples/raw-identify.cpp ${CLIBS}
bin/unprocessed_raw: lib/libraw_r.a samples/unprocessed_raw.cpp
g++ ${LCMS_DEF} ${CFLAGS} -o bin/unprocessed_raw samples/unprocessed_raw.cpp ${CLIBS}
bin/4channels: lib/libraw_r.a samples/4channels.cpp
g++ ${LCMS_DEF} ${CFLAGS} -o bin/4channels samples/4channels.cpp ${CLIBS}
bin/simple_dcraw: lib/libraw_r.a samples/simple_dcraw.cpp
g++ ${LCMS_DEF} ${CFLAGS} -o bin/simple_dcraw samples/simple_dcraw.cpp ${CLIBS}
bin/mem_image: lib/libraw_r.a samples/mem_image.cpp
g++ ${LCMS_DEF} ${CFLAGS} -o bin/mem_image samples/mem_image.cpp ${CLIBS}
bin/dcraw_half: lib/libraw_r.a object/dcraw_half.o
gcc ${LCMS_DEF} ${CFLAGS} -o bin/dcraw_half object/dcraw_half.o ${CLIBS} -lstdc++
bin/dcraw_emu: lib/libraw_r.a samples/dcraw_emu.cpp
g++ ${LCMS_DEF} ${CFLAGS} -o bin/dcraw_emu samples/dcraw_emu.cpp ${CLIBS}
#Libraries
# Non-threaded library
object/dcraw_common.o: internal/dcraw_common.cpp
g++ -c ${LCMS_DEF} ${CFLAGS} -o object/dcraw_common.o internal/dcraw_common.cpp
object/dcraw_fileio.o: internal/dcraw_fileio.cpp
g++ -c ${LCMS_DEF} ${CFLAGS} -o object/dcraw_fileio.o internal/dcraw_fileio.cpp
object/libraw_cxx.o: src/libraw_cxx.cpp
g++ -c ${LCMS_DEF} ${CFLAGS} -o object/libraw_cxx.o src/libraw_cxx.cpp
object/libraw_c_api.o: src/libraw_c_api.cpp
g++ -c ${LCMS_DEF} ${CFLAGS} -o object/libraw_c_api.o src/libraw_c_api.cpp
object/dcraw_half.o: samples/dcraw_half.c
gcc -c ${LCMS_DEF} ${CFLAGS} -o object/dcraw_half.o samples/dcraw_half.c
lib/libraw_r.a: ${DCRAW_LIB_OBJECTS}
-rm -f lib\\libraw_r.a
ar crv lib/libraw_r.a ${DCRAW_LIB_OBJECTS}
ranlib lib/libraw_r.a
# Clean
clean:
rm -f bin\\*.dSYM
rm -f lib\\lib*.a bin\\*.exe object\\*.o
----
Davide Anastasia
Developer of Luminance HDR
Thanks, I'll modify
Thanks,
I'll modify distributed Makefile.mingw with possibility to build thread-safe
-- Alex Tutubalin @LibRaw LLC
libRaw for LUMINANCE
Linking CXX executable luminance-hdr.exe
c:/progra~2/codebl~1/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../mingw32/bin/ld.exe: warning: auto-importing has been activated without --enable-auto-import specified on the command line.
Hi, Im trying to build Luminance HDR using CodeBlocks. I've obtained libraw using this makefile but I'm getting some errors related to references in libraw.
Any idea how to solve it or the origin of this problem?
Thanks in advance!
Raissel
This should work unless it involves constant data structures referencing symbols from auto-imported DLLs.
../DEPs/lib/libraw/libraw_r.a(libraw_cxx.o):libraw_cxx.cpp:(.text+0x2299): undefined reference to `_Unwind_Resume'
../DEPs/lib/libraw/libraw_r.a(libraw_cxx.o):libraw_cxx.cpp:(.text+0x231b): undefined reference to `_Unwind_Resume'
../DEPs/lib/libraw/libraw_r.a(libraw_cxx.o):libraw_cxx.cpp:(.text+0x23e8): undefined reference to `_Unwind_Resume'
../DEPs/lib/libraw/libraw_r.a(libraw_cxx.o):libraw_cxx.cpp:(.text+0x243b): undefined reference to `_Unwind_Resume'
../DEPs/lib/libraw/libraw_r.a(libraw_cxx.o):libraw_cxx.cpp:(.text+0x2625): undefined reference to `_Unwind_Resume'
../DEPs/lib/libraw/libraw_r.a(libraw_cxx.o):libraw_cxx.cpp:(.text+0x2aab): more undefined references to `_Unwind_Resume' follow
../DEPs/lib/libraw/libraw_r.a(libraw_cxx.o):libraw_cxx.cpp:(.eh_frame$_ZN22LibRaw_file_datastreamD1Ev+0x13): undefined reference to `__gxx_personality_v0'
../DEPs/lib/libraw/libraw_r.a(libraw_cxx.o):libraw_cxx.cpp:(.eh_frame+0x427): undefined reference to `__gxx_personality_v0'
../DEPs/lib/libraw/libraw_r.a(libraw_cxx.o):libraw_cxx.cpp:(.eh_frame$_ZN22LibRaw_file_datastream4getsEPci+0x13): undefined reference to `__gxx_personality_v0'
../DEPs/lib/libraw/libraw_r.a(libraw_cxx.o):libraw_cxx.cpp:(.eh_frame$_ZN22LibRaw_file_datastream9scanf_oneEPKcPv+0x13): undefined reference to `__gxx_personality_v0'
../DEPs/lib/libraw/libraw_r.a(libraw_cxx.o):libraw_cxx.cpp:(.eh_frame$_ZN22LibRaw_file_datastreamD0Ev+0x13): undefined reference to `__gxx_personality_v0'
../DEPs/lib/libraw/libraw_r.a(libraw_cxx.o):libraw_cxx.cpp:(.eh_frame$_ZN22LibRaw_file_datastream16tempbuffer_closeEv+0x13): more undefined references to `__gxx_personality_v0' follow
../DEPs/lib/libraw/libraw_r.a(dcraw_common.o):dcraw_common.cpp:(.text+0x7722): undefined reference to `__chkstk_ms'
../DEPs/lib/libraw/libraw_r.a(dcraw_common.o):dcraw_common.cpp:(.text+0x79aa): undefined reference to `__chkstk_ms'
../DEPs/lib/libraw/libraw_r.a(dcraw_common.o):dcraw_common.cpp:(.text+0x98fa): undefined reference to `__chkstk_ms'
../DEPs/lib/libraw/libraw_r.a(dcraw_common.o):dcraw_common.cpp:(.text+0xa02e): undefined reference to `__chkstk_ms'
../DEPs/lib/libraw/libraw_r.a(dcraw_common.o):dcraw_common.cpp:(.text+0xa636): undefined reference to `__chkstk_ms'
../DEPs/lib/libraw/libraw_r.a(dcraw_common.o):dcraw_common.cpp:(.text+0xbe07): more undefined references to `__chkstk_ms' follow
collect2: ld returned 1 exit status
mingw32-make.exe[2]: *** [luminance-hdr.exe] Error 1
mingw32-make.exe[1]: *** [CMakeFiles/luminance-hdr.dir/all] Error 2
mingw32-make.exe: *** [all] Error 2
Info: resolving half::_eLut by linking to __imp___ZN4half5_eLutE (auto-import)
Unwind_resume is part of
Unwind_resume is part of gcc's exception handler (according to goole :).
You need to enable exceptions library (e.g. via linking by g++, not gcc) on link stage.
-- Alex Tutubalin @LibRaw LLC