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

Fails to build on Windows: missing header? #48

Open
gonzalocasas opened this issue Apr 6, 2021 · 0 comments
Open

Fails to build on Windows: missing header? #48

gonzalocasas opened this issue Apr 6, 2021 · 0 comments

Comments

@gonzalocasas
Copy link

I'm reporting this here as a follow up of RoboStack/ros-noetic#88.
I was testing ros-noetic on Windows 10 using the conda packages provided by RoboStack. Everything worked out just fine with the base installs. Afterwards, I tried to create a catkin ws and build it, but I got an error that apparently is rooted in a missing header in https://github.com/ros/rosconsole/blob/noetic-devel/include/ros/console.h

The package I tried to build on my catkin workspace is https://github.com/gramaziokohler/ros_file_server. It's really minimal and it is the only one in my catkin workspace. The error I get when I run catkin_make is:

[ 90%] Building CXX object ros_file_server/CMakeFiles/file_server.dir/src/file_server.cpp.obj
file_server.cpp
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include\xlocale(319): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc
C:\Users\gcasas\anaconda3\envs\ros\Library\include\ros/console.h(126): error C2039: 'shared_ptr': is not a member of 'boost'
C:\Users\gcasas\anaconda3\envs\ros\Library\include\ros/console.h(71): note: see declaration of 'boost'
C:\Users\gcasas\anaconda3\envs\ros\Library\include\ros/console.h(126): error C2143: syntax error: missing ';' before '<'
C:\Users\gcasas\anaconda3\envs\ros\Library\include\ros/console.h(126): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Users\gcasas\anaconda3\envs\ros\Library\include\ros/console.h(127): error C2065: 'TokenPtr': undeclared identifier
C:\Users\gcasas\anaconda3\envs\ros\Library\include\ros/console.h(127): error C2923: 'std::vector': 'TokenPtr' is not a valid template type argument for parameter '_Ty'
C:\Users\gcasas\anaconda3\envs\ros\Library\include\ros/console.h(127): error C3203: 'allocator': unspecialized class template can't be used as a template argument for template parameter '_Alloc', expected a real type
C:\Users\gcasas\anaconda3\envs\ros\Library\include\boost/bind.hpp(41): note: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.
NMAKE : fatal error U1077: 'C:\PROGRA~2\MIB055~1\2017\COMMUN~1\VC\Tools\MSVC\1416~1.270\bin\Hostx64\x64\cl.exe' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.
Invoking "nmake" failed

I was able to workaround the problem adding boost's headers as recommended on the original thread RoboStack/ros-noetic#88 (comment) but I guess that's not a proper fix because the same package builds without issues on Linux:

#include <boost/shared_ptr.hpp>

namespace boost {
#ifdef BOOST_NO_EXCEPTIONS
void throw_exception( std::exception const & e ) { throw 11; };
#endif
}
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

No branches or pull requests

1 participant