RTT 2.0.0 MinGW build issues

Hello,

I tried to build RTT 2.0.0 with MinGW on a WindowsXP machine an stumbled across some build issues (MinGW GCC 4.5.0, Boost 1.43). I fixed these issues with some quick and dirty hacks and managed to build RTT 2.0.0. The following issues occured (I copied the error output followed by my fix):

1. Issue) --------------------------------------------------------------->

In file included from C:\CodingXP\Sources & Projects\orocos\orocos-toolchain-2.0.0\rtt\rtt\extras  \dev\DigitalInInterface.hpp:42:0,
                 from C:\CodingXP\Sources & Projects\orocos\orocos-toolchain-2.0.0\rtt\rtt\extras\dev\DigitalInput.hpp:41,
                 from C:\CodingXP\Sources & Projects\orocos\orocos-toolchain-2.0.0\rtt\rtt\extras\dev\AxisInterface.hpp:31,
                 from C:\CodingXP\Sources & Projects\orocos\orocos-toolchain-2.0.0\rtt\rtt\extras\dev\AxisInterface.cpp:32:
C:\CodingXP\Sources & Projects\orocos\orocos-toolchain-2.0.0\rtt\rtt\extras\dev\NameServer.hpp: In member function 'RTT::dev::NameServer<_ValueType>::NameType RTT::dev::NameServer<_ValueType>::name_iterator::op
erator*()':
C:\CodingXP\Sources & Projects\orocos\orocos-toolchain-2.0.0\rtt\rtt\extras\dev\NameServer.hpp:320:29: error: no match for 'operator*' in '*((RTT::dev::NameServer<_ValueType>::name_iterator*)this)->RTT::dev::Na
meServer<_ValueType>::name_iterator::i'
C:\CodingXP\Sources & Projects\orocos\orocos-toolchain-2.0.0\rtt\rtt\extras\dev\NameServer.hpp: In member function 'RTT::dev::NameServer<_ValueType>::name_iterator& RTT::dev::NameServer<_ValueType>::name_iterat
or::operator++()':
C:\CodingXP\Sources & Projects\orocos\orocos-toolchain-2.0.0\rtt\rtt\extras\dev\NameServer.hpp:332:19: error: no match for 'operator++' in '++((RTT::dev::NameServer<_ValueType>::name_iterator*)this)->RTT::dev::
NameServer<_ValueType>::name_iterator::i'
C:\CodingXP\Sources & Projects\orocos\orocos-toolchain-2.0.0\rtt\rtt\extras\dev\NameServer.hpp: In member function 'RTT::dev::NameServer<_ValueType>::name_iterator& RTT::dev::NameServer<_ValueType>::name_iterat
or::operator--()':
C:\CodingXP\Sources & Projects\orocos\orocos-toolchain-2.0.0\rtt\rtt\extras\dev\NameServer.hpp:338:19: error: no match for 'operator--' in '--((RTT::dev::NameServer<_ValueType>::name_iterator*)this)->RTT::dev::
NameServer<_ValueType>::name_iterator::i'
mingw32-make[2]: *** [rtt/CMakeFiles/orocos-rtt-win32_dynamic.dir/extras/dev/AxisInterface.cpp.obj] Error 1
mingw32-make[1]: *** [rtt/CMakeFiles/orocos-rtt-win32_dynamic.dir/all] Error 2

I fixed this issued by renaming iterator i in line 245 and line 311 of NameServer.h to Nameserver::iterator i.

2. Issue) ----------------------------------------------------->

Linking CXX shared library liborocos-rtt-win32.dll
c:/codingxp/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: unrecognized option '-zdefs'
c:/codingxp/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: use the --help option for usage information
collect2: ld returned 1 exit status

The linker option -zdefs is not known to the MinGW linker. I manually removed line 201 from rtt/rtt/CMakeLists.txt (LINK_FLAGS "-Wl,-zdefs") to continue build.

3. Issue) ----------------------------------------------------->

Linking CXX shared library liborocos-rtt-win32.dll
Creating library file: liborocos-rtt-win32.dll.a
CMakeFiles\orocos-rtt-win32_dynamic.dir\ExecutionEngine.cpp.obj: In function `rtos_cond_timedwait_internal':
C:/CodingXP/Sources & Projects/orocos/orocos-toolchain-2.0.0/rtt/rtt/os/win32/fosi.h:368: undefined reference to `timeBeginPeriod@4'
....

Undefined references to timeBeginPeriod, timeEndPeriod and __WSAFDIsSet. I fixed this issue by manually adding -lwsock32 and -lwinmm to the linker flags in the CMake GUI tool to link wsock32 and winmm libraries.

4. Issue) -------------------------------------------------------->

Creating library file: librtt-typekit-win32.dll.a, Linking CXX shared library librtt-scripting-win32.dll, Linking CXX shared library librtt-marshalling-win32.dll, Linking CXX shared library libfixtures.dll
c:/codingxp/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: warning: auto-importing has been activated without --enable-auto-import specified on the command line.
This should work unless it involves constant data structures referencing symbols from auto-imported DLLs.

Linking the libraries above caused warning messages because auto import feature is not enabled. I did not fix this issue here because it did not stop the build process

5. Issue) -------------------------------------------------------->

Linking CXX shared library libservice_plugin.dll
c:/codingxp/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: unrecognized option '-zdefs'
c:/codingxp/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: use the --help option for usage information
collect2: ld returned 1 exit status

I fixed this issue by removing the linker flags -zdefs from plugins/CMakeLists.txt and types/CMakeLists.txt.

After these changes the build process ran to completion.

Sorry that I can't provide a patch but I'm not a CMaje expert (yet) and do not know exactly how to solve the issues properly.

Regards, Uwe

RTT 2.0.0 MinGW build issues

Hello,

I tried to build RTT 2.0.0 with MinGW on a WindowsXP machine an stumbled across some build issues (MinGW GCC 4.5.0, Boost 1.43). I fixed these issues with some quick and dirty hacks and managed to build RTT 2.0.0. The following issues occured (I copied the error output followed by my fix):

1. Issue) --------------------------------------------------------------->

In file included from C:\CodingXP\Sources & Projects\orocos\orocos-toolchain-2.0.0\rtt\rtt\extras  \dev\DigitalInInterface.hpp:42:0,
                 from C:\CodingXP\Sources & Projects\orocos\orocos-toolchain-2.0.0\rtt\rtt\extras\dev\DigitalInput.hpp:41,
                 from C:\CodingXP\Sources & Projects\orocos\orocos-toolchain-2.0.0\rtt\rtt\extras\dev\AxisInterface.hpp:31,
                 from C:\CodingXP\Sources & Projects\orocos\orocos-toolchain-2.0.0\rtt\rtt\extras\dev\AxisInterface.cpp:32:
C:\CodingXP\Sources & Projects\orocos\orocos-toolchain-2.0.0\rtt\rtt\extras\dev\NameServer.hpp: In member function 'RTT::dev::NameServer<_ValueType>::NameType RTT::dev::NameServer<_ValueType>::name_iterator::op
erator*()':
C:\CodingXP\Sources & Projects\orocos\orocos-toolchain-2.0.0\rtt\rtt\extras\dev\NameServer.hpp:320:29: error: no match for 'operator*' in '*((RTT::dev::NameServer<_ValueType>::name_iterator*)this)->RTT::dev::Na
meServer<_ValueType>::name_iterator::i'
C:\CodingXP\Sources & Projects\orocos\orocos-toolchain-2.0.0\rtt\rtt\extras\dev\NameServer.hpp: In member function 'RTT::dev::NameServer<_ValueType>::name_iterator& RTT::dev::NameServer<_ValueType>::name_iterat
or::operator++()':
C:\CodingXP\Sources & Projects\orocos\orocos-toolchain-2.0.0\rtt\rtt\extras\dev\NameServer.hpp:332:19: error: no match for 'operator++' in '++((RTT::dev::NameServer<_ValueType>::name_iterator*)this)->RTT::dev::
NameServer<_ValueType>::name_iterator::i'
C:\CodingXP\Sources & Projects\orocos\orocos-toolchain-2.0.0\rtt\rtt\extras\dev\NameServer.hpp: In member function 'RTT::dev::NameServer<_ValueType>::name_iterator& RTT::dev::NameServer<_ValueType>::name_iterat
or::operator--()':
C:\CodingXP\Sources & Projects\orocos\orocos-toolchain-2.0.0\rtt\rtt\extras\dev\NameServer.hpp:338:19: error: no match for 'operator--' in '--((RTT::dev::NameServer<_ValueType>::name_iterator*)this)->RTT::dev::
NameServer<_ValueType>::name_iterator::i'
mingw32-make[2]: *** [rtt/CMakeFiles/orocos-rtt-win32_dynamic.dir/extras/dev/AxisInterface.cpp.obj] Error 1
mingw32-make[1]: *** [rtt/CMakeFiles/orocos-rtt-win32_dynamic.dir/all] Error 2

I fixed this issued by renaming iterator i in line 245 and line 311 of NameServer.h to
Nameserver::iterator i.

2. Issue) ----------------------------------------------------->

Linking CXX shared library liborocos-rtt-win32.dll
c:/codingxp/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: unrecognized option '-zdefs'
c:/codingxp/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: use the --help option for usage information
collect2: ld returned 1 exit status

The linker option -zdefs is not known to the MinGW linker. I manually removed line 201 from rtt/rtt/CMakeLists.txt (LINK_FLAGS "-Wl,-zdefs") to continue build.

3. Issue) ----------------------------------------------------->

Linking CXX shared library liborocos-rtt-win32.dll
Creating library file: liborocos-rtt-win32.dll.a
CMakeFiles\orocos-rtt-win32_dynamic.dir\ExecutionEngine.cpp.obj: In function `rtos_cond_timedwait_internal':
C:/CodingXP/Sources & Projects/orocos/orocos-toolchain-2.0.0/rtt/rtt/os/win32/fosi.h:368: undefined reference to `timeBeginPeriod@4'
....

Undefined references to timeBeginPeriod, timeEndPeriod and __WSAFDIsSet. I fixed this issue by manually adding -lwsock32 and -lwinmm to the linker flags in the CMake GUI tool to link wsock32 and winmm libraries.

4. Issue) -------------------------------------------------------->

Creating library file: librtt-typekit-win32.dll.a, Linking CXX shared library librtt-scripting-win32.dll, Linking CXX shared library librtt-marshalling-win32.dll, Linking CXX shared library libfixtures.dll
c:/codingxp/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: warning: auto-importing has been activated without --enable-auto-import specified on the command line.
This should work unless it involves constant data structures referencing symbols from auto-imported DLLs.

Linking the libraries above caused warning messages because auto import feature is not enabled. I did not fix this issue here because it did not stop the build process

5. Issue) -------------------------------------------------------->

Linking CXX shared library libservice_plugin.dll
c:/codingxp/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: unrecognized option '-zdefs'
c:/codingxp/mingw/bin/../lib/gcc/mingw32/4.5.0/../../../../mingw32/bin/ld.exe: use the --help option for usage information
collect2: ld returned 1 exit status

I fixed this issue by removing the linker flags -zdefs from plugins/CMakeLists.txt and
types/CMakeLists.txt.

After these changes the build process ran to completion.

Sorry that I can't provide a patch but I'm not a CMaje expert (yet) and do not know exactly how to solve the issues properly.

Regards, Uwe