Václav Zeman
2013-04-02 10:25:19 UTC
Hi.
I have tried to compile the log4cplus library on Cygwin64. Compilation
goes fine but linking ends with error.
The file src/.libs/liblog4cplus_la-cygwin-win32.o is the only one that
references Win32 API and includes windows.h. The library is trying to
get Windows' thread ID using the GetCurrentThreadId() function.
Here is libtool invocation:
libtool: link: g++ -shared -nostdlib
/usr/lib/gcc/x86_64-pc-cygwin/4.8.0/crtbegin.o
src/.libs/liblog4cplus_la-appenderattachableimpl.o
src/.libs/liblog4cplus_la-appender.o
src/.libs/liblog4cplus_la-asyncappender.o
src/.libs/liblog4cplus_la-clogger.o
src/.libs/liblog4cplus_la-configurator.o
src/.libs/liblog4cplus_la-consoleappender.o
src/.libs/liblog4cplus_la-cygwin-win32.o
src/.libs/liblog4cplus_la-env.o src/.libs/liblog4cplus_la-factory.o
src/.libs/liblog4cplus_la-fileappender.o
src/.libs/liblog4cplus_la-fileinfo.o
src/.libs/liblog4cplus_la-filter.o
src/.libs/liblog4cplus_la-global-init.o
src/.libs/liblog4cplus_la-hierarchy.o
src/.libs/liblog4cplus_la-hierarchylocker.o
src/.libs/liblog4cplus_la-layout.o
src/.libs/liblog4cplus_la-log4judpappender.o
src/.libs/liblog4cplus_la-lockfile.o
src/.libs/liblog4cplus_la-logger.o
src/.libs/liblog4cplus_la-loggerimpl.o
src/.libs/liblog4cplus_la-loggingevent.o
src/.libs/liblog4cplus_la-loggingmacros.o
src/.libs/liblog4cplus_la-loglevel.o
src/.libs/liblog4cplus_la-loglog.o
src/.libs/liblog4cplus_la-logloguser.o src/.libs/liblog4cplus_la-mdc.o
src/.libs/liblog4cplus_la-ndc.o
src/.libs/liblog4cplus_la-nullappender.o
src/.libs/liblog4cplus_la-nteventlogappender.o
src/.libs/liblog4cplus_la-objectregistry.o
src/.libs/liblog4cplus_la-patternlayout.o
src/.libs/liblog4cplus_la-pointer.o
src/.libs/liblog4cplus_la-property.o src/.libs/liblog4cplus_la-queue.o
src/.libs/liblog4cplus_la-rootlogger.o
src/.libs/liblog4cplus_la-sleep.o src/.libs/liblog4cplus_la-snprintf.o
src/.libs/liblog4cplus_la-socketappender.o
src/.libs/liblog4cplus_la-socketbuffer.o
src/.libs/liblog4cplus_la-socket.o
src/.libs/liblog4cplus_la-socket-unix.o
src/.libs/liblog4cplus_la-socket-win32.o
src/.libs/liblog4cplus_la-stringhelper.o
src/.libs/liblog4cplus_la-stringhelper-clocale.o
src/.libs/liblog4cplus_la-stringhelper-cxxlocale.o
src/.libs/liblog4cplus_la-stringhelper-iconv.o
src/.libs/liblog4cplus_la-syncprims.o
src/.libs/liblog4cplus_la-syslogappender.o
src/.libs/liblog4cplus_la-threads.o
src/.libs/liblog4cplus_la-timehelper.o src/.libs/liblog4cplus_la-tls.o
src/.libs/liblog4cplus_la-version.o
src/.libs/liblog4cplus_la-win32consoleappender.o
src/.libs/liblog4cplus_la-win32debugappender.o -lws2_32 -ladvapi32
-lkernel32 -L/usr/lib/gcc/x86_64-pc-cygwin/4.8.0
-L/usr/lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../x86_64-pc-cygwin/lib/../lib
-L/usr/lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../lib -L/lib/../lib
-L/usr/lib/../lib
-L/usr/lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../x86_64-pc-cygwin/lib
-L/usr/lib/gcc/x86_64-pc-cygwin/4.8.0/../../.. -lstdc++
-lssp_nonshared -lssp -lgcc_s -lgcc -lcygwin -ladvapi32 -lshell32
-luser32 -lkernel32 -lgcc_s -lgcc
/usr/lib/gcc/x86_64-pc-cygwin/4.8.0/crtend.o -O2
-Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -o
.libs/cyglog4cplus-1-2-0.dll -Wl,--enable-auto-image-base -Xlinker
--out-implib -Xlinker .libs/liblog4cplus.dll.a
And here is the error message:
src/.libs/liblog4cplus_la-cygwin-win32.o: In function `VarCmp':
/usr/include/w32api/oleauto.h:487: undefined reference to `VarCmp'
/usr/include/w32api/oleauto.h:487:(.text+0x34f): relocation truncated
to fit: R_X86_64_PC32 against undefined symbol `VarCmp'
src/.libs/liblog4cplus_la-cygwin-win32.o: In function `_InterlockedAdd':
/usr/include/w32api/winnt.h:1452: undefined reference to
`_InterlockedExchangeAdd'
/usr/include/w32api/winnt.h:1452:(.text$_InterlockedAdd[_InterlockedAdd]+0x2c):
relocation truncated to fit: R_X86_64_PC32 against undefined symbol
`_InterlockedExchangeAdd'
src/.libs/liblog4cplus_la-cygwin-win32.o: In function `_InterlockedAdd64':
/usr/include/w32api/winnt.h:1490: undefined reference to
`_InterlockedExchangeAdd64'
/usr/include/w32api/winnt.h:1490:(.text$_InterlockedAdd64[_InterlockedAdd64]+0x2d):
relocation truncated to fit: R_X86_64_PC32 against undefined symbol
`_InterlockedExchangeAdd64'
src/.libs/liblog4cplus_la-cygwin-win32.o: In function `MultiplyExtract128':
/usr/include/w32api/winnt.h:1641: undefined reference to `_mul128'
/usr/include/w32api/winnt.h:1641:(.text$MultiplyExtract128[MultiplyExtract128]+0x32):
relocation truncated to fit: R_X86_64_PC32 against undefined symbol
`_mul128'
/usr/include/w32api/winnt.h:1642: undefined reference to `__shiftright128'
/usr/include/w32api/winnt.h:1642:(.text$MultiplyExtract128[MultiplyExtract128]+0x43):
relocation truncated to fit: R_X86_64_PC32 against undefined symbol
`__shiftright128'
src/.libs/liblog4cplus_la-cygwin-win32.o: In function
`UnsignedMultiplyExtract128':
/usr/include/w32api/winnt.h:1650: undefined reference to `_umul128'
/usr/include/w32api/winnt.h:1650:(.text$UnsignedMultiplyExtract128[UnsignedMultiplyExtract128]+0x32):
relocation truncated to fit: R_X86_64_PC32 against undefined symbol
`_umul128'
/usr/include/w32api/winnt.h:1651: undefined reference to `__shiftright128'
/usr/include/w32api/winnt.h:1651:(.text$UnsignedMultiplyExtract128[UnsignedMultiplyExtract128]+0x43):
relocation truncated to fit: R_X86_64_PC32 against undefined symbol
`__shiftright128'
collect2: error: ld returned 1 exit status
Makefile:1110: recipe for target `liblog4cplus.la' failed
make[2]: *** [liblog4cplus.la] Error 1
make[2]: Leaving directory
`/cygdrive/c/stuff/log4cplus-bzr-repo/work-trunk/objdir-cygwin64'
Makefile:1960: recipe for target `all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
`/cygdrive/c/stuff/log4cplus-bzr-repo/work-trunk/objdir-cygwin64'
Makefile:849: recipe for target `all' failed
make: *** [all] Error 2
I have tried to compile the log4cplus library on Cygwin64. Compilation
goes fine but linking ends with error.
The file src/.libs/liblog4cplus_la-cygwin-win32.o is the only one that
references Win32 API and includes windows.h. The library is trying to
get Windows' thread ID using the GetCurrentThreadId() function.
Here is libtool invocation:
libtool: link: g++ -shared -nostdlib
/usr/lib/gcc/x86_64-pc-cygwin/4.8.0/crtbegin.o
src/.libs/liblog4cplus_la-appenderattachableimpl.o
src/.libs/liblog4cplus_la-appender.o
src/.libs/liblog4cplus_la-asyncappender.o
src/.libs/liblog4cplus_la-clogger.o
src/.libs/liblog4cplus_la-configurator.o
src/.libs/liblog4cplus_la-consoleappender.o
src/.libs/liblog4cplus_la-cygwin-win32.o
src/.libs/liblog4cplus_la-env.o src/.libs/liblog4cplus_la-factory.o
src/.libs/liblog4cplus_la-fileappender.o
src/.libs/liblog4cplus_la-fileinfo.o
src/.libs/liblog4cplus_la-filter.o
src/.libs/liblog4cplus_la-global-init.o
src/.libs/liblog4cplus_la-hierarchy.o
src/.libs/liblog4cplus_la-hierarchylocker.o
src/.libs/liblog4cplus_la-layout.o
src/.libs/liblog4cplus_la-log4judpappender.o
src/.libs/liblog4cplus_la-lockfile.o
src/.libs/liblog4cplus_la-logger.o
src/.libs/liblog4cplus_la-loggerimpl.o
src/.libs/liblog4cplus_la-loggingevent.o
src/.libs/liblog4cplus_la-loggingmacros.o
src/.libs/liblog4cplus_la-loglevel.o
src/.libs/liblog4cplus_la-loglog.o
src/.libs/liblog4cplus_la-logloguser.o src/.libs/liblog4cplus_la-mdc.o
src/.libs/liblog4cplus_la-ndc.o
src/.libs/liblog4cplus_la-nullappender.o
src/.libs/liblog4cplus_la-nteventlogappender.o
src/.libs/liblog4cplus_la-objectregistry.o
src/.libs/liblog4cplus_la-patternlayout.o
src/.libs/liblog4cplus_la-pointer.o
src/.libs/liblog4cplus_la-property.o src/.libs/liblog4cplus_la-queue.o
src/.libs/liblog4cplus_la-rootlogger.o
src/.libs/liblog4cplus_la-sleep.o src/.libs/liblog4cplus_la-snprintf.o
src/.libs/liblog4cplus_la-socketappender.o
src/.libs/liblog4cplus_la-socketbuffer.o
src/.libs/liblog4cplus_la-socket.o
src/.libs/liblog4cplus_la-socket-unix.o
src/.libs/liblog4cplus_la-socket-win32.o
src/.libs/liblog4cplus_la-stringhelper.o
src/.libs/liblog4cplus_la-stringhelper-clocale.o
src/.libs/liblog4cplus_la-stringhelper-cxxlocale.o
src/.libs/liblog4cplus_la-stringhelper-iconv.o
src/.libs/liblog4cplus_la-syncprims.o
src/.libs/liblog4cplus_la-syslogappender.o
src/.libs/liblog4cplus_la-threads.o
src/.libs/liblog4cplus_la-timehelper.o src/.libs/liblog4cplus_la-tls.o
src/.libs/liblog4cplus_la-version.o
src/.libs/liblog4cplus_la-win32consoleappender.o
src/.libs/liblog4cplus_la-win32debugappender.o -lws2_32 -ladvapi32
-lkernel32 -L/usr/lib/gcc/x86_64-pc-cygwin/4.8.0
-L/usr/lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../x86_64-pc-cygwin/lib/../lib
-L/usr/lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../lib -L/lib/../lib
-L/usr/lib/../lib
-L/usr/lib/gcc/x86_64-pc-cygwin/4.8.0/../../../../x86_64-pc-cygwin/lib
-L/usr/lib/gcc/x86_64-pc-cygwin/4.8.0/../../.. -lstdc++
-lssp_nonshared -lssp -lgcc_s -lgcc -lcygwin -ladvapi32 -lshell32
-luser32 -lkernel32 -lgcc_s -lgcc
/usr/lib/gcc/x86_64-pc-cygwin/4.8.0/crtend.o -O2
-Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc -o
.libs/cyglog4cplus-1-2-0.dll -Wl,--enable-auto-image-base -Xlinker
--out-implib -Xlinker .libs/liblog4cplus.dll.a
And here is the error message:
src/.libs/liblog4cplus_la-cygwin-win32.o: In function `VarCmp':
/usr/include/w32api/oleauto.h:487: undefined reference to `VarCmp'
/usr/include/w32api/oleauto.h:487:(.text+0x34f): relocation truncated
to fit: R_X86_64_PC32 against undefined symbol `VarCmp'
src/.libs/liblog4cplus_la-cygwin-win32.o: In function `_InterlockedAdd':
/usr/include/w32api/winnt.h:1452: undefined reference to
`_InterlockedExchangeAdd'
/usr/include/w32api/winnt.h:1452:(.text$_InterlockedAdd[_InterlockedAdd]+0x2c):
relocation truncated to fit: R_X86_64_PC32 against undefined symbol
`_InterlockedExchangeAdd'
src/.libs/liblog4cplus_la-cygwin-win32.o: In function `_InterlockedAdd64':
/usr/include/w32api/winnt.h:1490: undefined reference to
`_InterlockedExchangeAdd64'
/usr/include/w32api/winnt.h:1490:(.text$_InterlockedAdd64[_InterlockedAdd64]+0x2d):
relocation truncated to fit: R_X86_64_PC32 against undefined symbol
`_InterlockedExchangeAdd64'
src/.libs/liblog4cplus_la-cygwin-win32.o: In function `MultiplyExtract128':
/usr/include/w32api/winnt.h:1641: undefined reference to `_mul128'
/usr/include/w32api/winnt.h:1641:(.text$MultiplyExtract128[MultiplyExtract128]+0x32):
relocation truncated to fit: R_X86_64_PC32 against undefined symbol
`_mul128'
/usr/include/w32api/winnt.h:1642: undefined reference to `__shiftright128'
/usr/include/w32api/winnt.h:1642:(.text$MultiplyExtract128[MultiplyExtract128]+0x43):
relocation truncated to fit: R_X86_64_PC32 against undefined symbol
`__shiftright128'
src/.libs/liblog4cplus_la-cygwin-win32.o: In function
`UnsignedMultiplyExtract128':
/usr/include/w32api/winnt.h:1650: undefined reference to `_umul128'
/usr/include/w32api/winnt.h:1650:(.text$UnsignedMultiplyExtract128[UnsignedMultiplyExtract128]+0x32):
relocation truncated to fit: R_X86_64_PC32 against undefined symbol
`_umul128'
/usr/include/w32api/winnt.h:1651: undefined reference to `__shiftright128'
/usr/include/w32api/winnt.h:1651:(.text$UnsignedMultiplyExtract128[UnsignedMultiplyExtract128]+0x43):
relocation truncated to fit: R_X86_64_PC32 against undefined symbol
`__shiftright128'
collect2: error: ld returned 1 exit status
Makefile:1110: recipe for target `liblog4cplus.la' failed
make[2]: *** [liblog4cplus.la] Error 1
make[2]: Leaving directory
`/cygdrive/c/stuff/log4cplus-bzr-repo/work-trunk/objdir-cygwin64'
Makefile:1960: recipe for target `all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
`/cygdrive/c/stuff/log4cplus-bzr-repo/work-trunk/objdir-cygwin64'
Makefile:849: recipe for target `all' failed
make: *** [all] Error 2
--
VZ
VZ