0

CEGUI を試しています。Archlinux のコミュニティ リポジトリから cegui パッケージをインストールしましたが、基本的な hello world をコンパイルできません。

コードは次のとおりです。

#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
4

0 に答える 0