The problem that I have come to, after many hours, is that I can't seem to figure out how to link to the Irrlicht library. Any pointers?
One of my current CMakeLists.txt looks like the following:
Code: Select all
find_package( SDL REQUIRED
SDL_net REQUIRED
SDL_sound REQUIRED
OpenGL REQUIRED
PNG REQUIRED
JPEG REQUIRED
)
if ( NOT SDL_FOUND )
message ( SEND_ERROR "SDL not found!" )
endif ( NOT SDL_FOUND )
if ( NOT SDLNET_FOUND )
message ( STATUS "SDLNET not found!" )
endif ( NOT SDLNET_FOUND )
if ( NOT SDL_SOUND_FOUND )
message ( STATUS "SDL_SOUND not found!" )
endif ( NOT SDL_SOUND_FOUND )
include_directories(include/ ${SDL_INCLUDE_DIR} /usr/include/irrlicht/)
link_libraries(
${SDL_LIBRARY}
${SDLNET_LIBRARY}
${SDL_SOUND_LIBRARIES}
${OPENGL_LIBRARY}
${PNG_LIBRARY}
${JPEG_LIBRARY}
SDLmain
Irrlicht
)
set(sourcefiles
ammo.cpp
audio.cpp
.
.
shot.cpp
)
add_executable(subspacebattle ${sourcefiles})
install_programs(/bin subspacebattle)
Code: Select all
/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.3/../../../../lib64/libIrrlicht.a(CIrrDeviceLinux.o): In function `irr::CIrrDeviceLinux::setResizeAble(bool)':
(.text+0xbf): undefined reference to `XUnmapWindow'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.3/../../../../lib64/libIrrlicht.a(CIrrDeviceLinux.o): In function `irr::CIrrDeviceLinux::setResizeAble(bool)':
(.text+0xc8): undefined reference to `XAllocSizeHints'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.3/../../../../lib64/libIrrlicht.a(CIrrDeviceLinux.o): In function `irr::CIrrDeviceLinux::setResizeAble(bool)':
(.text+0x106): undefined reference to `XSetWMNormalHints'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.3/../../../../lib64/libIrrlicht.a(CIrrDeviceLinux.o): In function `irr::CIrrDeviceLinux::setResizeAble(bool)':
(.text+0x10e): undefined reference to `XFree'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.3/../../../../lib64/libIrrlicht.a(CIrrDeviceLinux.o): In function `irr::CIrrDeviceLinux::setResizeAble(bool)':
(.text+0x121): undefined reference to `XMapWindow'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.3/../../../../lib64/libIrrlicht.a(CIrrDeviceLinux.o): In function `irr::CIrrDeviceLinux::setResizeAble(bool)':
(.text+0x156): undefined reference to `XSetWMNormalHints'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.3/../../../../lib64/libIrrlicht.a(CIrrDeviceLinux.o): In function `irr::CIrrDeviceLinux::present(irr::video::IImage*, int, irr::core::rect<int>*)':
(.text+0x371): undefined reference to `XPutImage'
.
.