I have seen a couple of threads on this but have not seen a solution. I would like to build a tinyxml dll with typelibrary for use with my C++ application. I am using Visual Studio.net 2003 to compile.
I have completed the following steps:
- opened the project in the IDE (project and solution files were updated).
- changed settings:
ConfigurationType=DLL (under General)
Runtime library=multi-threaded DLL
- added __declspec(dllexport) to the following classes TiXmlAttribute, TiXmlAttributeSet, TiXmlBase, TiXmlComment, TiXmlCursor, TiXmlDocument,
TiXmlElement, TiXmlHandle, TiXmlNode
When I use the type library with my project (after incl header files), I get the following message:
main.obj : error LNK2001: unresolved external symbol "private: static bool TiXmlBase::condenseWhiteSpace" (?condenseWhiteSpace@TiXmlBase@@0_NA)
main.obj : error LNK2001: unresolved external symbol "public: static int const * const TiXmlBase::utf8ByteTable" (?utf8ByteTable@TiXmlBase@@2QBHB)
Any idea what I should do? Thanks in advance.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Did you add the export to the static functions like you did with the classes?
Tip though: are you *sure* you need tinyxml in a DLL? What is the advantage? Why not just link it right into your app; its only 2 cpp files after all. Also, it won't be a typelibrary, just a DLL (unless I'm misunderstanding you). If you want an XML parser in a typelibrary for COM etc then just use MSXML.
HTH
Ellers
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have seen a couple of threads on this but have not seen a solution. I would like to build a tinyxml dll with typelibrary for use with my C++ application. I am using Visual Studio.net 2003 to compile.
I have completed the following steps:
- opened the project in the IDE (project and solution files were updated).
- changed settings:
ConfigurationType=DLL (under General)
Runtime library=multi-threaded DLL
- added __declspec(dllexport) to the following classes TiXmlAttribute, TiXmlAttributeSet, TiXmlBase, TiXmlComment, TiXmlCursor, TiXmlDocument,
TiXmlElement, TiXmlHandle, TiXmlNode
When I use the type library with my project (after incl header files), I get the following message:
main.obj : error LNK2001: unresolved external symbol "private: static bool TiXmlBase::condenseWhiteSpace" (?condenseWhiteSpace@TiXmlBase@@0_NA)
main.obj : error LNK2001: unresolved external symbol "public: static int const * const TiXmlBase::utf8ByteTable" (?utf8ByteTable@TiXmlBase@@2QBHB)
Any idea what I should do? Thanks in advance.
Did you add the export to the static functions like you did with the classes?
Tip though: are you *sure* you need tinyxml in a DLL? What is the advantage? Why not just link it right into your app; its only 2 cpp files after all. Also, it won't be a typelibrary, just a DLL (unless I'm misunderstanding you). If you want an XML parser in a typelibrary for COM etc then just use MSXML.
HTH
Ellers
OK, I compiled it as a static library and I am including in my project and it is working. Two questions:
1. I get the following warning: LINK : warning LNK4098: defaultlib 'LIBC' conflicts with use of other libs; use /NODEFAULTLIB:library
What should I do to prevent this?
2. Should I build the release static library using /MT or /ML or does it not matter?
Thanks.
Please ignore my question. I had to build the TinyXML static library using /MDd and /MD for debug and release, respectively.