Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flatland fails to build in ROS Noetic #316

Open
Educorreia932 opened this issue Oct 11, 2023 · 3 comments
Open

flatland fails to build in ROS Noetic #316

Educorreia932 opened this issue Oct 11, 2023 · 3 comments

Comments

@Educorreia932
Copy link

Educorreia932 commented Oct 11, 2023

Trying to use ros-noetic-flatland package results in the following error:

error: builder for '/nix/store/qmsv1gf5ahjrgliwljjg8cdb6074bdn5-ros-noetic-flatland-msgs-1.3.3-r1.drv' failed with exit code 1;
       last 10 log lines:
       > -- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
       > CMake Error at /nix/store/wjbqjwmnbi24qsvfh589my84fjr8wa3l-cmake-3.26.4/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
       >   Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)
       > Call Stack (most recent call first):
       >   /nix/store/wjbqjwmnbi24qsvfh589my84fjr8wa3l-cmake-3.26.4/share/cmake-3.26/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
       >   /nix/store/wjbqjwmnbi24qsvfh589my84fjr8wa3l-cmake-3.26.4/share/cmake-3.26/Modules/FindPkgConfig.cmake:99 (find_package_handle_standard_args)
       >   CMakeLists.txt:17 (find_package)
@Educorreia932
Copy link
Author

Educorreia932 commented Oct 11, 2023

I have managed to fix the problem with flatland-msgs by adding pkg-config to its nativeBuildInputs, but now there are some problems with flatland-server related with the linkage of the Lua library:

error: builder for '/nix/store/7calkac1wqyph5dfz9gmsh5rdglccp8b-ros-noetic-flatland-server-1.3.3-r1.drv' failed with exit code 2;
       last 10 log lines:
       
> /nix/store/74y3751gsixaz9797ib0hp7c658sp1y5-binutils-2.40/bin/ld: devel/lib/libflatland_lib.so: undefined reference to `luaL_openlibs(lua_State*)'
> /nix/store/74y3751gsixaz9797ib0hp7c658sp1y5-binutils-2.40/bin/ld: devel/lib/libflatland_lib.so: undefined reference to `lua_pushboolean(lua_State*, int)'
> /nix/store/74y3751gsixaz9797ib0hp7c658sp1y5-binutils-2.40/bin/ld: devel/lib/libflatland_lib.so: undefined reference to `lua_pcallk(lua_State*, int, int, int, int, int (*)(lua_State*))'
> /nix/store/74y3751gsixaz9797ib0hp7c658sp1y5-binutils-2.40/bin/ld: devel/lib/libflatland_lib.so: undefined reference to `lua_isstring(lua_State*, int)'
> /nix/store/74y3751gsixaz9797ib0hp7c658sp1y5-binutils-2.40/bin/ld: devel/lib/libflatland_lib.so: undefined reference to `lua_pushstring(lua_State*, char const*)'
> /nix/store/74y3751gsixaz9797ib0hp7c658sp1y5-binutils-2.40/bin/ld: devel/lib/libflatland_lib.so: undefined reference to `lua_settop(lua_State*, int)'

@Educorreia932
Copy link
Author

Educorreia932 commented Oct 15, 2023

In the end, this was due to the fact that Lua was compiled to C, instead of C++.
To fix this, without having to recompile Lua, it's possible to encapsulate the Lua related #include statements (present in yaml_preprocessor.h file) with extern "C", as in this Stack Overflow answer.

@Educorreia932 Educorreia932 changed the title flatland-server fails to build in ROS Iron flatland-server fails to build in ROS Noetic Oct 15, 2023
@Educorreia932 Educorreia932 changed the title flatland-server fails to build in ROS Noetic flatland fails to build in ROS Noetic Oct 15, 2023
@Educorreia932
Copy link
Author

After making all the necessary changes, I've managed to successfully launch flatland_server #320

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant