CEGUI 0.8 CMake files do not link to the required window libraries with the OpenGL renderer target

Issue #1136 new
Ryan Gonzalez
created an issue

This took me a good half-hour to figure out...

I've been trying to get CEGUI 0.8 on Elementary OS in order to build TSC. Unfortunately, I couldn't find a single .deb package that provided the OpenGL RendererTarget headers. SO, I ended up trying to build CEGUI myself.

It worked...mostly. I ended up greeted with a host of linker errors, all related to X11.

Short version:

CEGUI attempts to link with just GLEW, but, on Linux systems, it also needs to link the X11 libraries. I had to patch cegui/src/RendererModules/OpenGL/CMakeLists.txt and add the following line to the end:

cegui_target_link_libraries(${CEGUI_TARGET_NAME} ${CEGUI_BASE_LIBNAME} X11 Xcursor Xrandr Xi Xinerama Xxf86vm pthread)

This is probably related to this closed bug in cocos2d-x. The solution?

I guess maybe FindX11 should be used to locate X11, and then link with the libraries I showed above. pthread needs to also be linked.

Since I should probably follow the template anyway:

Operating System: Elementary OS (64-bit) OS version/build: Freya

Reproducibility: Always

Reproduction steps:

  1. Use a recent version of CMake to build CEGUI on Linux WITH the OpenGL renderer target. Something like cmake ... -DCEGUI_BUILD_RENDERER_OPENGL=1.
  2. insert cool joke here

Comments (7)

  1. Ryan Gonzalez reporter

    On my system, GLEW is installed as a shared library. I actually used Ninja to build; my CMake command was:

    # Within the CEGUI source directory
    mkdir build
    cmake .. -G Ninja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -DCEGUI_BUILD_RENDERER_OPENGL=1
    

    Here's the output:

    http://termbin.com/g5sy

    As for the log, I'm using Ninja to build, so I ran ninja -v:

    http://termbin.com/4cir

    (Note that the linker error is a bit above the bottom; since Ninja builds in parallel, it had started to build something else when the error occurred. Just do a Ctrl+F for "DSO".)

  2. Yaron Cohen-Tal

    There r known problems building cegui with static dependencies, I work on it.

    In the mean time, plz use a shared GLFW or disable building the cegui samples. Certainly don't apply the changes as you've done, coz cegui itself certainly doesn't depend on the X window system.

  3. Yaron Cohen-Tal

    Also note that a ".deb" prolly wouldn't help u coz u use clang and linking a C++ library built with one compiler to a project built with another compiler often creates problems due to different name mangling schemes.

  4. Log in to comment