----- Ursprüngliche Message -----

> Von: Franz Engel <[email protected]>
> An: Gilles Chanteperdrix <[email protected]>
> CC: "[email protected]" <[email protected]>
> Gesendet: 9:37 Dienstag, 4.Juni 2013
> Betreff: Re: [Xenomai] gcc error: posix.wrappers
> 
>> ________________________________
>>  Von: Gilles Chanteperdrix <[email protected]>
>> An: Franz Engel <[email protected]> 
>> CC: "[email protected]" <[email protected]> 
>> Gesendet: 20:22 Montag, 3.Juni 2013
>> Betreff: Re: [Xenomai] gcc error: posix.wrappers
>> 
>> 
>> On 06/03/2013 06:50 PM, Franz Engel wrote:
>> 
>>>  Hi,
>>> 
>>>  I've a little problem. When I try to compile my code with my new 
> system (xenomai 2.6.2.1) I get the following error:
>>>  gcc: error: ;-Wl,@/usr/xenomai/lib/posix.wrappers: No such file or 
> directory
>> 
>> 
>> If the build-tool you use supports pkg-config, you may find it easier to
>> use the .pc files installed by xenomai. The posix skin library "package
>> name" is libxenomai_posix (so the .pc file is called 
> libxenomai_posix.pc).
>> 
>> 
>> -- 
>>                                                                 Gilles.
> 
> I changed my cmake file to this:
> IF(USE_XENOMAI)
>     message(STATUS "Starting Xenomai configuration")
>     
>     find_package(PkgConfig)
> 
>     if(NOT DEFINED ENV{PKG_CONFIG_PATH})
>         set(ENV{PKG_CONFIG_PATH} $ENV{PKG_CONFIG_PATH} 
> "/usr/xenomai/lib/pkgconfig") 
>     endif(NOT DEFINED ENV{PKG_CONFIG_PATH})
>     
>     pkg_search_module(XENOMAI REQUIRED libxenomai_posix)
>     if (XENOMAI_FOUND)
>         message(STATUS "Start der pkg Ergebnisse")
>         message(STATUS ${XENOMAI_CFLAGS})
>         set(EXTRA_DEFINITIONS ${EXTRA_DEFINITIONS} ${XENOMAI_CFLAGS})
>         message(STATUS ${XENOMAI_LDFLAGS})
>         set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} 
> ${XENOMAI_LDFLAGS})
>         message(STATUS "Ende der pkg Ergebnisse")
>         ADD_DEFINITIONS(${EXTRA_DEFINITIONS})
>     endif (XENOMAI_FOUND)
>     
>     message(STATUS "Xenomai configuration finished")
> ENDIF(USE_XENOMAI)
> 
> ADD_DEFINITIONS(${EXTRA_DEFINITIONS})
> add_executable(${ProjectName} ${SOURCES})
> TARGET_LINK_LIBRARIES(${ProjectName} ${EXTRA_LIBS})
> install(TARGETS ${ProjectName} DESTINATION ${INSTALLDIR})
> 
> It looks like a better way then using the xeno-config file. But I have 
> still the problem: gcc: error: 
> ;-Wl,@//usr/xenomai/lib/posix.wrappers;-L/usr/xenomai/lib;-lpthread_rt;-lxenomai;-lpthread;-lrt:
>  
> No such file or directory
> In anouther project I build a .so. That works without any problem. I just use 
> this lines instead of the last four lines of my example above:
> 
> 
> ADD_DEFINITIONS(${EXTRA_DEFINITIONS})
> add_library(${ProjectName} SHARED ${SOURCES})
> TARGET_LINK_LIBRARIES(${ProjectName} ${EXTRA_LIBS})
> install(TARGETS ${ProjectName} DESTINATION ${INSTALLDIR})
> 
> 
> Any Idea?
>

O.k. I solved my problem. If I set the XENOMAI_LDFLAGS to the 
CMAKE_EXE_LINKER_FLAGS it doesn't work. But if I set it direct to the 
EXTRA_LIBS and link them with TARGET_LINK_LIBRARIES(${ProjectName} 
${EXTRA_LIBS}) it works perfect.


_______________________________________________
Xenomai mailing list
[email protected]
http://www.xenomai.org/mailman/listinfo/xenomai

Reply via email to