查看: 2359|回复: 3

海军06,问题

[复制链接]

该用户从未签到

发表于 2009-1-7 13:55:28 | 显示全部楼层 |阅读模式
//  [1/7/2009 Unreal]
#include <osg/ref_ptr>
#include <osg/Group>
#include <osgViewer/Viewer>
#include <iostream>
//-----------------------------------------------------------------------------------------
#include <osg/Node>
#include <osg/PositionAttitudeTransform>
#include <osgText/Text>
#include <osgText/Font>
//-----------------------------------------------------------------------------------------

//-----------------------------------------------------------------------------------------

using namespace osg;

int main(int argc, char** argv)
{
        Group* root = NULL;

        //需要  #include <osg/Node>
        Node* tankNode = NULL;

        //需要  #include <osg/PositionAttitudeTransform>
        PositionAttitudeTransform* tankXform;

        //HUD几何体叶子节点
        Geode* HUDGeode = new Geode();

        //用于作HUD显示的Text实例
        //需要  #include <osgText/Text>
        osgText::Text* textOne = new osgText::Text();

        //这个文字实例将跟随坦克显示
        //osgText::Text* tankLabel = new osgText::Text();

        //投影节点用于定义HUD的视景体(view frustrum)
        //Projection* HUDProjectionMatrix = new Projection();

        //osg::ref_ptr<osg::Group> root = new osg::Group;

        //osgViewer::Viewer viewer;
        //viewer.setSceneData( root.get() );

        //return viewer.run();
}
用了上面的代码,但是却编译不同,提示了如下的问题.应该是osgText::Text时出现的问题,请大家帮帮忙~



1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall osgText::Text::Text(void)" (__imp_??0Text@osgText@@QAE@XZ) referenced in function _main
1>main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall osgText::Text::setThreadSafeRefUnref(bool)" (?setThreadSafeRefUnref@Text@osgText@@UAEX_N@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual class osg::Object * __thiscall osgText::Text::cloneType(void)const " (?cloneType@Text@osgText@@UBEPAVObject@osg@@XZ)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual class osg::Object * __thiscall osgText::Text::clone(class osg::CopyOp const &)const " (?clone@Text@osgText@@UBEPAVObject@osg@@ABVCopyOp@4@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall osgText::Text::isSameKindAs(class osg::Object const *)const " (?isSameKindAs@Text@osgText@@UBE_NPBVObject@osg@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual char const * __thiscall osgText::Text::libraryName(void)const " (?libraryName@Text@osgText@@UBEPBDXZ)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual char const * __thiscall osgText::Text::className(void)const " (?className@Text@osgText@@UBEPBDXZ)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall osgText::Text::resizeGLObjectBuffers(unsigned int)" (?resizeGLObjectBuffers@Text@osgText@@UAEXI@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall osgText::Text::releaseGLObjects(class osg::State *)const " (?releaseGLObjects@Text@osgText@@UBEXPAVState@osg@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual class osg::BoundingBox __thiscall osgText::TextBase::computeBound(void)const " (?computeBound@TextBase@osgText@@UBE?AVBoundingBox@osg@@XZ)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall osgText::Text::drawImplementation(class osg::RenderInfo &)const " (?drawImplementation@Text@osgText@@UBEXAAVRenderInfo@osg@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall osgText::Text::supports(class osg:rimitiveFunctor const &)const " (?supports@Text@osgText@@UBE_NABVPrimitiveFunctor@osg@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall osgText::Text::supports(class osg:rawable::ConstAttributeFunctor const &)const " (?supports@Text@osgText@@UBE_NABVConstAttributeFunctor@Drawable@osg@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall osgText::Text::supports(class osg::Drawable::AttributeFunctor const &)const " (?supports@Text@osgText@@UBE_NABVAttributeFunctor@Drawable@osg@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall osgText::Text::accept(class osg::PrimitiveFunctor &)const " (?accept@Text@osgText@@UBEXAAVPrimitiveFunctor@osg@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall osgText::Text::accept(class osg::Drawable::ConstAttributeFunctor &)const " (?accept@Text@osgText@@UBEXAAVConstAttributeFunctor@Drawable@osg@@@Z)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall osgText::Text::computePositions(unsigned int)const " (?computePositions@Text@osgText@@MBEXI@Z)
1>main.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall osgText::Text::computeGlyphRepresentation(void)" (?computeGlyphRepresentation@Text@osgText@@MAEXXZ)
1>main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) protected: virtual __thiscall osgText::Text::~Text(void)" (__imp_??1Text@osgText@@MAE@XZ) referenced in function "protected: virtual void * __thiscall osgText::Text::`scalar deleting destructor'(unsigned int)" (??_GText@osgText@@MAEPAXI@Z)

该用户从未签到

发表于 2009-1-7 16:26:04 | 显示全部楼层
您的工程依赖库设置里面添加 osgText.lib 了吗?

该用户从未签到

 楼主| 发表于 2009-1-10 15:50:31 | 显示全部楼层
谢谢您那么及时的回复了我的提问,但是我因为要住在奶奶家,照顾她,所以每个礼拜只有两天我能回家来上网.
所以,很抱歉现在才来应答.真是不好意思~
恩,我加上了osgText.lib后,就好了~谢谢您的提示~

该用户从未签到

发表于 2009-1-10 22:32:25 | 显示全部楼层
不用那么客气,家庭永远是第一位的~~
您需要登录后才可以回帖 登录 | 注册

本版积分规则

OSG中国官方论坛-有您OSG在中国才更好

网站简介:osgChina是国内首个三维相关技术开源社区,旨在为国内更多的技术开发人员提供最前沿的技术资讯,为更多的三维从业者提供一个学习、交流的技术平台。

联系我们

  • 工作时间:09:00--18:00
  • 反馈邮箱:1315785073@qq.com
快速回复 返回顶部 返回列表