Skip to content

Instantly share code, notes, and snippets.

@traversaro
Created January 2, 2019 23:15
Show Gist options
  • Save traversaro/8b47312cb53a1228aa59ead900522c17 to your computer and use it in GitHub Desktop.
Save traversaro/8b47312cb53a1228aa59ead900522c17 to your computer and use it in GitHub Desktop.
Gazebo on Windows compilation error
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
find_package(gazebo REQUIRED)
include_directories(${GAZEBO_INCLUDE_DIRS})
link_directories(${GAZEBO_LIBRARY_DIRS})
list(APPEND CMAKE_CXX_FLAGS "${GAZEBO_CXX_FLAGS}")
add_library(hello_world SHARED hello_world.cc)
# Uncomment the next two lines for a workaround to the problem
# find_package(OGRE REQUIRED CONFIG)
# target_include_directories(hello_world PUBLIC ${OGRE_Paging_INCLUDE_DIRS})
target_link_libraries(hello_world ${GAZEBO_LIBRARIES})
# Definitions necessary to correctly compile the plugin including Gazebo headers
target_compile_definitions(hello_world PUBLIC NOMINMAX WIN32_LEAN_AND_MEAN _USE_MATH_DEFINES)
#include <gazebo/gazebo.hh>
#include <gazebo/rendering/Camera.hh>
namespace gazebo
{
class WorldPluginTutorial : public WorldPlugin
{
public: WorldPluginTutorial() : WorldPlugin()
{
printf("Hello World!\n");
}
public: void Load(physics::WorldPtr _world, sdf::ElementPtr _sdf)
{
}
};
GZ_REGISTER_WORLD_PLUGIN(WorldPluginTutorial)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment