osg vs2012-OSG使用VS2012报错error LNK2019

问题描述

OSG使用VS2012报错error LNK2019

#include
#include
#include

int main()
{
osg::ref_ptrosgViewer::Viewer viewer = new osgViewer::Viewer;
viewer->addEventHandler(new osgViewer::StatsHandler);//加上这一句就错
viewer->setSceneData(osgDB::readNodeFile("cow.osg"));
return viewer->run();
}
加上以上一句才报错,说明环境配置没有问题,怎么回事?
报错:
1>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: virtual class osg::Object * thiscall osgGA::GUIEventHandler::cloneType(void)const " (imp_?cloneType@GUIEventHandler@osgGA@@UBEPAVObject@osg@@XZ),该符号在函数 "[thunk]:public: virtual class osg::Object * thiscall osgGA::GUIEventHandler::cloneTypevtordisp{4294967292,144}' (void)const " (?cloneType@GUIEventHandler@osgGA@@$4PPPPPPPM@JA@BEPAVObject@osg@@XZ) 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: virtual class osg::Object * __thiscall osgGA::GUIEventHandler::clone(class osg::CopyOp const &)const " (__imp_?clone@GUIEventHandler@osgGA@@UBEPAVObject@osg@@ABVCopyOp@4@@Z),该符号在函数 "[thunk]:public: virtual class osg::Object * __thiscall osgGA::GUIEventHandler::clone
vtordisp{4294967292,144}' (class osg::CopyOp const &)const " (?clone@GUIEventHandler@osgGA@@$4PPPPPPPM@JA@BEPAVObject@osg@@ABVCopyOp@4@@Z) 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "
declspec(dllimport) public: virtual bool thiscall osgGA::GUIEventHandler::isSameKindAs(class osg::Object const *)const " (imp_?isSameKindAs@GUIEventHandler@osgGA@@UBE_NPBVObject@osg@@@Z),该符号在函数 "[thunk]:public: virtual bool thiscall osgGA::GUIEventHandler::isSameKindAsvtordisp{4294967292,144}' (class osg::Object const *)const " (?isSameKindAs@GUIEventHandler@osgGA@@$4PPPPPPPM@JA@BE_NPBVObject@osg@@@Z) 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: virtual char const * __thiscall osgGA::GUIEventHandler::libraryName(void)const " (__imp_?libraryName@GUIEventHandler@osgGA@@UBEPBDXZ),该符号在函数 "[thunk]:public: virtual char const * __thiscall osgGA::GUIEventHandler::libraryName
vtordisp{4294967292,144}' (void)const " (?libraryName@GUIEventHandler@osgGA@@$4PPPPPPPM@JA@BEPBDXZ) 中被引用
1>main.obj : error LNK2019: 无法解析的外部符号 "
declspec(dllimport) public: virtual char const * thiscall osgGA::GUIEventHandler::className(void)const " (imp_?className@GUIEventHandler@osgGA@@UBEPBDXZ),该符号在函数 "[thunk]:public: virtual char const * __thiscall osgGA::GUIEventHandler::className`vtordisp{4294967292,144}' (void)const " (?className@GUIEventHandler@osgGA@@$4PPPPPPPM@JA@BEPBDXZ) 中被引用
1>D:WorkPlaceOSG2012LearningOSGDebug1_1_StartOSG.exe : fatal error LNK1120: 5 个无法解析的外部命令

求解?

解决方案

添加 #pragma comment(lib,"osgGAd.lib")

时间: 2024-07-31 12:40:49

osg vs2012-OSG使用VS2012报错error LNK2019的相关文章

lnk1120-vs2010运行程序报错:error LNK2019: 无法解析的外部符号

问题描述 vs2010运行程序报错:error LNK2019: 无法解析的外部符号 如题,我在vs2010环境下做C++练习题时出现该错误.程序代码如下: //array.h#ifndef ARRAY_H#define ARRAY_Htemplate<typename T>class Array{public: Array(int n);//数组首地址不用指定,待会分配 Array(Array &a); ~Array(); T getAt(int i);//返回第i个数组元素 voi

c#项目,用的是vs2012打开的,报错没有工具集,求大神帮忙解决一下,谢谢了!!拜托拜托!

问题描述 c#项目,用的是vs2012打开的,报错没有工具集,求大神帮忙解决一下,谢谢了!!拜托拜托! 项目文件包含 ToolsVersion="12.0".此工具集可能未知或缺失(您可以通过安装相应版本的 MSBuild 来解决该问题),或者该生成因策略原因已被强制更改为特殊 ToolsVersion.将此项目视作具有 ToolsVersion="4.0".有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkId=2913

php图片上传报错error=3

问题描述 php图片上传报错error=3 upload: <?php/** Created by PhpStorm. User: rosen Date: 15-11-5 Time: 下午8:43*/print_r($_FILES['file']); ?> 为什么程序运行结果报错Array ( [name] => 2015-10-19 18:47:42屏幕截图.png [type] => [tmp_name] => [error] => 3 [size] => 0

linux使用wkhtmltopdf报错error while loading shared libraries:

官网提示 linux需要这些动态库.depends on: zlib, fontconfig, freetype, X11 libs (libX11, libXext, libXrender) 在linux上执行 ./wkhtmltopdf –page-size A4 www.baidu.com pdf.pdf 报错   error while loading shared libraries: libXrender.so.1 root@mag-sit:/home/mag-sit/wkhtmlt

mvel no context-MVEL 使用模板,当并发量大的时候, 报错 [Error: no context]

问题描述 MVEL 使用模板,当并发量大的时候, 报错 [Error: no context] Caused by: java.lang.RuntimeException: no context at org.mvel2.ParserContext.makeVisible(ParserContext.java:684) at org.mvel2.ParserContext.addVariable(ParserContext.java:477) at org.mvel2.ast.TypedVarN

arcgis-ArcSDE 做POST报错Error: Operation Failed (-1).

问题描述 ArcSDE 做POST报错Error: Operation Failed (-1). 同一主机:Windows2008 R2 64位,ArcSDE for 11g 64bit 本机Oracle11g64位服务端,Oracle11g 32位客户端,Oracle10g 32为服务端 环境变量 path C:appAdministratorproduct11.2.0client_1bin;E:appAdministratorproduct11.2.0dbhome_1bin;C:Progra

docker rmi报错Error response from daemon

docker commit了一个镜像之后想删除旧的镜像,出现以下报错 Error response from daemon: conflict: unable to delete 6f8214d56bfc (cannot be forced) - image has dependent child images 解决思路: docker save保存容器 docker images docker save REPOSITORY > XX.tar 删除镜像容器 docker ps -a docke

spring分布式事物-atomikos mssql报错Error in recovery以及找不到存储过程

问题描述 atomikos mssql报错Error in recovery以及找不到存储过程 如题,我使用atomikos做spring分布式事物,同时支持Oracle.MySQL和MSSQL三种数据源.目前Oracle和MySQL都能调通,在测试MSSQL的过程中,一直报错. 错误如下: 2015-06-03 14:08:45,911 WARN com.atomikos.datasource.xa.XATransactionalResource.logWarning:24 - Error i

服务器-zendstudio 报错:Error Connecting to server

问题描述 zendstudio 报错:Error Connecting to server 今天远程连接服务器的时候,修改了保存的时候报错 Remote System Connection Error Connecting to server ,switch to Manual Mode 这个是怎么回事,怎么解决啊! 解决方案 这些信息恐怕有点少,有Server端的log会比较有帮助.