Index: trunk/cmake-modules/FlairUseFile.cmake
===================================================================
--- trunk/cmake-modules/FlairUseFile.cmake	(revision 364)
+++ trunk/cmake-modules/FlairUseFile.cmake	(revision 365)
@@ -102,5 +102,5 @@
 	IF (FLAIR_USE_SIMULATOR_GL)
 		ADD_DEFINITIONS("-DGL")
-		SET(FLAIR_LIBRARIES ${FLAIR_LIBRARY_DIR}/libFlairSimulator_gl.a GL ${FLAIR_LIBRARIES} Irrlicht Xxf86vm)
+		SET(FLAIR_LIBRARIES ${FLAIR_LIBRARY_DIR}/libFlairSimulator_gl.a GL ${FLAIR_LIBRARIES} Irrlicht)
 	else()
 		SET(FLAIR_LIBRARIES ${FLAIR_LIBRARY_DIR}/libFlairSimulator_nogl.a ${FLAIR_LIBRARIES})
Index: trunk/cmake-modules/GlobalCmakeFlair.cmake
===================================================================
--- trunk/cmake-modules/GlobalCmakeFlair.cmake	(revision 364)
+++ trunk/cmake-modules/GlobalCmakeFlair.cmake	(revision 365)
@@ -151,4 +151,34 @@
         endforeach()
     endif()
+
+endfunction()
+
+#create a demo using host cxx and libs
+#usefull for simulator app when there are graphical lib incompatibilities (eg log2@glibc_2.29)
+function(FLAIR_DEMO_HOST_CXX PROJECT_NAME SRC_FILES)
+    
+    set(CMAKE_CXX_FLAGS "" PARENT_SCOPE)
+    set(CMAKE_CXX_COMPILER "g++" PARENT_SCOPE)
+    set(CMAKE_CXX_LINK_FLAGS "-Wl,-unresolved-symbols=ignore-in-shared-libs -Wl,-rpath=/home/gsanahuj/flair/flair-install/lib/${ARCH_DIR}/ -Wl,--disable-new-dtags" PARENT_SCOPE)
+    ADD_DEFINITIONS("-D_GLIBCXX_USE_CXX11_ABI=0")
+
+    set(LIB_LIST libudt libvrpn libFileLib libIrrlicht libquat)
+
+    foreach(LIB_NAME IN LISTS LIB_LIST) #all libs
+        FILE(GLOB LIB_FILES "${CMAKE_SYSROOT}/usr/lib/${LIB_NAME}*")
+        foreach(item IN LISTS LIB_FILES) #all files and symlinks of a lib
+            get_filename_component(filename ${item} NAME)              
+            INSTALL(CODE "
+                    if (NOT EXISTS \"$ENV{FLAIR_ROOT}/flair-install/lib/${ARCH_DIR}/${filename}\")
+                        file(INSTALL \"${item}\" DESTINATION \"$ENV{FLAIR_ROOT}/flair-install/lib/${ARCH_DIR}\" USE_SOURCE_PERMISSIONS)
+                    else()
+                        message(\"-- Not installing \" $ENV{FLAIR_ROOT} \"/flair-install/lib/\" ${ARCH_DIR} \"/\" ${filename} \" (file already exists)\")
+                    endif()
+                ")
+              
+        endforeach()
+    endforeach()
+
+    FLAIR_DEMO(${ARGV})
 
 endfunction()
Index: trunk/demos/CircleFollower/simulator/CMakeLists.txt
===================================================================
--- trunk/demos/CircleFollower/simulator/CMakeLists.txt	(revision 364)
+++ trunk/demos/CircleFollower/simulator/CMakeLists.txt	(revision 365)
@@ -11,5 +11,5 @@
 )
 
-FLAIR_DEMO(${PROJECT_NAME} "${SRC_FILES}"
+FLAIR_DEMO_HOST_CXX(${PROJECT_NAME} "${SRC_FILES}"
            DEST_DIR CircleFollower
            COPY_RESOURCES
Index: trunk/demos/Gps/simulator/CMakeLists.txt
===================================================================
--- trunk/demos/Gps/simulator/CMakeLists.txt	(revision 364)
+++ trunk/demos/Gps/simulator/CMakeLists.txt	(revision 365)
@@ -11,5 +11,5 @@
 )
 
-FLAIR_DEMO(${PROJECT_NAME} "${SRC_FILES}"
+FLAIR_DEMO_HOST_CXX(${PROJECT_NAME} "${SRC_FILES}"
            DEST_DIR Gps
            COPY_RESOURCES
Index: trunk/demos/MixedReality/real/simulator/CMakeLists.txt
===================================================================
--- trunk/demos/MixedReality/real/simulator/CMakeLists.txt	(revision 364)
+++ trunk/demos/MixedReality/real/simulator/CMakeLists.txt	(revision 365)
@@ -13,5 +13,5 @@
 )
 
-FLAIR_DEMO(${PROJECT_NAME} "${SRC_FILES}"
+FLAIR_DEMO_HOST_CXX(${PROJECT_NAME} "${SRC_FILES}"
            DEST_DIR MixedReality_real
            COPY_RESOURCES
Index: trunk/demos/MixedReality/virtual/simulator/CMakeLists.txt
===================================================================
--- trunk/demos/MixedReality/virtual/simulator/CMakeLists.txt	(revision 364)
+++ trunk/demos/MixedReality/virtual/simulator/CMakeLists.txt	(revision 365)
@@ -14,5 +14,5 @@
 )
 
-FLAIR_DEMO(${PROJECT_NAME} "${SRC_FILES}"
+FLAIR_DEMO_HOST_CXX(${PROJECT_NAME} "${SRC_FILES}"
            DEST_DIR MixedReality_virtual
            COPY_RESOURCES
Index: trunk/demos/OpticalFlow/simulator/CMakeLists.txt
===================================================================
--- trunk/demos/OpticalFlow/simulator/CMakeLists.txt	(revision 364)
+++ trunk/demos/OpticalFlow/simulator/CMakeLists.txt	(revision 365)
@@ -11,5 +11,5 @@
 )
 
-FLAIR_DEMO(${PROJECT_NAME} "${SRC_FILES}"
+FLAIR_DEMO_HOST_CXX(${PROJECT_NAME} "${SRC_FILES}"
            DEST_DIR OpticalFlow
            COPY_RESOURCES
Index: trunk/demos/PidStandalone/simulator/CMakeLists.txt
===================================================================
--- trunk/demos/PidStandalone/simulator/CMakeLists.txt	(revision 364)
+++ trunk/demos/PidStandalone/simulator/CMakeLists.txt	(revision 365)
@@ -11,5 +11,5 @@
 )
 
-FLAIR_DEMO(${PROJECT_NAME} "${SRC_FILES}"
+FLAIR_DEMO_HOST_CXX(${PROJECT_NAME} "${SRC_FILES}"
            DEST_DIR PidStandalone
            COPY_RESOURCES
Index: trunk/demos/SimpleFleet/simulator/CMakeLists.txt
===================================================================
--- trunk/demos/SimpleFleet/simulator/CMakeLists.txt	(revision 364)
+++ trunk/demos/SimpleFleet/simulator/CMakeLists.txt	(revision 365)
@@ -11,5 +11,5 @@
 )
 
-FLAIR_DEMO(${PROJECT_NAME} "${SRC_FILES}"
+FLAIR_DEMO_HOST_CXX(${PROJECT_NAME} "${SRC_FILES}"
            DEST_DIR SimpleFleet
            COPY_RESOURCES
Index: trunk/lib/FlairSimulator/src/Gui_impl.cpp
===================================================================
--- trunk/lib/FlairSimulator/src/Gui_impl.cpp	(revision 364)
+++ trunk/lib/FlairSimulator/src/Gui_impl.cpp	(revision 365)
@@ -85,6 +85,6 @@
   this->scene_height = scene_height;
 
-  device = createDevice(driver_type, dimension2d<u32>(app_width, app_height),
-                        16, false, false, false);
+  device = createDevice(driver_type, dimension2d<u32>(app_width, app_height),16, false, false, false);
+  if(device==NULL) self->Err("Irrlicht failed to create video device\n");
   receiver = new MyEventReceiver();
   device->setEventReceiver(receiver);
Index: trunk/scripts/distribution_specific_hack.sh
===================================================================
--- trunk/scripts/distribution_specific_hack.sh	(revision 364)
+++ trunk/scripts/distribution_specific_hack.sh	(revision 365)
@@ -26,5 +26,9 @@
 fi
 
-if [ _$DISTRIB_ID = _Ubuntu ]; then
+#also needed in mint, but for different reason?
+#if not in sudo in mint, simlator does not work cause of:
+#libGL: MESA-LOADER: failed to open /usr/lib/x86_64-linux-gnu/dri/iris_dri.so: /usr/lib/x86_64-linux-gnu/dri/iris_dri.so: failed to map segment from shared object
+
+#if [ _$DISTRIB_ID = _Ubuntu ]; then
   #tested on Ubuntu 17.10
   #we must run as root
@@ -38,5 +42,5 @@
   fi
 
-fi
+#fi
 
 #special actions if we use 3D
Index: trunk/tools/FlairGCS/CMakeLists.txt
===================================================================
--- trunk/tools/FlairGCS/CMakeLists.txt	(revision 364)
+++ trunk/tools/FlairGCS/CMakeLists.txt	(revision 365)
@@ -74,5 +74,5 @@
 SET(SRC_FILES ${PROJECT_SOURCE_FILES} ${MOC_SOURCES} ${RCC_SOURCES})
 FLAIR_NRT_TOOL(${PROJECT_NAME} "${SRC_FILES}" COPY_RESOURCES)
-TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${QT_LIBRARIES} GL qwt QwtDataViewer udt QtLocation FileLib z)
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${QT_LIBRARIES} qwt QwtDataViewer udt QtLocation FileLib z)
 
 
