|
我用的是OpenSceneGraph 2.2 ,安装步骤是osgchina所推荐的:
mkdir build_OpenThreads
cd build_OpenThreads
ccmake ../OpenThreads
make
sudo make install
cd ..
mkdir build_OpenSceneGraph
cd build_OpenSceneGraph
ccmake ../OpenSceneGraph
make
sudo make install
cd ..
export OSG_FILE_PATH=/home/liu/OpenSceneGraph-Data
我从网上抄下了一段小程序:- #include <osgViewer/Viewer>
- #include <osgDB/ReadFile>
- int main( int, char ** )
- {
- osgViewer::Viewer viewer;
- viewer.setSceneData( osgDB::readNodeFile( "cow.osg" ) );
- return viewer.run();
- }
复制代码 可是编译时提示:
cd '/home/liu/MyProjects/temp/debug' && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" make -k
make all-recursive
Making all in src
linking temp (g++)
linking temp (g++)
temp.o: In function `main':
/home/liu/MyProjects/temp/src/temp.cpp:
26: undefined reference to `osgViewer::Viewer::Viewer()'
/home/liu/MyProjects/temp/src/temp.cpp:27: undefined reference to `osgViewer::Viewer::setSceneData(osg::Node*)'
/home/liu/MyProjects/temp/src/temp.cpp:28: undefined reference to `osgViewer::Viewer::run()'
/home/liu/MyProjects/temp/src/temp.cpp:28: undefined reference to `osgViewer::Viewer::~Viewer()'
/home/liu/MyProjects/temp/src/temp.cpp:28: undefined reference to `osgViewer::Viewer::~Viewer()'
temp.o: In function `osgDB::readNodeFile(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
/usr/local/include/osgDB/ReadFile:107: undefined reference to `osgDB::Registry::instance(bool)'
/usr/local/include/osgDB/ReadFile:107: undefined reference to `osgDB::readNodeFile(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, osgDB::ReaderWriter::Options const*)'
请问,这是怎么回事?
谢谢。
忘记说了,我用的是ubuntu 7.10。 |
|