osg在VC++中哪个工程中运行?

来源:百度知道 编辑:UC知道 时间:2024/06/23 16:51:09
openscenegraph软件在VC++中哪个工程下运行?MFC?还是控制台?在windows32 Application 中他提示找不到'osgViewer/Viewer': No such file or directory
Error executing cl.exe.
以下是程序段,建在win32 application下的,其他的运行也出现这个问题,不知为什么,请高手给些指导,急需。20分!!!
#include "stdafx.h"
#include <osgViewer/Viewer>
#include <osgDB/ReadFile>
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.

int main( int, char ** )
{

osgViewer::Viewer viewer;

viewer.setSceneData( osgDB::readNodeFile( "cow.osg" ) );

return viewer.run();

}

return 0;
}

你在学VR么?
应该用VC++的WIN32项目,而且把OSG放在visual studio平台上,还得设置一些输入输出属性,引用的库文件,而且看你的OSG版本是什么,可能你上面写的那些语句运行的时候也会出问题。OSG比较成熟的版本是1.2的,我现在用的就是这个。