Unable to compile RTT on WinXP with MinGW

I get a compile error in the win32/fosi.h:

cd /C/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build/src
&& /C/MinGW/bin/g++.exe -DRTT_DLL_EXPORT -DOROCOS_TARGET=win32 -O2
-g -I/C/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src
-I/C/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build/src
-I/C/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build/src/os
-I/C/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build/src/os/win32
-IC:/boost -o
CMakeFiles/orocos-rtt-dynamic_win32.dir/Activity.cpp.obj -c
/C/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/Activity.cpp
In file included from
c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/os/fosi.h:63,
from
c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/os/ThreadInterface.hpp:43,
from
c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/ActivityInterface.hpp:42,
from
c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/RunnableInterface.hpp:42,
from
c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/Activity.hpp:5,
from
c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/Activity.cpp:6:
c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/os/win32/fosi.h:71:
error: declaration of C function `void usleep(long int)' conflicts
with
c:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/unistd.h:36:
error: previous declaration `int usleep(useconds_t)' here
make[2]: *** [src/CMakeFiles/orocos-rtt-dynamic_win32.dir/Activity.cpp.obj]
Error 1
make[2]: Leaving directory
`/c/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build'
make[1]: *** [src/CMakeFiles/orocos-rtt-dynamic_win32.dir/all] Error 2
make[1]: Leaving directory
`/c/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build'
make: *** [all] Error 2
Finished: FAILURE

Ruben

Unable to compile RTT on WinXP with MinGW

On Mon, Nov 16, 2009 at 16:36, Ruben Smits <ruben [dot] smits [..] ...> wrote:
> I get a compile error in the win32/fosi.h:
>
>  [0mcd /C/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build/src
> && /C/MinGW/bin/g++.exe   -DRTT_DLL_EXPORT -DOROCOS_TARGET=win32 -O2
> -g -I/C/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src
> -I/C/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build/src
> -I/C/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build/src/os
> -I/C/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build/src/os/win32
>  -IC:/boost -o
> CMakeFiles/orocos-rtt-dynamic_win32.dir/Activity.cpp.obj -c
> /C/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/Activity.cpp
> In file included from
> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/os/fosi.h:63,
>                 from
> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/os/ThreadInterface.hpp:43,
>                 from
> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/ActivityInterface.hpp:42,
>                 from
> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/RunnableInterface.hpp:42,
>                 from
> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/Activity.hpp:5,
>                 from
> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/Activity.cpp:6:
> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/os/win32/fosi.h:71:
> error: declaration of C function `void usleep(long int)' conflicts
> with
> c:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/unistd.h:36:
> error: previous declaration `int usleep(useconds_t)' here
> make[2]: *** [src/CMakeFiles/orocos-rtt-dynamic_win32.dir/Activity.cpp.obj]
> Error 1
> make[2]: Leaving directory
> `/c/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build'
> make[1]: *** [src/CMakeFiles/orocos-rtt-dynamic_win32.dir/all] Error 2
> make[1]: Leaving directory
> `/c/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build'
> make: *** [all] Error 2
> Finished: FAILURE

I think the best fix is to adapt the signature of usleep in both
fosi.h and fosi.cpp for win32 to match the unistd.h one. Same for
unsigned int sleep(unsigned int seconds);

Peter

Ruben Smits's picture

Unable to compile RTT on WinXP with MinGW

On Thu, Nov 19, 2009 at 1:48 PM, Peter Soetens
<Peter [dot] Soetens [..] ...> wrote:
> On Mon, Nov 16, 2009 at 16:36, Ruben Smits <ruben [dot] smits [..] ...> wrote:
>> I get a compile error in the win32/fosi.h:
>>
>>  [0mcd /C/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build/src
>> && /C/MinGW/bin/g++.exe   -DRTT_DLL_EXPORT -DOROCOS_TARGET=win32 -O2
>> -g -I/C/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src
>> -I/C/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build/src
>> -I/C/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build/src/os
>> -I/C/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build/src/os/win32
>>  -IC:/boost -o
>> CMakeFiles/orocos-rtt-dynamic_win32.dir/Activity.cpp.obj -c
>> /C/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/Activity.cpp
>> In file included from
>> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/os/fosi.h:63,
>>                 from
>> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/os/ThreadInterface.hpp:43,
>>                 from
>> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/ActivityInterface.hpp:42,
>>                 from
>> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/RunnableInterface.hpp:42,
>>                 from
>> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/Activity.hpp:5,
>>                 from
>> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/Activity.cpp:6:
>> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/os/win32/fosi.h:71:
>> error: declaration of C function `void usleep(long int)' conflicts
>> with
>> c:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/unistd.h:36:
>> error: previous declaration `int usleep(useconds_t)' here
>> make[2]: *** [src/CMakeFiles/orocos-rtt-dynamic_win32.dir/Activity.cpp.obj]
>> Error 1
>> make[2]: Leaving directory
>> `/c/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build'
>> make[1]: *** [src/CMakeFiles/orocos-rtt-dynamic_win32.dir/all] Error 2
>> make[1]: Leaving directory
>> `/c/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build'
>> make: *** [all] Error 2
>> Finished: FAILURE
>
> I think the best fix is to adapt the signature of usleep in both
> fosi.h and fosi.cpp for win32 to match the unistd.h one. Same for
> unsigned int sleep(unsigned int seconds);

We are getting further, but now i have a error when compiling win32/fosi.c:

c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/os/win32/fosi.cpp:
In function `unsigned int sleep(unsigned int)':
c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/os/win32/fosi.cpp:53:
error: `s' was not declared in this scope
make[2]: *** [src/CMakeFiles/orocos-rtt-dynamic_win32.dir/os/win32/fosi.cpp.obj]
Error 1
make[2]: Leaving directory
`/c/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build'
make[1]: *** [src/CMakeFiles/orocos-rtt-dynamic_win32.dir/all] Error 2
make[1]: Leaving directory
`/c/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build'
make: *** [all] Error 2
Finished: FAILURE

Ruben

> Peter
>

Ruben Smits's picture

Unable to compile RTT on WinXP with MinGW

On Fri, Nov 20, 2009 at 8:49 AM, Ruben Smits
<ruben [dot] smits [..] ...> wrote:
> On Thu, Nov 19, 2009 at 1:48 PM, Peter Soetens
> <Peter [dot] Soetens [..] ...> wrote:
>> On Mon, Nov 16, 2009 at 16:36, Ruben Smits <ruben [dot] smits [..] ...> wrote:
>>> I get a compile error in the win32/fosi.h:
>>>
>>>  [0mcd /C/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build/src
>>> && /C/MinGW/bin/g++.exe   -DRTT_DLL_EXPORT -DOROCOS_TARGET=win32 -O2
>>> -g -I/C/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src
>>> -I/C/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build/src
>>> -I/C/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build/src/os
>>> -I/C/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build/src/os/win32
>>>  -IC:/boost -o
>>> CMakeFiles/orocos-rtt-dynamic_win32.dir/Activity.cpp.obj -c
>>> /C/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/Activity.cpp
>>> In file included from
>>> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/os/fosi.h:63,
>>>                 from
>>> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/os/ThreadInterface.hpp:43,
>>>                 from
>>> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/ActivityInterface.hpp:42,
>>>                 from
>>> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/RunnableInterface.hpp:42,
>>>                 from
>>> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/Activity.hpp:5,
>>>                 from
>>> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/Activity.cpp:6:
>>> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/os/win32/fosi.h:71:
>>> error: declaration of C function `void usleep(long int)' conflicts
>>> with
>>> c:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/unistd.h:36:
>>> error: previous declaration `int usleep(useconds_t)' here
>>> make[2]: *** [src/CMakeFiles/orocos-rtt-dynamic_win32.dir/Activity.cpp.obj]
>>> Error 1
>>> make[2]: Leaving directory
>>> `/c/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build'
>>> make[1]: *** [src/CMakeFiles/orocos-rtt-dynamic_win32.dir/all] Error 2
>>> make[1]: Leaving directory
>>> `/c/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build'
>>> make: *** [all] Error 2
>>> Finished: FAILURE
>>
>> I think the best fix is to adapt the signature of usleep in both
>> fosi.h and fosi.cpp for win32 to match the unistd.h one. Same for
>> unsigned int sleep(unsigned int seconds);
>
> We are getting further, but now i have a error when compiling win32/fosi.c:
>
> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/os/win32/fosi.cpp:
> In function `unsigned int sleep(unsigned int)':
> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/os/win32/fosi.cpp:53:
> error: `s' was not declared in this scope
> make[2]: *** [src/CMakeFiles/orocos-rtt-dynamic_win32.dir/os/win32/fosi.cpp.obj]
> Error 1
> make[2]: Leaving directory
> `/c/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build'
> make[1]: *** [src/CMakeFiles/orocos-rtt-dynamic_win32.dir/all] Error 2
> make[1]: Leaving directory
> `/c/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build'
> make: *** [all] Error 2
> Finished: FAILURE

The attached patch fixes the issue. Now the build is succesfully completed.

Ruben

> Ruben
>
>> Peter
>>
>

Unable to compile RTT on WinXP with MinGW

On Fri, Nov 20, 2009 at 09:14, Ruben Smits <ruben [dot] smits [..] ...> wrote:
> On Fri, Nov 20, 2009 at 8:49 AM, Ruben Smits
> <ruben [dot] smits [..] ...> wrote:
>> On Thu, Nov 19, 2009 at 1:48 PM, Peter Soetens
>> <Peter [dot] Soetens [..] ...> wrote:
>>> On Mon, Nov 16, 2009 at 16:36, Ruben Smits <ruben [dot] smits [..] ...> wrote:
>>>> I get a compile error in the win32/fosi.h:
>>>>
>>>>  [0mcd /C/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build/src
>>>> && /C/MinGW/bin/g++.exe   -DRTT_DLL_EXPORT -DOROCOS_TARGET=win32 -O2
>>>> -g -I/C/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src
>>>> -I/C/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build/src
>>>> -I/C/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build/src/os
>>>> -I/C/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build/src/os/win32
>>>>  -IC:/boost -o
>>>> CMakeFiles/orocos-rtt-dynamic_win32.dir/Activity.cpp.obj -c
>>>> /C/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/Activity.cpp
>>>> In file included from
>>>> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/os/fosi.h:63,
>>>>                 from
>>>> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/os/ThreadInterface.hpp:43,
>>>>                 from
>>>> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/ActivityInterface.hpp:42,
>>>>                 from
>>>> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/RunnableInterface.hpp:42,
>>>>                 from
>>>> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/Activity.hpp:5,
>>>>                 from
>>>> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/Activity.cpp:6:
>>>> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/os/win32/fosi.h:71:
>>>> error: declaration of C function `void usleep(long int)' conflicts
>>>> with
>>>> c:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/unistd.h:36:
>>>> error: previous declaration `int usleep(useconds_t)' here
>>>> make[2]: *** [src/CMakeFiles/orocos-rtt-dynamic_win32.dir/Activity.cpp.obj]
>>>> Error 1
>>>> make[2]: Leaving directory
>>>> `/c/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build'
>>>> make[1]: *** [src/CMakeFiles/orocos-rtt-dynamic_win32.dir/all] Error 2
>>>> make[1]: Leaving directory
>>>> `/c/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build'
>>>> make: *** [all] Error 2
>>>> Finished: FAILURE
>>>
>>> I think the best fix is to adapt the signature of usleep in both
>>> fosi.h and fosi.cpp for win32 to match the unistd.h one. Same for
>>> unsigned int sleep(unsigned int seconds);
>>
>> We are getting further, but now i have a error when compiling win32/fosi.c:
>>
>> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/os/win32/fosi.cpp:
>> In function `unsigned int sleep(unsigned int)':
>> c:/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/rtt/src/os/win32/fosi.cpp:53:
>> error: `s' was not declared in this scope
>> make[2]: *** [src/CMakeFiles/orocos-rtt-dynamic_win32.dir/os/win32/fosi.cpp.obj]
>> Error 1
>> make[2]: Leaving directory
>> `/c/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build'
>> make[1]: *** [src/CMakeFiles/orocos-rtt-dynamic_win32.dir/all] Error 2
>> make[1]: Leaving directory
>> `/c/hudson/workspace/RTT-trunk-multi/label/windows/target/win32/build'
>> make: *** [all] Error 2
>> Finished: FAILURE
>
> The attached patch fixes the issue. Now the build is succesfully completed.

Damn copy-pasting. Minor bug slipped in the release. I'll start
respecting a 24h cycle after last commit from now on :-/

Peter