无法编译CEGUI hello world

时间:2016-02-14 16:28:38

标签: c++ cegui

我正在尝试CEGUI,我已经安装了Archlinux社区存储库的cegui包,我无法编译基本的hello世界。

以下是代码:

#include <CEGUI/CEGUI.h>¬                                                       
¬                                                                               
using namespace std;¬                                                           
using namespace CEGUI;¬                                                         
¬                                                                               
int main(int argc, char *argv[]) {¬                                             
    WindowManager& wmgr = WindowManager::getSingleton();¬                       
    Window* myRoot = wmgr.createWindow( "DefaultWindow", "root" );¬             
    System::getSingleton().getDefaultGUIContext().setRootWindow( myRoot );¬     
    FrameWindow* fWnd = static_cast<FrameWindow*>(¬                             
    ¦   ¦   ¦   wmgr.createWindow( "TaharezLook/FrameWindow", "testWindow" ));¬ 
    myRoot->addChild( fWnd );¬                                                  
    // position a quarter of the way in from the top-left of parent.¬           
    fWnd->setPosition( UVector2( UDim( 0.25f, 0.0f ), UDim( 0.25f, 0.0f ) ) );¬ 
    // set size to be half the size of the parent¬                              
    fWnd->setSize( USize( UDim( 0.5f, 0.0f ), UDim( 0.5f, 0.0f ) ) );¬          
    fWnd->setText( "Hello World!" );¬                                           
}¬                                                                              

我使用g++ -o hello hello.cpp编译,我收到此消息:

/tmp/ccI1uy5I.o: In function `main':
hello.cpp:(.text+0x63): undefined reference to `CEGUI::WindowManager::createWindow(CEGUI::String const&, CEGUI::String const&)'
hello.cpp:(.text+0x76): undefined reference to `CEGUI::String::~String()'
hello.cpp:(.text+0x85): undefined reference to `CEGUI::String::~String()'
hello.cpp:(.text+0x8a): undefined reference to `CEGUI::System::getSingleton()'
hello.cpp:(.text+0x92): undefined reference to `CEGUI::System::getDefaultGUIContext() const'
hello.cpp:(.text+0xa4): undefined reference to `CEGUI::GUIContext::setRootWindow(CEGUI::Window*)'
hello.cpp:(.text+0xe9): undefined reference to `CEGUI::WindowManager::createWindow(CEGUI::String const&, CEGUI::String const&)'
hello.cpp:(.text+0xfc): undefined reference to `CEGUI::String::~String()'
hello.cpp:(.text+0x10b): undefined reference to `CEGUI::String::~String()'
hello.cpp:(.text+0x11e): undefined reference to `CEGUI::Element::addChild(CEGUI::Element*)'
hello.cpp:(.text+0x220): undefined reference to `CEGUI::Window::setText(CEGUI::String const&)'
hello.cpp:(.text+0x22f): undefined reference to `CEGUI::String::~String()'
hello.cpp:(.text+0x248): undefined reference to `CEGUI::String::~String()'
hello.cpp:(.text+0x25c): undefined reference to `CEGUI::String::~String()'
hello.cpp:(.text+0x279): undefined reference to `CEGUI::String::~String()'
hello.cpp:(.text+0x28d): undefined reference to `CEGUI::String::~String()'
/tmp/ccI1uy5I.o:hello.cpp:(.text+0x2aa): more undefined references to `CEGUI::String::~String()' follow
/tmp/ccI1uy5I.o: In function `CEGUI::String::assign(char const*, unsigned long)':
hello.cpp:(.text._ZN5CEGUI6String6assignEPKcm[_ZN5CEGUI6String6assignEPKcm]+0x23): undefined reference to `CEGUI::String::grow(unsigned long)'
/tmp/ccI1uy5I.o: In function `CEGUI::Singleton<CEGUI::WindowManager>::getSingleton()':
hello.cpp:(.text._ZN5CEGUI9SingletonINS_13WindowManagerEE12getSingletonEv[_ZN5CEGUI9SingletonINS_13WindowManagerEE12getSingletonEv]+0x7): undefined reference to `CEGUI::Singleton<CEGUI::WindowManager>::ms_Singleton'
hello.cpp:(.text._ZN5CEGUI9SingletonINS_13WindowManagerEE12getSingletonEv[_ZN5CEGUI9SingletonINS_13WindowManagerEE12getSingletonEv]+0x2c): undefined reference to `CEGUI::Singleton<CEGUI::WindowManager>::ms_Singleton'
collect2: error: ld returned 1 exit status

0 个答案:

没有答案