Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to solve undefined reference errors when linking log4cxx in qmake project
    primarykey
    data
    text
    <p>It's the second day I'm trying to marry Qt5, MinGW and log4cxx.</p> <p>Even after I've compiled everything successfully, linked apr, apr-util and log4cxx libraries, <code>ld</code> gives me a bunch of "undefined reference" problems.</p> <p>It looks like different settings were specified during log4cxx compilation (I'm using ant). Was anyone able to successfully compile and use log4cxx with MinGW?</p> <p>Environment:</p> <ul> <li>log4cxx trunk </li> <li>apr 1.4.6 </li> <li>apr-util 1.5.2 </li> <li>latest MinGW</li> <li>I'm using Qt 5 with latest MinGW as a compiler</li> </ul> <p>What I've done:</p> <ul> <li>compiled log4cxx using ant with the following command: "ant -Dcompiler=gcc -Dfind=false -DLOG4CXX_STATIC=1 -Dlib.type=static" </li> <li>added result libraries to my project in pro file: "LIBS += -L../log4cxx/lib LIBS += -llibapr-1 -llibaprutil-1 -lliblog4cxx"</li> </ul> <p>And now, as I try to link my project, I'm getting the next:</p> <pre><code>*C:/mingw/bin/mingw32-make -f Makefile.Debug mingw32-make[1]: Entering directory 'C:/Work/SPP_Development/AutoHaul/Sub-systems/TCS/Source/build-SimulatorEngine-Standalone_MinGW-Debug' g++ -Wl,-subsystem,windows -mthreads -o debug\SimulatorEngine.exe object_script.SimulatorEngine.Debug -lmingw32 -lqtmaind -L../log4cxx/lib -llibapr-1 -llibaprutil-1 -lliblog4cxx -LC:\Qt\Qt5.0.1\5.0.1\mingw47_32\lib -lQt5XmlPatternsd -lQt5Widgetsd -lQt5Networkd -lQt5Xmld -lQt5Guid -lQt5Cored -llibEGLd -llibGLESv2d -lgdi32 -luser32 Makefile.Debug:200: recipe for target 'debug\SimulatorEngine.exe' failed mingw32-make[1]: Leaving directory 'C:/Work/SPP_Development/AutoHaul/Sub-systems/TCS/Source/build-SimulatorEngine-Standalone_MinGW-Debug' Makefile:34: recipe for target 'debug' failed ../log4cxx/lib/liblog4cxx.lib(mutex.o): In function `ZN7log4cxx7helpers5MutexC2ERNS0_4PoolE': c:/Work/log4cxx/apache-log4cxx-trunc/src/main/cpp/mutex.cpp:35: undefined reference to `apr_thread_mutex_create@12' ../log4cxx/lib/liblog4cxx.lib(mutex.o): In function `ZN7log4cxx7helpers5MutexC2EP10apr_pool_t': c:/Work/log4cxx/apache-log4cxx-trunc/src/main/cpp/mutex.cpp:45: undefined reference to `apr_thread_mutex_create@12' ../log4cxx/lib/liblog4cxx.lib(mutex.o): In function `ZN7log4cxx7helpers5MutexD2Ev': c:/Work/log4cxx/apache-log4cxx-trunc/src/main/cpp/mutex.cpp:55: undefined reference to `apr_thread_mutex_destroy@4'* </code></pre> <p>It looks like log4cxx library cannot findfunctions declared and defined in the apr library by whatever reason.</p> <p>Is there any way to analyze the problem further to see why is this happening?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload