Visual Studio 2010 中的链接器问题

发布于 2024-11-25 03:59:25 字数 1091 浏览 2 评论 0原文

好吧,这变得非常非常烦人。我有一个非托管的 VC 2010 ++ 解决方案,其中有 9 个项目,其中两个是输出静态库的项目,供其余 7 个测试项目使用。在这 7 个中的 6 个中,我没有得到一个链接器错误,而在配置与这 6 个完全相同的第 7 个中,我当前得到 12 个链接器错误,并且我看不出我做错了什么(如果我做错事)。

我尝试过:

  • 使用 Project -> 将这两个库直接添加到项目中添加->现有文件
  • 使用#pragma comment(lib,"libname.lib")指令将它们链接起来,
  • Project Properties ->;中添加引用通用属性->框架和参考
  • 将它们添加到链接器附加依赖项中(我已经检查了路径是否正确10次)

但是我已经无法让它链接几个小时了(是的,项目构建顺序设置为它应该是)。我在使用 VS 2008 时从来没有遇到过这样的问题,我希望我不需要回滚到 VS2008 来解决这个问题,因为我真的没有足够的时间再次设置 Visual Studio。

那么,有什么建议吗?

http://i47.servimg.com/u/ f47/14/27/08/40/window10.png

http://i47.servimg.com/u/f47/ 14/27/08/40/window11.png

编辑:

  file = fz_open_fd(fd);
  error = pdf_open_xref_with_stream(&p_xref, file, NULL);
  fz_close(file);
  p_outline = pdf_load_outline(p_xref);
  ....

Alright, so this is getting very very annoying. I have an unmanaged VC 2010 ++ solution with 9 projects in it, from which two of them are projects that output static libraries for remaining 7 test projects to use. In 6 of those 7 I don't get a single linker error, while in the 7th that is configured exactly the same like those 6, I currently get 12 linker errors and I fail to see what am I doing wrong (If I'm doing something wrong at all).

I've tried:

  • adding those two libraries directly into project using Project -> Add-> Existing files
  • linking them in with #pragma comment(lib,"libname.lib") directive
  • adding references in Project Properties -> Common Properties-> Framework and References
  • adding them in linker additional dependencies (I checked to see if the path is correct 10 times already)

Yet I can't get this to link for hours already (and yes, project build order is set as it should be). I never had such problems with VS 2008, and I'm hoping I will not need to roll back to VS2008 to get this solved, because I really don't have enough time to mess with setting up Visual Studio again.

So, any suggestions?

http://i47.servimg.com/u/f47/14/27/08/40/window10.png

http://i47.servimg.com/u/f47/14/27/08/40/window11.png

EDIT:

  file = fz_open_fd(fd);
  error = pdf_open_xref_with_stream(&p_xref, file, NULL);
  fz_close(file);
  p_outline = pdf_load_outline(p_xref);
  ....

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

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

发布评论

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

评论(2

甜是你 2024-12-02 03:59:25

很难猜测。但我看到一个名为“cppwrapper”的源文件。这使得您可能正在包装用 C 编写的内容。这使得您可能必须明确告诉编译器这是 C 代码而不是 C++ 代码。像这样:

extern "C" {
   #include "foo.h"
}

Hard to guess. But I see a source file named "cppwrapper". Which makes it likely that you are wrapping something that's written in C. Which makes it likely that you have to tell the compiler explicitly that this is C code and not C++ code. Like this:

extern "C" {
   #include "foo.h"
}
疾风者 2024-12-02 03:59:25

$(OutDir) 添加到您的库路径

add $(OutDir) to your library paths

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