I'm using tinyxml library for parsing XML files in my project. When I try to target x64 platforms I get LINKER errors and here is one fo them:
Error 4 error LNK2001: unresolved external symbol "private: static struct TiXmlString::Rep TiXmlString::nullrep_" (?nullrep_@TiXmlString@@0URep@1@A) ClassThatUsesTinyXML.obj
Update : I figured that the x64 version of tinyxml was not installed but when I tried to build the library for x64 platforms I got this error :
LNK1561: entry point must be defined
Instead of building tinyxml for x64 platforms
and then adding tinyxml.h
and tinystr.h
to the project, I just added all the library files including the .cpp
files and now I can target x64 platforms, the library is, in fact, being built when I build the whole project.
It does not look like tinyxml supports shared library builds out of the box.
Here are the steps that I followed to build a DLL from the tinyxml 2.6.2 sources:
tinyxml.sln
, in MS Visual Studio Express 2012 for Windows Desktop. Elect to convert the old project files to the new format when prompted.Within tinyxml_2_6_2\tinyxml\x64\Release
you will find tinyxml.dll
, but no import library (tinyxml.lib
). This is because no symbols are exported. See How do I build an import library (.lib) AND a DLL in Visual C++?
If you want to go the shared library route, you will need to export the desired symbols via the MSVC-specific __declspec(dllexport)
modifier. See Symbol Visibility in Windows.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With