I'm trying to cross-compile cachecoin binaries on a linux host using gitian and i686-w64-mingw for a windows target.
The compilation works fine until the final step of static linking of the dependencies. This is what I get:
/home/ubuntu/staging32/lib/libcrypto.a(e_capi.o):e_capi.c:(.text+0x1ff): undefined reference to `__imp__CertFreeCertificateContext#4'
Google suggests it's a missing -lcrypto link or even -lcrypt32. But in the last line before it fails you can see it's linking both. What's the issue here?
My gitian descriptor is available here. And this is the qmake project file. Full tail of the build log:
[...]
i686-w64-mingw32-g++ -c -frandom-seed=cachecoin -D_FORTIFY_SOURCE=2 -msse2 -O2 -frtti -fexceptions -fdiagnostics-show-option -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -Wstack-protector -DBOOST_THREAD_USE_LIB -DQT_GUI -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE -DBOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN -D__NO_SYSTEM_INCLUDES -DSCRYPT_CHACHA -DSCRYPT_KECCAK512 -DUSE_QRCODE -DUSE_UPNP=1 -DSTATICLIB -DUSE_IPV6=1 -DCACHECOIN_NEED_QT_PLUGINS -DHAVE_BUILD_INFO -DWIN32 -D_MT -DQT_THREAD_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I'../../staging32/include/QtCore' -I'../../staging32/include/QtNetwork' -I'../../staging32/include/QtGui' -I'../../staging32/include' -I'../../staging32' -I'src' -I'src/json' -I'src/qt' -I'../../staging32' -I'../../staging32' -I'../../staging32' -I'../../staging32' -I'../../staging32' -I'../../staging32/include/ActiveQt' -I'build' -I'build' -I'../../staging32/mkspecs/unsupported/win32-g++-cross' -o build/moc_qrcodedialog.o build/moc_qrcodedialog.cpp
i686-w64-mingw32-g++ -c -frandom-seed=cachecoin -D_FORTIFY_SOURCE=2 -msse2 -O2 -frtti -fexceptions -fdiagnostics-show-option -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -Wstack-protector -DBOOST_THREAD_USE_LIB -DQT_GUI -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE -DBOOST_THREAD_PROVIDES_GENERIC_SHARED_MUTEX_ON_WIN -D__NO_SYSTEM_INCLUDES -DSCRYPT_CHACHA -DSCRYPT_KECCAK512 -DUSE_QRCODE -DUSE_UPNP=1 -DSTATICLIB -DUSE_IPV6=1 -DCACHECOIN_NEED_QT_PLUGINS -DHAVE_BUILD_INFO -DWIN32 -D_MT -DQT_THREAD_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I'../../staging32/include/QtCore' -I'../../staging32/include/QtNetwork' -I'../../staging32/include/QtGui' -I'../../staging32/include' -I'../../staging32' -I'src' -I'src/json' -I'src/qt' -I'../../staging32' -I'../../staging32' -I'../../staging32' -I'../../staging32' -I'../../staging32' -I'../../staging32/include/ActiveQt' -I'build' -I'build' -I'../../staging32/mkspecs/unsupported/win32-g++-cross' -o build/qrc_cachecoin.o release/qrc_cachecoin.cpp
i686-w64-mingw32-g++ -Wl,--dynamicbase -Wl,--nxcompat -Wl,--large-address-aware -static-libgcc -static-libstdc++ -Wl,-s -lmingwthrd -Wl,-subsystem,windows -o release/cachecoin-qt.exe object_script.cachecoin-qt.Release -L'/home/ubuntu/staging32/lib' -lmingwthrd -lmingw32 -lqtmain build/cachecoin-qt_res.o -lqrencode -L/home/ubuntu/staging32 -lminiupnpc -liphlpapi -L/home/ubuntu/staging32 -L/home/ubuntu/staging32 -L/home/ubuntu/staging32 -L/home/ubuntu/staging32 -ldb_cxx -lshlwapi -lmswsock -lcrypt32 -lboost_system-mt-s -lboost_filesystem-mt-s -lboost_program_options-mt-s -lboost_thread_win32-mt-s -lboost_chrono-mt-s -L/home/ubuntu/staging32/plugins/codecs -lqcncodecs -lqjpcodecs -lqtwcodecs -lqkrcodecs -L/home/ubuntu/staging32/plugins/accessible -lqtaccessiblewidgets -lQtGui -lQtNetwork -lcomdlg32 -loleaut32 -limm32 -lwinmm -lwinspool -lmsimg32 -lQtCore -L/home/ubuntu/deps32/lib -lssl -lcrypto -lgdi32 -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32
/home/ubuntu/staging32/lib/libcrypto.a(e_capi.o):e_capi.c:(.text+0x1ff): undefined reference to `__imp__CertFreeCertificateContext#4'
/home/ubuntu/staging32/lib/libcrypto.a(e_capi.o):e_capi.c:(.text+0x27f): undefined reference to `__imp__CertFreeCertificateContext#4'
/home/ubuntu/staging32/lib/libcrypto.a(e_capi.o):e_capi.c:(.text+0xbf8): undefined reference to `__imp__CertGetCertificateContextProperty#16'
/home/ubuntu/staging32/lib/libcrypto.a(e_capi.o):e_capi.c:(.text+0x20f6): undefined reference to `__imp__CertOpenStore#20'
/home/ubuntu/staging32/lib/libcrypto.a(e_capi.o):e_capi.c:(.text+0x212d): undefined reference to `__imp__CertEnumCertificatesInStore#8'
/home/ubuntu/staging32/lib/libcrypto.a(e_capi.o):e_capi.c:(.text+0x2208): undefined reference to `__imp__CertDuplicateCertificateContext#4'
/home/ubuntu/staging32/lib/libcrypto.a(e_capi.o):e_capi.c:(.text+0x2291): undefined reference to `__imp__CertCloseStore#8'
/home/ubuntu/staging32/lib/libcrypto.a(e_capi.o):e_capi.c:(.text+0x23c6): undefined reference to `__imp__CertFreeCertificateContext#4'
/home/ubuntu/staging32/lib/libcrypto.a(e_capi.o):e_capi.c:(.text+0x2648): undefined reference to `__imp__CertGetCertificateContextProperty#16'
/home/ubuntu/staging32/lib/libcrypto.a(e_capi.o):e_capi.c:(.text+0x27cc): undefined reference to `__imp__CertGetCertificateContextProperty#16'
/home/ubuntu/staging32/lib/libcrypto.a(e_capi.o):e_capi.c:(.text+0x2bc9): undefined reference to `__imp__CertOpenStore#20'
/home/ubuntu/staging32/lib/libcrypto.a(e_capi.o):e_capi.c:(.text+0x2ce2): undefined reference to `__imp__CertOpenStore#20'
/home/ubuntu/staging32/lib/libcrypto.a(e_capi.o):e_capi.c:(.text+0x2d4d): undefined reference to `__imp__CertFindCertificateInStore#24'
/home/ubuntu/staging32/lib/libcrypto.a(e_capi.o):e_capi.c:(.text+0x2d7d): undefined reference to `__imp__CertFreeCertificateContext#4'
/home/ubuntu/staging32/lib/libcrypto.a(e_capi.o):e_capi.c:(.text+0x2d94): undefined reference to `__imp__CertCloseStore#8'
/home/ubuntu/staging32/lib/libcrypto.a(e_capi.o):e_capi.c:(.text+0x2db3): undefined reference to `__imp__CertEnumCertificatesInStore#8'
/home/ubuntu/staging32/lib/libcrypto.a(e_capi.o):e_capi.c:(.text+0x2e25): undefined reference to `__imp__CertEnumCertificatesInStore#8'
/home/ubuntu/staging32/lib/libcrypto.a(e_capi.o):e_capi.c:(.text+0x3777): undefined reference to `__imp__CertOpenStore#20'
/home/ubuntu/staging32/lib/libcrypto.a(e_capi.o):e_capi.c:(.text+0x37a8): undefined reference to `__imp__CertCloseStore#8'
/home/ubuntu/staging32/lib/libcrypto.a(e_capi.o):e_capi.c:(.text+0x3829): undefined reference to `__imp__CertEnumCertificatesInStore#8'
/home/ubuntu/staging32/lib/libcrypto.a(e_capi.o):e_capi.c:(.text+0x388d): undefined reference to `__imp__CertFreeCertificateContext#4'
/home/ubuntu/staging32/lib/libcrypto.a(e_capi.o):e_capi.c:(.text+0x38c9): undefined reference to `__imp__CertFindCertificateInStore#24'
/home/ubuntu/staging32/lib/libcrypto.a(e_capi.o):e_capi.c:(.text+0x39ef): undefined reference to `__imp__CertFreeCertificateContext#4'
/home/ubuntu/staging32/lib/libcrypto.a(e_capi.o):e_capi.c:(.text+0x3a9b): undefined reference to `__imp__CertFreeCertificateContext#4'
collect2: ld returned 1 exit status
make[1]: *** [release/cachecoin-qt.exe] Error 1
make[1]: Leaving directory `/home/ubuntu/build32/distsrc'
make: *** [release] Error 2
Any ideas?
(I'd rather post ask in the comments first, but I don't have enough reputation yet.)
Judging purely from your post (I haven't tried compiling the program myself), it could be one of these three issues:
wrong order of libraries in the command line (try appending one more -lcrypt32 to it)
the import libraries provided by your mingw-w64 packages are incomplete (you can use nm libcrypt32.a | grep ' T ' to check)
the functions are imported incorrectly (dllimport vs. dllexport vs. undecorated, calling conventions, ...)
After examining the error log once more, I'm inclined to believe it's the first option, as libcrypto seems to be importing functions from libcrypt32, but -lcrypto is almost at the end of the command line and it's not followed by any -lcrypt32.
Related
When attempting to build the wxWidgets 3.1.0 library with the following command line:
mingw32-make -f makefile.gcc BUILD=release SHARED=1 CFLAGS="-O2 -flto"
CXXFLAGS="-O2 -flto" LDFLAGS="-O2 -flto"
I'm getting this warning (31 occurrences)
lto1.exe: warning: -fPIC ignored for target (all code is position independent)
Followed by:
C:\Users\Marc\AppData\Local\Temp\ccEDEhIg.ltrans6.ltrans.o:<artificial>:(.text+0x13c4): undefined reference to `wx_regfree'
C:\Users\Marc\AppData\Local\Temp\ccEDEhIg.ltrans6.ltrans.o:<artificial>:(.text+0x1418): undefined reference to `wx_regfree'
C:\Users\Marc\AppData\Local\Temp\ccEDEhIg.ltrans6.ltrans.o:<artificial>:(.text+0x3792): undefined reference to `wx_regerror'
C:\Users\Marc\AppData\Local\Temp\ccEDEhIg.ltrans6.ltrans.o:<artificial>:(.text+0x37c1): undefined reference to `wx_regerror'
C:\Users\Marc\AppData\Local\Temp\ccEDEhIg.ltrans6.ltrans.o:<artificial>:(.text+0x3a7d): undefined reference to `wx_re_exec'
C:\Users\Marc\AppData\Local\Temp\ccEDEhIg.ltrans6.ltrans.o:<artificial>:(.text+0x47de): undefined reference to `wx_re_comp'
C:\Users\Marc\AppData\Local\Temp\ccEDEhIg.ltrans6.ltrans.o:<artificial>:(.text+0x4cf4): undefined reference to `wx_regfree'
C:\Users\Marc\AppData\Local\Temp\ccEDEhIg.ltrans6.ltrans.o:<artificial>:(.text+0x4f94): undefined reference to `wx_regfree'
C:\Users\Marc\AppData\Local\Temp\ccEDEhIg.ltrans12.ltrans.o:<artificial>:(.text+0x57c): undefined reference to `deflateEnd'
C:\Users\Marc\AppData\Local\Temp\ccEDEhIg.ltrans12.ltrans.o:<artificial>:(.text+0x88d): undefined reference to `deflateSetDictionary'
C:\Users\Marc\AppData\Local\Temp\ccEDEhIg.ltrans12.ltrans.o:<artificial>:(.text+0x8ba): undefined reference to `deflateSetDictionary'
C:\Users\Marc\AppData\Local\Temp\ccEDEhIg.ltrans12.ltrans.o:<artificial>:(.text+0x947): undefined reference to `deflate'
C:\Users\Marc\AppData\Local\Temp\ccEDEhIg.ltrans12.ltrans.o:<artificial>:(.text+0x4830): undefined reference to `deflate'
C:\Users\Marc\AppData\Local\Temp\ccEDEhIg.ltrans12.ltrans.o:<artificial>:(.text+0x59f4): undefined reference to `deflateInit2_'
C:\Users\Marc\AppData\Local\Temp\ccEDEhIg.ltrans14.ltrans.o:<artificial>:(.text+0x3354): undefined reference to `deflateReset'
C:\Users\Marc\AppData\Local\Temp\ccEDEhIg.ltrans14.ltrans.o:<artificial>:(.text+0x38db): undefined reference to `inflateReset'
C:\Users\Marc\AppData\Local\Temp\ccEDEhIg.ltrans16.ltrans.o:<artificial>:(.text+0x21d): undefined reference to `inflateSetDictionary'
C:\Users\Marc\AppData\Local\Temp\ccEDEhIg.ltrans16.ltrans.o:<artificial>:(.text+0x24a): undefined reference to `inflateSetDictionary'
C:\Users\Marc\AppData\Local\Temp\ccEDEhIg.ltrans16.ltrans.o:<artificial>:(.text+0x266): undefined reference to `zlibVersion'
C:\Users\Marc\AppData\Local\Temp\ccEDEhIg.ltrans16.ltrans.o:<artificial>:(.text+0x27d): undefined reference to `zlibVersion'
C:\Users\Marc\AppData\Local\Temp\ccEDEhIg.ltrans16.ltrans.o:<artificial>:(.text+0x2d0): undefined reference to `zlibVersion'
C:\Users\Marc\AppData\Local\Temp\ccEDEhIg.ltrans16.ltrans.o:<artificial>:(.text+0x121c): undefined reference to `inflate'
C:\Users\Marc\AppData\Local\Temp\ccEDEhIg.ltrans16.ltrans.o:<artificial>:(.text+0x1924): undefined reference to `inflateEnd'
C:\Users\Marc\AppData\Local\Temp\ccEDEhIg.ltrans16.ltrans.o:<artificial>:(.text+0x20b7): undefined reference to `inflateInit2_'
C:\Users\Marc\AppData\Local\Temp\ccEDEhIg.ltrans16.ltrans.o:<artificial>:(.text+0x3694): undefined reference to `crc32'
C:\Users\Marc\AppData\Local\Temp\ccEDEhIg.ltrans16.ltrans.o:<artificial>:(.text+0x5534): undefined reference to `crc32'
C:\Users\Marc\AppData\Local\Temp\ccEDEhIg.ltrans16.ltrans.o:<artificial>:(.text+0x5813): undefined reference to `crc32'
C:\Users\Marc\AppData\Local\Temp\ccEDEhIg.ltrans16.ltrans.o:<artificial>:(.text+0x773e): undefined reference to `crc32'
C:\Users\Marc\AppData\Local\Temp\ccEDEhIg.ltrans16.ltrans.o:<artificial>:(.text+0x7c5b): undefined reference to `crc32'
collect2.exe: error: ld returned 1 exit status
makefile.gcc:5299: recipe for target '..\..\lib\gcc_dll\wxbase310u_gcc_custom.dll' failed
mingw32-make: *** [..\..\lib\gcc_dll\wxbase310u_gcc_custom.dll] Error 1
Last lines emmited by the compiler and linker, which results in all these errors, are as follows:
g++ -c -o gcc_mswudll\basedll_main.o -O2 -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -I..\..\lib\gcc_dll\mswu -I..\..\include -W -Wall -DWXBUILDING -I..\..\src\tiff\libtiff -I..\..\src\jpeg -I..\..\src\png -I..\..\src\zlib -I..\..\src\regex -I..\..\src\expat\lib -DwxUSE_GUI=0 -DWXMAKINGDLL_BASE -DwxUSE_BASE=1 -Wno-ctor-dtor-privacy -O2 -flto -MTgcc_mswudll\basedll_main.o -MFgcc_mswudll\basedll_main.o.d -MD -MP ../../src/msw/main.cpp
g++ -c -o gcc_mswudll\basedll_volume.o -O2 -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -I..\..\lib\gcc_dll\mswu -I..\..\include -W -Wall -DWXBUILDING -I..\..\src\tiff\libtiff -I..\..\src\jpeg -I..\..\src\png -I..\..\src\zlib -I..\..\src\regex -I..\..\src\expat\lib -DwxUSE_GUI=0 -DWXMAKINGDLL_BASE -DwxUSE_BASE=1 -Wno-ctor-dtor-privacy -O2 -flto -MTgcc_mswudll\basedll_volume.o -MFgcc_mswudll\basedll_volume.o.d -MD -MP ../../src/msw/volume.cpp
g++ -shared -fPIC -o ..\..\lib\gcc_dll\wxbase310u_gcc_custom.dll gcc_mswudll\basedll_dummy.o gcc_mswudll\basedll_version_rc.o gcc_mswudll\basedll_any.o gcc_mswudll\basedll_appbase.o gcc_mswudll\basedll_arcall.o gcc_mswudll\basedll_arcfind.o gcc_mswudll\basedll_archive.o gcc_mswudll\basedll_arrstr.o gcc_mswudll\basedll_base64.o gcc_mswudll\basedll_clntdata.o gcc_mswudll\basedll_cmdline.o gcc_mswudll\basedll_config.o gcc_mswudll\basedll_convauto.o gcc_mswudll\basedll_datetime.o gcc_mswudll\basedll_datetimefmt.o gcc_mswudll\basedll_datstrm.o gcc_mswudll\basedll_dircmn.o gcc_mswudll\basedll_dynarray.o gcc_mswudll\basedll_dynlib.o gcc_mswudll\basedll_dynload.o gcc_mswudll\basedll_encconv.o gcc_mswudll\basedll_evtloopcmn.o gcc_mswudll\basedll_extended.o gcc_mswudll\basedll_ffile.o gcc_mswudll\basedll_file.o gcc_mswudll\basedll_fileback.o gcc_mswudll\basedll_fileconf.o gcc_mswudll\basedll_filefn.o gcc_mswudll\basedll_filename.o gcc_mswudll\basedll_filesys.o gcc_mswudll\basedll_filtall.o gcc_mswudll\basedll_filtfind.o gcc_mswudll\basedll_fmapbase.o gcc_mswudll\basedll_fs_arc.o gcc_mswudll\basedll_fs_filter.o gcc_mswudll\basedll_hash.o gcc_mswudll\basedll_hashmap.o gcc_mswudll\basedll_init.o gcc_mswudll\basedll_intl.o gcc_mswudll\basedll_ipcbase.o gcc_mswudll\basedll_languageinfo.o gcc_mswudll\basedll_list.o gcc_mswudll\basedll_log.o gcc_mswudll\basedll_longlong.o gcc_mswudll\basedll_memory.o gcc_mswudll\basedll_mimecmn.o gcc_mswudll\basedll_module.o gcc_mswudll\basedll_mstream.o gcc_mswudll\basedll_numformatter.o gcc_mswudll\basedll_object.o gcc_mswudll\basedll_platinfo.o gcc_mswudll\basedll_powercmn.o gcc_mswudll\basedll_process.o gcc_mswudll\basedll_regex.o gcc_mswudll\basedll_stdpbase.o gcc_mswudll\basedll_sstream.o gcc_mswudll\basedll_stdstream.o gcc_mswudll\basedll_stopwatch.o gcc_mswudll\basedll_strconv.o gcc_mswudll\basedll_stream.o gcc_mswudll\basedll_string.o gcc_mswudll\basedll_stringimpl.o gcc_mswudll\basedll_stringops.o gcc_mswudll\basedll_strvararg.o gcc_mswudll\basedll_sysopt.o gcc_mswudll\basedll_tarstrm.o gcc_mswudll\basedll_textbuf.o gcc_mswudll\basedll_textfile.o gcc_mswudll\basedll_threadinfo.o gcc_mswudll\basedll_time.o gcc_mswudll\basedll_timercmn.o gcc_mswudll\basedll_timerimpl.o gcc_mswudll\basedll_tokenzr.o gcc_mswudll\basedll_translation.o gcc_mswudll\basedll_txtstrm.o gcc_mswudll\basedll_unichar.o gcc_mswudll\basedll_uri.o gcc_mswudll\basedll_ustring.o gcc_mswudll\basedll_variant.o gcc_mswudll\basedll_wfstream.o gcc_mswudll\basedll_wxcrt.o gcc_mswudll\basedll_wxprintf.o gcc_mswudll\basedll_xlocale.o gcc_mswudll\basedll_xti.o gcc_mswudll\basedll_xtistrm.o gcc_mswudll\basedll_zipstrm.o gcc_mswudll\basedll_zstream.o gcc_mswudll\basedll_fswatchercmn.o gcc_mswudll\basedll_fswatcherg.o gcc_mswudll\basedll_basemsw.o gcc_mswudll\basedll_crashrpt.o gcc_mswudll\basedll_debughlp.o gcc_mswudll\basedll_dde.o gcc_mswudll\basedll_dir.o gcc_mswudll\basedll_dlmsw.o gcc_mswudll\basedll_evtloopconsole.o gcc_mswudll\basedll_mimetype.o gcc_mswudll\basedll_power.o gcc_mswudll\basedll_regconf.o gcc_mswudll\basedll_registry.o gcc_mswudll\basedll_snglinst.o gcc_mswudll\basedll_stackwalk.o gcc_mswudll\basedll_stdpaths.o gcc_mswudll\basedll_thread.o gcc_mswudll\basedll_timer.o gcc_mswudll\basedll_utils.o gcc_mswudll\basedll_utilsexc.o gcc_mswudll\basedll_fswatcher.o gcc_mswudll\basedll_event.o gcc_mswudll\basedll_fs_mem.o gcc_mswudll\basedll_msgout.o gcc_mswudll\basedll_utilscmn.o gcc_mswudll\basedll_main.o gcc_mswudll\basedll_volume.o -mthreads -L..\..\lib\gcc_dll -Wl,--out-implib=..\..\lib\gcc_dll\libwxbase31u.a -O2 -flto -lwxzlib -lwxregexu -lwxexpat -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lversion -lwsock32 -lwininet
What I've tried so far:
Added -fPIC to CFLAGS and CXXFLAGS, to no avail.
Use -fwhopr instead of -flto, as suggested by the MinGW-w64 Wiki but it's not recognized by either gcc.exe and g++.exe. After reading this article: Linktime optimization in GCC, part 1 - brief history, I'm assuming the -fwhopr option doesn't exist anymore and is now the default mode for the -flto switch.
Build the static configuration (SHARED=0). It builds successfully, but is unusable. See Reference #1.
Omit -flto from LDFLAGS - i.e. use -flto in CFLAGS and CXXFLAGS only. Also no avail.
How to get past these errors, and build wxWidgets with GCC's Link Time Optimization?
I'm building with MinGW-w64; threading model Win32; exception handling DWARF; GCC version 5.3.0.
Reference #1: Result from the "Minimal Sample" build command line
H:\temp\wxwidgets-3.1.0\samples\minimal>mingw32-make -f makefile.gcc BUILD=release SHARED=0 CFLAGS="-O2 -flto" CXXFLAGS="-O2 -flto" LDFLAGS="-O2 -flto"
windres --use-temp-file -i../../samples/sample.rc -ogcc_mswu\minimal_sample_rc.o --define __WXMSW__ --define NDEBUG --define _UNICODE --include-dir .\..\..\lib\gcc_lib\mswu --include-dir ./../../include --include-dir . --include-dir ./../../samples --define NOPCH
g++ -c -o gcc_mswu\minimal_minimal.o -O2 -mthreads -DHAVE_W32API_H -D__WXMSW__ -DNDEBUG -D_UNICODE -I.\..\..\lib\gcc_lib\mswu -I.\..\..\include -W -Wall -I. -I.\..\..\samples -DNOPCH -Wno-ctor-dtor-privacy -O2 -flto -MTgcc_mswu\minimal_minimal.o -MFgcc_mswu\minimal_minimal.o.d -MD -MP minimal.cpp
g++ -o gcc_mswu\minimal.exe gcc_mswu\minimal_sample_rc.o gcc_mswu\minimal_minimal.o -mthreads -L.\..\..\lib\gcc_lib -Wl,--subsystem,windows -mwindows -O2 -flto -lwxmsw31u_core -lwxbase31u -lwxtiff -lwxjpeg -lwxpng -lwxzlib -lwxregexu -lwxexpat -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lshlwapi -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lversion -lwsock32 -lwininet
C:\Users\Marc\AppData\Local\Temp\ccY1ZbWs.ltrans0.ltrans.o:<artificial>:(.text+0x191): undefined reference to `wxDefaultPosition'
C:\Users\Marc\AppData\Local\Temp\ccY1ZbWs.ltrans0.ltrans.o:<artificial>:(.text+0x197): undefined reference to `wxDefaultPosition'
C:\Users\Marc\AppData\Local\Temp\ccY1ZbWs.ltrans0.ltrans.o:<artificial>:(.text+0x1a8): undefined reference to `wxDefaultSize'
(Many, many other "undefined reference" errors - probably one for every function the code ever depends on) and then...
collect2.exe: error: ld returned 1 exit status
makefile.gcc:221: recipe for target 'gcc_mswu\minimal.exe' failed
mingw32-make: *** [gcc_mswu\minimal.exe] Error 1
I've never tried using LTO with DLLs before, but there are apparently bugs with doing it, see e.g. this one. Not sure if using the workaround proposed there can help in your case.
What I think should definitely work would be compiling your application sources and wxWidgets together at once, this would be similar to building a static library but shouldn't optimize away things unused in the library -- but used in the application code.
Finally, I'm really not sure if you're going to achieve much with LTO in wxWidgets case. There is not that much "slow" code to optimize in the library...
I am cross compiling a small c++ script for Windows on Linux.
It's made with Qt and uses curl, I compiled qt and curl via mxe (make qt5 and make curl).
I then run these commands:
$MXE/usr/i686-w64-mingw32.static/qt5/bin/qmake
make
Which gives me these errors:
release/main.o:main.cpp:(.text.startup+0x4b7): undefined reference to `_imp__curl_easy_init'
release/main.o:main.cpp:(.text.startup+0x6a8): undefined reference to `_imp__curl_easy_setopt'
release/main.o:main.cpp:(.text.startup+0x781): undefined reference to `_imp__curl_easy_perform'
release/main.o:main.cpp:(.text.startup+0x874): undefined reference to `_imp__curl_easy_cleanup'
When I compile it for Linux, there are no errors.
Here is my .pro file:
QT += core
QT -= gui
QT += network
CONFIG += c++11
TARGET = add_feeds
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
LIBS += -lcurl
Any help appreciated.
If you need any other info, feel free to ask.
EDIT:
Output of make VERBOSE=1
make -f Makefile.Release
make[1]: Entering directory `/root/compile/add_feeds'
i686-w64-mingw32.static-g++ -c -pipe -fno-keep-inline-dllexport -O2 -std=gnu++0x -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I../mxe/usr/i686-w64-mingw32.static/qt5/include -I../mxe/usr/i686-w64-mingw32.static/qt5/include/QtNetwork -I../mxe/usr/i686-w64-mingw32.static/qt5/include/QtCore -Irelease -I../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/win32-g++ -o release/main.o main.cpp
i686-w64-mingw32.static-g++ -c -pipe -fno-keep-inline-dllexport -O2 -std=gnu++0x -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I../mxe/usr/i686-w64-mingw32.static/qt5/include -I../mxe/usr/i686-w64-mingw32.static/qt5/include/QtNetwork -I../mxe/usr/i686-w64-mingw32.static/qt5/include/QtCore -Irelease -I../mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/win32-g++ -o release/add_feeds_plugin_import.o add_feeds_plugin_import.cpp
i686-w64-mingw32.static-g++ -Wl,-s -Wl,-subsystem,console -mthreads -o release/add_feeds.exe release/main.o release/add_feeds_plugin_import.o -lcurl -L/root/compile/mxe/usr/i686-w64-mingw32.static/qt5/lib -L/root/compile/mxe/usr/i686-w64-mingw32.static/qt5/plugins/bearer /root/compile/mxe/usr/i686-w64-mingw32.static/qt5/plugins/bearer/libqgenericbearer.a /root/compile/mxe/usr/i686-w64-mingw32.static/qt5/plugins/bearer/libqnativewifibearer.a /root/compile/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Network.a -ldnsapi -liphlpapi -lssl -lcrypto -lgdi32 -lcrypt32 /root/compile/mxe/usr/i686-w64-mingw32.static/qt5/lib/libQt5Core.a -lole32 -luuid -lws2_32 -ladvapi32 -lshell32 -luser32 -lkernel32 -lmpr -lz -lpcre16
release/main.o:main.cpp:(.text.startup+0x4b7): undefined reference to `_imp__curl_easy_init'
release/main.o:main.cpp:(.text.startup+0x6a8): undefined reference to `_imp__curl_easy_setopt'
release/main.o:main.cpp:(.text.startup+0x781): undefined reference to `_imp__curl_easy_perform'
release/main.o:main.cpp:(.text.startup+0x874): undefined reference to `_imp__curl_easy_cleanup'
collect2: error: ld returned 1 exit status
make[1]: *** [release/add_feeds.exe] Error 1
make[1]: Leaving directory `/root/compile/add_feeds'
make: *** [release] Error 2
This problem comes from QT, when static compiling it.
Which QT Version do you have?QT Static compile bug report with Qt 5.13.0
I filed this bug report which had similar call to requqested functions.
I'm trying to statically link libcurl in codeblocks on Windows.
I compiled libcurl with "mingw32-make mingw32", and have linked the resulting libraries libcurl.a and libcurldll.a. I saw another post on ere that suggested the solution was to add option -lwldap32, but that's made no difference :/
What am I missing?
EDIT: Here's a sample of the first compile command that completed successfully:
mingw32-g++.exe -Wall -pipe -mthreads -std=gnu++14 -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -O2 -DCURL_STATICLIB -IE:\plus\libs\wxWidgets\include -IE:\plus\libs\curl-7.43.0\include -IE:\plus\libs\wxWidgets\lib\gcc_lib\mswu -c E:\plus\projects\hlr\hlrMain.cpp -o obj\Release\hlrMain.o
E:\plus\projects\hlr\hlrMain.cpp:165:1: warning: 'virtual bool wxEvtHandler::TryValidator(wxEvent&)' is deprecated [-Wdeprecated-declarations]
}
^
In file included from E:\plus\libs\wxWidgets\include/wx/menu.h:14:0,
from E:\plus\projects\hlr\hlrMain.h:14,
from E:\plus\projects\hlr\hlrMain.cpp:10:
E:\plus\libs\wxWidgets\include/wx/event.h:3683:22: note: declared here
virtual bool TryValidator(wxEvent& WXUNUSED(event)), return false; )
^
E:\plus\libs\wxWidgets\include/wx/defs.h:615:43: note: in definition of macro 'wxDEPRECATED'
#define wxDEPRECATED(x) wxDEPRECATED_DECL x
^
E:\plus\libs\wxWidgets\include/wx/event.h:3682:5: note: in expansion of macro 'wxDEPRECATED_BUT_USED_INTERNALLY_INLINE'
wxDEPRECATED_BUT_USED_INTERNALLY_INLINE(
^
E:\plus\projects\hlr\hlrMain.cpp:165:1: warning: 'virtual bool wxEvtHandler::TryParent(wxEvent&)' is deprecated [-Wdeprecated-declarations]
}
Link to full output with lots of warnings here: http://pastebin.com/a6s0mwQ7
Failed compile:
mingw32-g++.exe -LE:\plus\libs\wxWidgets\lib\gcc_lib -o bin\Release\hlr.exe obj\Release\hlrApp.o obj\Release\hlrMain.o obj\Release\resource.res -s -lwldap32 -mthreads -lwxmsw30u -lwxpng -lwxjpeg -lwxtiff -lwxzlib E:\plus\libs\curl-7.43.0\lib\libcurl.a E:\plus\libs\curl-7.43.0\lib\libcurldll.a -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 -mwindows
E:\plus\libs\curl-7.43.0\lib\libcurl.a(connect.o):(.text+0xbda): undefined reference to `_imp__WSAIoctl#36'
E:\plus\libs\curl-7.43.0\lib\libcurl.a(ldap.o):(.text+0x145): undefined reference to `_imp__ldap_err2string'
E:\plus\libs\curl-7.43.0\lib\libcurl.a(ldap.o):(.text+0x187): undefined reference to `_imp__ldap_msgfree'
E:\plus\libs\curl-7.43.0\lib\libcurl.a(ldap.o):(.text+0x1b4): undefined reference to `_imp__ldap_unbind_s'
E:\plus\libs\curl-7.43.0\lib\libcurl.a(ldap.o):(.text+0x41f): undefined reference to `_imp__ldap_set_option'
E:\plus\libs\curl-7.43.0\lib\libcurl.a(ldap.o):(.text+0x444): undefined reference to `_imp__ldap_init'
E:\plus\libs\curl-7.43.0\lib\libcurl.a(ldap.o):(.text+0x47b): undefined reference to `_imp__ldap_simple_bind_s'
E:\plus\libs\curl-7.43.0\lib\libcurl.a(ldap.o):(.text+0x4f1): undefined reference to `_imp__ldap_err2string'
E:\plus\libs\curl-7.43.0\lib\libcurl.a(ldap.o):(.text+0x5a9): undefined reference to `_imp__ldap_search_s'
E:\plus\libs\curl-7.43.0\lib\libcurl.a(ldap.o):(.text+0x5c2): undefined reference to `_imp__ldap_err2string'
E:\plus\libs\curl-7.43.0\lib\libcurl.a(ldap.o):(.text+0x5f1): undefined reference to `_imp__ldap_first_entry'
E:\plus\libs\curl-7.43.0\lib\libcurl.a(ldap.o):(.text+0x62c): undefined reference to `_imp__ldap_get_dn'
E:\plus\libs\curl-7.43.0\lib\libcurl.a(ldap.o):(.text+0x6cc): undefined reference to `_imp__ldap_memfree'
E:\plus\libs\curl-7.43.0\lib\libcurl.a(ldap.o):(.text+0x6e9): undefined reference to `_imp__ldap_first_attribute'
E:\plus\libs\curl-7.43.0\lib\libcurl.a(ldap.o):(.text+0x71e): undefined reference to `_imp__ldap_get_values_len'
E:\plus\libs\curl-7.43.0\lib\libcurl.a(ldap.o):(.text+0x911): undefined reference to `_imp__ldap_value_free_len'
E:\plus\libs\curl-7.43.0\lib\libcurl.a(ldap.o):(.text+0x91e): undefined reference to `_imp__ldap_memfree'
E:\plus\libs\curl-7.43.0\lib\libcurl.a(ldap.o):(.text+0x93b): undefined reference to `_imp__ber_free'
E:\plus\libs\curl-7.43.0\lib\libcurl.a(ldap.o):(.text+0x983): undefined reference to `_imp__ldap_value_free_len'
E:\plus\libs\curl-7.43.0\lib\libcurl.a(ldap.o):(.text+0x990): undefined reference to `_imp__ldap_memfree'
E:\plus\libs\curl-7.43.0\lib\libcurl.a(ldap.o):(.text+0x9ef): undefined reference to `_imp__ldap_next_attribute'
E:\plus\libs\curl-7.43.0\lib\libcurl.a(ldap.o):(.text+0xa14): undefined reference to `_imp__ber_free'
E:\plus\libs\curl-7.43.0\lib\libcurl.a(ldap.o):(.text+0xa29): undefined reference to `_imp__ldap_next_entry'
E:\plus\libs\curl-7.43.0\lib\libcurl.a(ldap.o):(.text+0xa69): undefined reference to `_imp__ldap_memfree'
For anyone else having this problem, turned out that I needed to add the ws2_32 lib by adding a linker settings->link library in code::blocks, using the full filename libws2_32.a.
Adding -lws2_32 as suggested elsewhere online wasn't enough for some reason.
Compile command now is:
mingw32-g++.exe -LE:\plus\libs\wxWidgets\lib\gcc_lib -o bin\Release\hlr.exe obj\Release\hlrApp.o obj\Release\hlrMain.o obj\Release\resource.res -s -mthreads -lwxmsw30u -lwxpng -lwxjpeg -lwxtiff -lwxzlib -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 E:\plus\libs\curl-7.43.0\lib\libcurl.a E:\plus\compilers\MinGW\i686-w64-mingw32\lib\libws2_32.a E:\plus\compilers\MinGW\i686-w64-mingw32\lib\libwldap32.a -mwindows
Curl depends on OpenSSL. Make sure you have linked it.
_imp__WSAIoctl is a part of "Ws2.lib"(Ws2_32.lib), header "winsock2.h". Try make sure that this reference is resolved in your project.
I have an already working c++ + wxWidgets app built in Eclipse, with wxWidgets built using MSYS.
Now i'd like to try different IDEs, like CodeLite and Code::Blocks, but when i tried them they did'nt work 'cause i was lacking a build.cfg file they wants.
So i tried a "clean" way, backupped the wxWidgets and build them again using MinGW32-make instead of MSYS.
Trying Code:Block now, i get a lot of "undefined reference" errors, and i can't understand what i've done or set wrong.
I'll try to give here all the related info:
Path to wxWidgets:
C:\SVILUPPO\TOOLS\wxWidgets
Path variable (the related part)
PATH=C:\SVILUPPO\TOOLS\MinGW\bin;C:\SVILUPPO\TOOLS\MinGW\libexec\gcc\mingw32\4.8.1;
Mingw v4.8.1, make version
C:\SVILUPPO\TOOLS\wxWidgets>mingw32-make -v
GNU Make 3.82.90
Built for i686-pc-mingw32
wxWidgets build command:
C:\SVILUPPO\TOOLS\wxWidgets\build\msw>mingw32-make -f makefile.gcc BUILD=debug UNICODE=1 SHARED=0 MONOLITHIC=1
Code::Block build log:
-------------- Build: Debug in MyProject (compiler: GNU GCC Compiler)---------------
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wall -g -D__WXDEBUG__ -IC:\SVILUPPO\TOOLS\wxWidgets\lib\gcc_lib\mswud -IC:\SVILUPPO\TOOLS\wxWidgets\include -c C:\Source\Codeblocks\Progetti\MyProject\MyProject\src\CustomControls\TAntiAliasedGauge\TAntiAliasedGauge.cpp -o obj\Debug\src\CustomControls\TAntiAliasedGauge\TAntiAliasedGauge.o
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wall -g -D__WXDEBUG__ -IC:\SVILUPPO\TOOLS\wxWidgets\lib\gcc_lib\mswud -IC:\SVILUPPO\TOOLS\wxWidgets\include -c C:\Source\Codeblocks\Progetti\MyProject\MyProject\src\fMainForm.cpp -o obj\Debug\src\fMainForm.o
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wall -g -D__WXDEBUG__ -IC:\SVILUPPO\TOOLS\wxWidgets\lib\gcc_lib\mswud -IC:\SVILUPPO\TOOLS\wxWidgets\include -c C:\Source\Codeblocks\Progetti\MyProject\MyProject\src\GUI_MainForm.cpp -o obj\Debug\src\GUI_MainForm.o
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wall -g -D__WXDEBUG__ -IC:\SVILUPPO\TOOLS\wxWidgets\lib\gcc_lib\mswud -IC:\SVILUPPO\TOOLS\wxWidgets\include -c C:\Source\Codeblocks\Progetti\MyProject\MyProject\src\My_Project.cpp -o obj\Debug\src\My_Project.o
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wall -g -D__WXDEBUG__ -IC:\SVILUPPO\TOOLS\wxWidgets\lib\gcc_lib\mswud -IC:\SVILUPPO\TOOLS\wxWidgets\include -c C:\Source\Codeblocks\Progetti\MyProject\MyProject\src\Prova_wxcrafter_bitmaps.cpp -o obj\Debug\src\Prova_wxcrafter_bitmaps.o
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wall -g -D__WXDEBUG__ -IC:\SVILUPPO\TOOLS\wxWidgets\lib\gcc_lib\mswud -IC:\SVILUPPO\TOOLS\wxWidgets\include -c C:\Source\Codeblocks\Progetti\MyProject\MyProject\src\Utilities\Utilities.cpp -o obj\Debug\src\Utilities\Utilities.o
C:\Source\Codeblocks\Progetti\MyProject\MyProject\src\Utilities\Utilities.cpp: In function 'char HexToChar(char*)':
C:\Source\Codeblocks\Progetti\MyProject\MyProject\src\Utilities\Utilities.cpp:73:66: warning: operation on 'HexString' may be undefined [-Wsequence-point]
return (char)((AscHex(*HexString++) * 16) | AscHex(*HexString++));
^
C:\Source\Codeblocks\Progetti\MyProject\MyProject\src\Utilities\Utilities.cpp: In function 'byte HexToByte(char*)':
C:\Source\Codeblocks\Progetti\MyProject\MyProject\src\Utilities\Utilities.cpp:77:66: warning: operation on 'HexString' may be undefined [-Wsequence-point]
return (byte)((AscHex(*HexString++) * 16) | AscHex(*HexString++));
^
mingw32-g++.exe -LC:\SVILUPPO\TOOLS\wxWidgets\lib\gcc_lib -o bin\Debug\MyProject.exe obj\Debug\src\CustomControls\TAntiAliasedGauge\TAntiAliasedGauge.o obj\Debug\src\fMainForm.o obj\Debug\src\GUI_MainForm.o obj\Debug\src\My_Project.o obj\Debug\src\Prova_wxcrafter_bitmaps.o obj\Debug\src\Utilities\Utilities.o -mthreads -lwxmsw30ud -lwxpngd -lwxjpegd -lwxtiffd -lwxzlibd -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 -mwindows
C:\SVILUPPO\TOOLS\wxWidgets\lib\gcc_lib/libwxmsw30ud.a(monolib_xml.o): In function `StartElementHnd':
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:637: undefined reference to `XML_GetCurrentLineNumber'
C:\SVILUPPO\TOOLS\wxWidgets\lib\gcc_lib/libwxmsw30ud.a(monolib_xml.o): In function `TextHnd':
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:687: undefined reference to `XML_GetCurrentLineNumber'
C:\SVILUPPO\TOOLS\wxWidgets\lib\gcc_lib/libwxmsw30ud.a(monolib_xml.o): In function `StartCdataHnd':
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:702: undefined reference to `XML_GetCurrentLineNumber'
C:\SVILUPPO\TOOLS\wxWidgets\lib\gcc_lib/libwxmsw30ud.a(monolib_xml.o): In function `CommentHnd':
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:727: undefined reference to `XML_GetCurrentLineNumber'
C:\SVILUPPO\TOOLS\wxWidgets\lib\gcc_lib/libwxmsw30ud.a(monolib_xml.o): In function `PIHnd':
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:742: undefined reference to `XML_GetCurrentLineNumber'
C:\SVILUPPO\TOOLS\wxWidgets\lib\gcc_lib/libwxmsw30ud.a(monolib_xml.o): In function `ZN13wxXmlDocument4LoadER13wxInputStreamRK8wxStringi':
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:813: undefined reference to `XML_ParserCreate'
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:826: undefined reference to `XML_SetUserData'
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:827: undefined reference to `XML_SetElementHandler'
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:828: undefined reference to `XML_SetCharacterDataHandler'
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:829: undefined reference to `XML_SetCdataSectionHandler'
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:830: undefined reference to `XML_SetCommentHandler'
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:831: undefined reference to `XML_SetProcessingInstructionHandler'
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:832: undefined reference to `XML_SetDefaultHandler'
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:833: undefined reference to `XML_SetUnknownEncodingHandler'
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:840: undefined reference to `XML_Parse'
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:843: undefined reference to `XML_GetErrorCode'
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:843: undefined reference to `XML_ErrorString'
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:846: undefined reference to `XML_GetCurrentLineNumber'
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:865: undefined reference to `XML_ParserFree'
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 29 second(s))
19 error(s), 2 warning(s) (0 minute(s), 29 second(s))
I also tried adding other libs i had to add when i built this code under arm-linux) in the linker settings, but these libraries files are not existing (i guess 'cause the MONOLITHIC option):
libwxmsw30ud_core.a
libwxmsw30ud_html.a
libwxmsw30ud_adv.a
libwxbase30ud_xml.a
libwxmsw30ud_richtext.a
In the end, i don't know what i should to finally link and debug my sources from Code::Block.
You need to link with libwxexpat.a which was created when you built wxWidgets.
I've recently been trying to port a C++ application. I believe I have all of it's dependencies and such and it all compiles. But then, when it goes to link it I get a lot of weird undefined reference errors.
/usr/local/lib/libglibmm-2.4.so.7.0: undefined reference to `std::basic_istream<char, std::char_traits<char> >::seekg(long, std::_Ios_Seekdir)'
/usr/local/lib/libglibmm-2.4.so.7.0: undefined reference to `std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_S_empty_rep_storage'
/usr/local/lib/libxml++-2.6.so.0.1: undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_empty_rep_storage'
/usr/local/lib/libxml++-2.6.so.0.1: undefined reference to `std::__default_alloc_template<true, 0>::deallocate(void*, unsigned long)'
What can cause this kind of errors? What do the linking errors mean? I can't really understand the complicated template error messages that gcc gives..
The linking command in it's entirety:
gmake[3]: Entering directory `/home/earlz/synfig-0.62.00/src/tool'
/bin/sh ../../libtool --tag=CXX --mode=link eg++ -I/usr/local/include/libxml++-2.6 -I/usr/local/lib/libxml++-2.6/include -I/usr/local/include/libxml2 -I/usr/local/include -I/usr/local/include/glibmm-2.4 -I/usr/local/lib/glibmm-2.4/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/sigc++-2.0 -I/usr/local/lib/sigc++-2.0/include -I/usr/local/include -I/usr/local/include/sigc++-2.0 -I/usr/local/lib/sigc++-2.0/include -DSYNFIG_NO_DEPRECATED -DLOCALEDIR=\"/usr/local/share/locale\" -DNDEBUG -O2 -W -Wall -o synfig synfig-main.o ../synfig/libsynfig.la -L/usr/local/lib -lxml++-2.6 -lxml2 -lglibmm-2.4 -lgobject-2.0 -lglib-2.0 -lintl -liconv -lsigc-2.0 -lpthread -L/usr/local/lib -lsigc-2.0 -L/usr/local/lib -lintl -L/usr/local/lib -liconv -lpthread
libtool: link: eg++ -I/usr/local/include/libxml++-2.6 -I/usr/local/lib/libxml++-2.6/include -I/usr/local/include/libxml2 -I/usr/local/include -I/usr/local/include/glibmm-2.4 -I/usr/local/lib/glibmm-2.4/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -I/usr/local/include/sigc++-2.0 -I/usr/local/lib/sigc++-2.0/include -I/usr/local/include -I/usr/local/include/sigc++-2.0 -I/usr/local/lib/sigc++-2.0/include -DSYNFIG_NO_DEPRECATED -DLOCALEDIR=\"/usr/local/share/locale\" -DNDEBUG -O2 -W -Wall -o .libs/synfig synfig-main.o -L../synfig/.libs -lsynfig -L/usr/local/lib -lxml++-2.6 -lxml2 -lm -lz -lglibmm-2.4 -lgmodule-2.0 -lgobject-2.0 -lglib-2.0 -lpcre -lsigc-2.0 -lintl -liconv -lpthread -Wl,-rpath,/usr/local/lib
Also, I do not get any kind of linking errors about missing files, just stuff about weird string and filestream stuff missing
Use g++ to link C++ applications, that add C++ standard libraries to the link phase.