TinyXml 的链接问题++和 Visual C++精简版 2008

发布于 2024-10-21 01:50:41 字数 461 浏览 0 评论 0原文

我正在尝试在我的项目中使用TinyXml++,并且我之前已经在一个小程序中测试成功。我最近决定使用它来读取当前项目中的配置文件,尽管编译了代码,但我遇到了大量链接器错误(主要是未解析的外部符号)。我在一些论坛帖子中读到,描述了一个类似的问题,我必须使用与编译 TinyXml++ 相同的运行时库。我打开附带的 Visual C++ 2008 项目,发现它正在使用多线程调试 (/MTd)。

现在,在包含“ticpp.h”之前,我已经测试了使用和不使用 #define TINYXML_USE_TICPP 的所有运行时库。我收到了 9 到 80 个链接器错误(这就是为什么我最初不想将它们全部发布,但如果你想看到它们我会的)。

我已将静态库 ticppd.lib(在下载文件夹中找到)复制到我的项目目录中,并将其链接到链接器->输入->附加依赖项下。我在 C/C++->常规->附加包含目录下包含了 TinyXml++ 源的目录路径。我做错了什么? :(

I'm trying to use TinyXml++ in my project, and I have tested it successfully in a small program before. I recently decided to use it to read a configuration file in my current project and though the code compiled, I got a ton of linker errors (unresolved external symbols mostly). I read in some forum thread, describing a similar problem, that I had to use the same runtime library as TinyXml++ was compiled with. I opened the accompanying Visual C++ 2008 project and saw it was using Multi-threaded Debug (/MTd).

I have now tested all runtime libraries with and without #define TINYXML_USE_TICPP before I include "ticpp.h". I've gotten from 9 to 80 linker errors (which I why I initially didn't want to post them all, but I will if you want to see them).

I have copied the static library ticppd.lib (found in the download folder) to my project's directory and linked it under Linker->Input->Addtional Dependencies. I have included a directory path to the TinyXml++ source under C/C++->General->Addtional Include Directories. What am I doing wrong? :(

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不必你懂 2024-10-28 01:50:41

TinyXML 是一个具有完整源代码的库;您不需要包含 .lib。您可以将 TinyXML 分离到一个单独的项目中,并将您的项目标记为依赖于它,这将允许您使用一致的线程和调试设置来编译两个项目,但让它工作的最简单方法应该是仅添加 TinyXML .cpp和 .h 文件(只是不是测试文件)到您的项目并编译。

TinyXML is a library with the full source code available; you should not need to include a .lib. You could separate TinyXML into a separate project and mark your project as depending on it, which will allow you to compile both projects with consistent settings for threading and debugging, but the easiest way to get it working should be to just add the TinyXML .cpp and .h files (just not the test one) to your project and compile.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文