Sign in to follow this  

Statically linking TinyXML

This topic is 2837 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

My project requires the use of TinyXML and we would prefer to link statically against it than include the source and header files within our project. I've downloaded the 2.5.3 build from the TinyXML SourceForge page, and built the projects just fine. The two sample applications also run fine. The problem is that when linking against them in my project, I get 100 or so link errors. I've compared the project files for TinyXMLSTLTest and my project using WinMerge and couldn't spot any settings that may have been conflicting between the libraries and my project. I've actually always had trouble getting TinyXML to link statically and in the end I always end up having to include the headers and source directly into my project in order to get it to successfully link. Unfortunately the project files are on my laptop and it's currently unable to connect to the internet, so apologies but I can't give all of the errors (the first 50 of which are pretty much identical to this) Note this isn't a copy paste so it may contain slight typos (it's really hard to type these out by hand!) "LNK2005: "public: __thiscall std::basic_string<char, struct std::char_traits<char>, class std::allocator<char> >::basic_string<char, struct std::char_traits<char>, std::allocator<char> >(char const*) (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@std@@QAE@PBD@Z) already defined in msvcprtd.lib(MSVCP90D.dll) in file tinyxml_STL.lib" Any suggestions? Has anyone managed to statically link with TinyXML before? Does anyone have a working build of version 2.5.3 that they could share? edit: sorry about the page stretch, I think i broke something :S

Share this post


Link to post
Share on other sites
Nevermind, I figured it out.

The TinyXML project needed to be set to "multithreaded DLL" under c++->code generation

No idea why, seeings as it's a .lib but whatever >_>

Share this post


Link to post
Share on other sites

This topic is 2837 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this