|
本帖最后由 wyh123 于 2012-3-25 16:52 编辑
我已经编译好了osgOcean,用的是FFTW3-3。自带的oceanExample也可以运行出来效果了:
但是,我自己建立项目的时候却总是说:
我的文件结构是这样的:
osgOceanD.lib就在F:\OSG\osgOcean\build\lib\Debug目录下。
然后,我在vs2008里面已经设置了,VC++的库文件路径:
系统环境变量里path我也加入了F:\OSG\osgOcean\build\bin\Debug;F:\OSG\osgOcean\build\bin\Release
但是还是报不能打开osgOceanD.lib这个错误。这是什么原因:
我自己项目里的测试代码是按照FreeSouth视频教程第66讲里面的程序:
#include <osgViewer/Viewer>
#include <osgDB/ReadFile>
#include <osgGA/TrackballManipulator>
#include <osgOcean/OceanScene>
#include <osgOcean/FFTOceanSurface>
int main()
{
osg::ref_ptr<osgViewer::Viewer> viewer =new osgViewer::Viewer;
viewer->setUpViewInWindow(150,150,1024,768,0);//setUpViewInWindow(150,150,1024,768,0);
osg::ref_ptr<osgOcean::FFTOceanSurface> oceanSurface= new osgOcean::FFTOceanSurface(64,256,17,osg::Vec2(1.1f,1.1f),12.0f,1000.0f,0.8f,1e-8,true,2.5,10.f,256);
osg::ref_ptr<osgOcean::OceanScene> oceanScene=new osgOcean::OceanScene(oceanSurface.get());
viewer->addEventHandler(oceanSurface->getEventHandler());
viewer->addEventHandler(oceanSurface->getEventHandler());
osgGA::TrackballManipulator *tb = new osgGA::TrackballManipulator;
tb->setHomePosition(osg::Vec3f(0.0,0.0f,20.0),osg::Vec3f(0.0f,20.0f,20.0f),osg::Vec3f(0,0,1));
viewer->setCameraManipulator(tb);
viewer->setSceneData(oceanSurface);
viewer->run();
return 0;
}
补充一下:如果我直接把上述代码,复制替换到到osgOcean本身的oceanExample项目的application.cpp中,那就没有任何问题。但是为什么自己新建项目就不行呢?
|
|