From: Václav Z. <vha...@gm...> - 2014-02-28 18:36:53
|
On 02/28/2014 06:42 PM, drkmkzs wrote: > Hello, > > I'm trying to use log4cplus on windows7, with MinGW, but I am > expericencing some problems ... > > I tried the 1.1.3-rc1 and 1.1.2, it has the same behaviour. > > Compilation of log4cplus is OK with Cmake, i have my > liblog4cplusU.dll, so far, cool :) > > In my app i create a static lib that links to the liblog4cplusU.dll, > it's ok. > > But when my exe tries to link with my static library, i have some > error "undefined reference to > `_imp___ZN9log4cplus6Logger11getInstanceERKSs'" I have checked that > my CmakeList of my exe has correct link and libraries directory > specified ... > > I have read some thread : > http://stackoverflow.com/questions/2848556/c-project-compiles-as-static-lib-fails-linker-error-as-dynamic-lib-why > > I tried to add definitions in my Cmake ( LOG4CPLUS_BUILD_DLL, > log4cplus_EXPORTS, DLL_EXPORT) , but it didn't change anything .... > > Am I missing anything ? I suspect that when you are linking your static library to your executable, it does not pull in the dependency on the log4cplus DLL import library. Try linking your executable specifically to liblog4cplusU.a, or whatever is the correct log4cplus DLL import library file name. -- VZ |