From: Václav Z. <vha...@gm...> - 2014-03-03 22:06:35
|
On 03/03/2014 05:59 PM, drkmkzs wrote: > Thank for help, > > But i was explicitely linking with lib4cplusU DLL when linking my > application with my static lib. > > Indeed my error was to forget to add some cmake definition for unicode > in my cmake, as in the examples... > > So after that, it was ok except my app didn't compile, when logging some > trace using glibmm methods... > > So for the moment, I have recompiled log4cplus without unicode support, > removed the definitions in my cmake, and all compile well (except for > some bad things from my side). What is the unicode option for ? I guess > to treat specific type as unicode compliant types ? The Unicode option serves the same purpose as the UNICODE (and _UNICODE) preprocessor symbols do in Windows headers. They switch between char and wchar_t in the API. When it is not defined, all the interfaces take chars and std::strings. When it is defined, all the interfaces take wchar_ts and std::wstrings. > > > 2014-02-28 19:36 GMT+01:00 Václav Zeman <vha...@gm... > <mailto:vha...@gm...>>: > > 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 |