[Bug 821] New: RTT_SCRIPTING_API VS RTT_API & boost linking problem

http://bugs.orocos.org/show_bug.cgi?id=821

Summary: RTT_SCRIPTING_API VS RTT_API & boost linking problem
Product: Toolchain
Version: 2.2.1
Platform: Other
OS/Version: Windows
Status: NEW
Severity: critical
Priority: P5
Component: RTT
AssignedTo: orocos-dev [..] ...
ReportedBy: florian [dot] nouviale [..] ...
CC: orocos-dev [..] ...
Estimated Hours: 0.0

Tried to compile rtt 2.2.1 on visual studio 2008 32bit (on windows seven 64bit)
and had to make some changes (only tried Release dynamic build)

In RTT-scripting plugin, there are classes/structs that have RTT_API instead of
RTT_SCRIPTING_API, causing linking problems :

parser-types.hpp l.82
- struct RTT_API eol_skip_functor
+ struct RTT_SCRIPTING_API eol_skip_functor

CommonParser.hpp l.52
- class RTT_API CommonParser
+ class RTT_SCRIPTING_API CommonParser

The check_depend.cmake file also lacks some option to avoid automatic linking
with boost when using it dynamically

l.97

if(Boost_INCLUDE_DIR)
message("Boost found in ${Boost_INCLUDE_DIR}")
list(APPEND OROCOS-RTT_INCLUDE_DIRS ${Boost_INCLUDE_DIR} )
# We don't link with boost here. It depends on the options set by the user.
#list(APPEND OROCOS-RTT_LIBRARIES ${Boost_LIBRARIES} )
+ if(OROCOS_TARGET STREQUAL "win32")
+ add_definitions(-DBOOST_ALL_NO_LIB)
+ endif()
else(Boost_INCLUDE_DIR)
message(FATAL_ERROR "Boost_INCLUDE_DIR not found ! Add it to your
CMAKE_PREFIX_PATH !")
endif(Boost_INCLUDE_DIR)

also note that boost v1.44 (only tested this version) has a bug described here
:
https://svn.boost.org/trac/boost/ticket/4630

[Bug 821] RTT_SCRIPTING_API VS RTT_API & boost linking problem

http://bugs.orocos.org/show_bug.cgi?id=821

Peter Soetens <peter [..] ...> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |peter [..] ...
Resolution| |FIXED

--- Comment #1 from Peter Soetens <peter [..] ...> 2011-02-22 14:02:01 CET ---
(In reply to comment #0)
> Tried to compile rtt 2.2.1 on visual studio 2008 32bit (on windows seven 64bit)
> and had to make some changes (only tried Release dynamic build)
>
> In RTT-scripting plugin, there are classes/structs that have RTT_API instead of
> RTT_SCRIPTING_API, causing linking problems :
>
> parser-types.hpp l.82
> - struct RTT_API eol_skip_functor
> + struct RTT_SCRIPTING_API eol_skip_functor
>
> CommonParser.hpp l.52
> - class RTT_API CommonParser
> + class RTT_SCRIPTING_API CommonParser
>
> The check_depend.cmake file also lacks some option to avoid automatic linking
> with boost when using it dynamically
>
> l.97
>
> if(Boost_INCLUDE_DIR)
> message("Boost found in ${Boost_INCLUDE_DIR}")
> list(APPEND OROCOS-RTT_INCLUDE_DIRS ${Boost_INCLUDE_DIR} )
> # We don't link with boost here. It depends on the options set by the user.
> #list(APPEND OROCOS-RTT_LIBRARIES ${Boost_LIBRARIES} )
> + if(OROCOS_TARGET STREQUAL "win32")
> + add_definitions(-DBOOST_ALL_NO_LIB)
> + endif()
> else(Boost_INCLUDE_DIR)
> message(FATAL_ERROR "Boost_INCLUDE_DIR not found ! Add it to your
> CMAKE_PREFIX_PATH !")
> endif(Boost_INCLUDE_DIR)
>
> also note that boost v1.44 (only tested this version) has a bug described here
> :
> https://svn.boost.org/trac/boost/ticket/4630

Thanks for the update. There has been a large amount of patches on the master
branch to make the build on windows flawlessly. The fixes you propose are also
there. It's not clear how much of that we will back-port to the 2.2.x branches.

2.3.0 will be the best 'Windows hardened' release we have up to now. Also
orocreate-pkg will create a working Visual Studio solution.

Peter