Tag Archives: linux

libGL.so compil problem

From time to time, on my ubuntu 11.10, i have link error like “undefined reference to glGetQueryObjectui64v”.
This is because an unidentify package update break libGL.so symlink in
/usr/lib or /usr/lib/x86_64-linux-gnu

The best solution I found is to manually
“sudo rm libGL.so libGL.so.1”
and to “ln -s nvidia-current/libGL.so .” in usr/lib
and “ln -s ../libGL.so .” in /usr/lib/x86_64-linux-gnu
and so on with libGL.so.1 if needed ..

Release and Debug with Cmake and QtCreator

I have used qmake for a while and the debug_and_release facilities to have both debug and release version of my code (with different executable, different build tress …)
Now I use cmake and qtcreator on a regular basis, to obtain the same behavior I have found the following approach :

in my CMakeLists.txtm something like

if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib-debug)
set(LIB_INSTALL_DIR ${CMAKE_SOURCE_DIR}/lib-debug)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin-dbg)
else()
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib)
set(LIB_INSTALL_DIR ${CMAKE_SOURCE_DIR}/lib)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/bin)
endif()

in QtCreator :
First time you open a CMakeLists.txt, simply choose a build dir (some thing like XXX/qtcreator-build) and run cmake,
then go to Tab projects->edit build configuration -> add -> clone selected
Chage build dir (something like XXX/qtcreator-build-dbg) and click “Run cmake”
In the Arguments edit line enter -DCMAKE_BUILD_TYPE=Debug
You can check that in run settings, working directory has changed to the new bin-dbg directory …