Cross compiling linker error - c++

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.

Related

Error building wxWidgets DLLs with GCC's Link Time Optimization on Windows

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...

Can't link wxWidgets app with Code::Blocks / MinGW

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.

Linking issue with libcrypto: undefined reference to `__imp__CertFreeCertificateContext'

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.

Compiling wtwithqt example with QtCreator(qmake)

I am working on a network management application with Qt and I chose to use Wt for UI, because with it I will not have to deal with any of web parts (PHP, AJAX, HTML/CSS) and it'll be usable on all platforms.
I successfully managed to compile and run examples using cmake. Although I am used to QtCreator IDE and qmake I would rather use that for development and compiling.
I got stuck trying to compile "wtwithqt" example in QtCreator(qmake). I've been searching everywhere for some guide how to compile it with qmake. However I found nothing helpful.
Here is my .pro file.
testWt.pro
QT += core
QT -= gui
TARGET = helloqt
CONFIG += console no_keywords
CONFIG -=app_bundle
TEMPLATE = app
INCLUDEPATH += lib
LIBS += -lwt -lwthttp -lboost_signals -lboost_system -lboost_regex
QMAKE_CXXFLAGS += -DNDEBUG
HEADERS += \
QtObject.h \
HelloApplication.h
SOURCES += \
hello.cpp \
QtObject.cpp
Compile ouput
13:28:15: Running build steps for project testWt...
13:28:15: Starting: "/usr/bin/make" clean -w
make: Entering directory `/home/nms-development/QtProject/testWt-build-desktop-Qt_4_8_1_in_PATH__System__Debug'
/usr/bin/qmake-qt4 -spec /usr/share/qt4/mkspecs/linux-g++ CONFIG+=debug CONFIG+=declarative_debug -o Makefile ../testWt/testWt.pro
make: Leaving directory `/home/nms-development/QtProject/testWt-build-desktop-Qt_4_8_1_in_PATH__System__Debug'
make: Entering directory `/home/nms-development/QtProject/testWt-build-desktop-Qt_4_8_1_in_PATH__System__Debug'
rm -f moc_QtObject.cpp
rm -f hello.o QtObject.o moc_QtObject.o
rm -f *~ core *.core
make: Leaving directory `/home/nms-development/QtProject/testWt-build-desktop-Qt_4_8_1_in_PATH__System__Debug'
13:28:15: The process "/usr/bin/make" exited normally.
13:28:15: Configuration unchanged, skipping qmake step.
13:28:15: Starting: "/usr/bin/make" -w
make: Entering directory `/home/nms-development/QtProject/testWt-build-desktop-Qt_4_8_1_in_PATH__System__Debug'
g++ -c -pipe -DNDEBUG -g -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_NO_KEYWORDS -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I../testWt -I/usr/include/qt4/QtCore -I/usr/include/qt4 -I../testWt/lib -I. -I../testWt -I. -o hello.o ../testWt/hello.cpp
g++ -c -pipe -DNDEBUG -g -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_NO_KEYWORDS -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I../testWt -I/usr/include/qt4/QtCore -I/usr/include/qt4 -I../testWt/lib -I. -I../testWt -I. -o QtObject.o ../testWt/QtObject.cpp
/usr/bin/moc-qt4 -DQT_WEBKIT -DQT_NO_KEYWORDS -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I../testWt -I/usr/include/qt4/QtCore -I/usr/include/qt4 -I../testWt/lib -I. -I../testWt -I. ../testWt/QtObject.h -o moc_QtObject.cpp
g++ -c -pipe -DNDEBUG -g -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_NO_KEYWORDS -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I../testWt -I/usr/include/qt4/QtCore -I/usr/include/qt4 -I../testWt/lib -I. -I../testWt -I. -o moc_QtObject.o moc_QtObject.cpp
g++ -o helloqt hello.o QtObject.o moc_QtObject.o -L/usr/lib/i386-linux-gnu -lwt -lwthttp -lboost_signals -lboost_system -lboost_regex -lQtCore -lpthread
hello.o: In function `HelloApplication':
/home/nms-development/QtProject/testWt-build-desktop-Qt_4_8_1_in_PATH__System__Debug/../testWt/hello.cpp:43: undefined reference to `Wt::WQApplication::WQApplication(Wt::WEnvironment const&, bool)'
hello.o: In function `HelloApplication::propagateGreet()':
/home/nms-development/QtProject/testWt-build-desktop-Qt_4_8_1_in_PATH__System__Debug/../testWt/hello.cpp:87: undefined reference to `Wt::toQString(Wt::WString const&)'
hello.o: In function `HelloApplication::doGreet(QString const&)':
/home/nms-development/QtProject/testWt-build-desktop-Qt_4_8_1_in_PATH__System__Debug/../testWt/hello.cpp:92: undefined reference to `Wt::toWString(QString const&)'
hello.o: In function `~WQApplication':
/home/nms-development/QtProject/testWt-build-desktop-Qt_4_8_1_in_PATH__System__Debug/../testWt/lib/WQApplication:82: undefined reference to `vtable for Wt::WQApplication'
hello.o:(.rodata._ZTV16HelloApplication[vtable for HelloApplication]+0x3c): undefined reference to `Wt::WQApplication::initialize()'
hello.o:(.rodata._ZTV16HelloApplication[vtable for HelloApplication]+0x40): undefined reference to `Wt::WQApplication::finalize()'
hello.o:(.rodata._ZTV16HelloApplication[vtable for HelloApplication]+0x44): undefined reference to `Wt::WQApplication::notify(Wt::WEvent const&)'
hello.o:(.rodata._ZTV16HelloApplication[vtable for HelloApplication]+0x5c): undefined reference to `Wt::WQApplication::realNotify(Wt::WEvent const&)'
hello.o:(.rodata._ZTI16HelloApplication[typeinfo for HelloApplication]+0x8): undefined reference to `typeinfo for Wt::WQApplication'
collect2: ld returned 1 exit status
make: Leaving directory `/home/nms-development/QtProject/testWt-build-desktop-Qt_4_8_1_in_PATH__System__Debug'
make: *** [helloqt] Error 1
13:28:28: The process "/usr/bin/make" exited with code 2.
Error while building project testWt (target: Desktop)
When executing build step 'Make'
Any help is appreciated! Thanks in advance!
Your makefile is pretty much sound, but I think you've forgotten to link the wtwitqt interop layer. Add -lwtwithqt to the LIBS line,

ld path update for compiling

I just installed manually apr and apr_util so i can install activemq c++ library.
When i try to make the cpp library i get the following error:
**
libtool: link: g++ -ansi -pedantic -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -I/usr/local/apr/include/apr-1 -I/usr/local/apr/include/apr-1 -I/usr/kerberos/include -W -Wall -Wextra -Wconversion -fPIC -fstrict-aliasing -Wstrict-aliasing=2 -Wno-long-long -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE -I/usr/local/apr/include/apr-1 -I/usr/local/apr/include/apr-1 -I/usr/kerberos/include -Wno-non-virtual-dtor -Wno-unused-parameter -Wno-uninitialized -I./../main -g -O2 -pthread -o .libs/example example-main.o ../main/.libs/libactivemq-cpp.so -lexpat -L/usr/kerberos/lib64 /usr/local/apr/lib/libaprutil-1.so /usr/local/apr/lib/libapr-1.so -luuid -lrt -lcrypt /usr/local/apr/lib/libexpat.so -lssl -lcrypto -ldl -lz -lpthread -pthread -Wl,-rpath -Wl,/usr/local/lib -Wl,-rpath -Wl,/usr/local/apr/lib
/usr/bin/ld: cannot find -lexpat
collect2: ld returned 1 exit status
**
and expat is within apr-util and not being linked. how can i update the ld path so that make or environment will find it?
or in short: how can i resolve this?
Usually you'll need to manually specify the library path using -L option.
It would look like ld filename -Lpath -llibname in a single ld operation. Or in this case you may need to add the paths of your library(apr-util here) to the constant of library paths in a Makefile.