【发布时间】:2020-12-28 22:52:04
【问题描述】:
我正在尝试编译和构建 OSG 3.0 初学者指南(Rui Wang,Xuelei Qian)在 Windows 10(Build 18363)和 Visual Studio Community 19(16.7.3)上运行的第一个基本示例。 代码如下所示:
#include <osgDBd/ReadFile>
#include <osgViewerd/Viewer> //the "d" is supposed to be there when in Debug solution configuration
int main(int argc, char** argv)
{
osgViewer::Viewer viewer;
viewer.setSceneData(osgDB::readNodeFile("cessna.osg"));
return viewer.run();
}
但是错误信息是:
Error (active) E1696 cannot open source file "osgDBd/ReadFile"
Error (active) E1696 cannot open source file "osgViewerd/Viewer"
Error C1083 Cannot open include file: 'osgDBd/ReadFile': No such file or directory
所以我重新检查了我的解决方案属性,这些属性是我按照 OSG 的在线文档“使用 Visual Studio 编译”(链接器、C++ 属性...)以及我在 Windows 操作系统中的环境变量设置的。 如果出现问题,推荐的 cmd 命令也无济于事。 (我认为省略所有这些屏幕截图会不那么混乱,但如果愿意,我当然可以上传它们)
我还将我的设置与这个答案进行了比较:How to add additional libraries to Visual Studio project?,我认为是一样的。
我应该补充一点,我将 OSG 构建在与 Visual Studio 或 Windows 不同的驱动器上,但我认为正确设置环境变量应该没问题。
我们将不胜感激。 谢谢。
【问题讨论】:
标签: visual-studio linker-errors openscenegraph