I have a VS2008 native C ++ project, that I wish to compile as DLL.
Only refers to an external library (log4cplus.lib), and uses its functions (also uses log4cplus.h files, naturally).
When I try to compile my project as a static library, it succeeds that I try as a DLL, it fails:
1 & gt; MessageWriter.obj: Error LNK2019: Unsolved exotic symbol "public: static class log4cplus :: logger __cdecl log4cplus :: logger :: getInstance (class std :: basic_string & lt; wchar_t, struct std :: char_traits & lt; wchar_t & gt; , Class std :: communicator & lt; wchar_t & gt; constants & amp;?) "(GetInstance @logger@log4cplus@@ SA AV12 @ Atal Bihari Vajpayee $ basic_string @ _WU? $ Char_traits @ Now it's just standard @ STD @@ V? $ Contributor @ now just standard @ 2 @@ STD @@@ Z.? (Log in @@ YA "log (zero) __cdecl class log4cplus :: logger" function referenced in? AVLogger @ log4cplus @@ XZ)
Rf are 4 more errors related to actions within the log4cplus.lib
It really feels like something stupid .. please help me .:)
Thank you!
Edit:
I'm connected to the log4cplus.lib file, and it gets it right. Also, log4cplus.lib is 100% functional, I'm using it with no problem in any other project. My original intention was to compile my project as a static library and use it in other DLLs written, but when do it, I get the same linker errors in that other project ...
Edit # 2:
The reason that the cause of linker errors is static functions. This can be part of the problem.
wilx is correct. I have a similar link problem.
It took me almost a day to cover this problem.
I downloaded log4cplus-1.0. 4, after I opened this project with Visual Studio 2010, it does not have any stable, dynamic and dynamic libraries, no error
However, when I try to use those libraries, I get a link error, no matter the static library or dynamic library.
The reason, this project uses multi-byte characters, however, my own project uses Unicode, so, to cover those link problems, you only need to change one project
Both Unicode or both multi-byte charsets.
To change one and change the project's charset Visual Studio 2010, see the following link.
Comments
Post a Comment