Skip to content

Commit

Permalink
Fix debug builds of gz-rendering-ogre2 plugin (gazebosim#1014)
Browse files Browse the repository at this point in the history
The ogre2 plugin fails to load in gz-sim when gz-rendering
is built in Debug mode. The following error message is emitted:
```
Error while loading the library [....lib/gz-rendering-8/engine-plugins/libgz-rendering-ogre2.so]: ....lib/gz-rendering-8/engine-plugins/libgz-rendering-ogre2.so: undefined symbol: _ZThn1008_N4Ogre7HlmsPbs19_changeRenderSystemEPNS_12RenderSystemE
```

This is because we set `DEBUG=1` and `_DEBUG=1`
on the ogre2 target which seem to change the ABI of the generated
library. These defines should really be set if Ogre2 itself is built in
debug mode, so this PR simply comments out the CMake command that adds
those defines.

Signed-off-by: Addisu Z. Taddese <[email protected]>
Signed-off-by: Athena Z <[email protected]>
  • Loading branch information
azeey authored and athenaz2 committed Jul 25, 2024
1 parent 2aeff41 commit 2090d5e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ogre2/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ if (TARGET OpenGL::EGL)
add_definitions(-DHAVE_EGL=1)
endif()

target_compile_definitions(${ogre2_target} PRIVATE $<$<CONFIG:Debug>:DEBUG=1 _DEBUG=1>)
# You might need to uncomment the following `target_compile_definitions`
# if you've built Ogre from source in Debug mode
# https://github.com/OGRECave/ogre-next/blob/003f51a0a90d1cf93fbea3c7302565b07c4f87b0/OgreMain/include/OgrePlatform.h#L350-L372
# target_compile_definitions(${ogre2_target} PRIVATE $<$<CONFIG:Debug>:DEBUG=1 _DEBUG=1>)


set (versioned ${CMAKE_SHARED_LIBRARY_PREFIX}${PROJECT_NAME_LOWER}-${engine_name}${CMAKE_SHARED_LIBRARY_SUFFIX})
Expand Down

0 comments on commit 2090d5e

Please sign in to comment.