gcc error: posix.wrappers
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
The
file posix.wrappers exits in the /usr/xenomai/lib-directory.
Futhermore, if move this file to anywhere else I get this message:/home/profit/Work/Development/bv_ProFIT_guidePC_shared/bin/libkogmo_rtdb.so: undefined reference to pthread_mutexattr_settype' /home/profit/Work/Development/bv_ProFIT_guidePC_shared/bin/libkogmo_rtdb.so: undefined reference to clock_gettime' /home/profit/Work/Development/bv_ProFIT_guidePC_shared/bin/libkogmo_rtdb.so:
undefined reference to `pthread_condattr_setpshared'/home/profit/Work/Development/bv_ProFIT_guidePC_shared/bin/libkogmo_rtdb.so: undefined reference to
`pthread_mutexattr_setprotocol'/home/profit/Work/Development/bv_ProFIT_guidePC_shared/bin/libkogmo_rtdb.so: undefined reference to shm_unlink' /home/profit/Work/Development/bv_ProFIT_guidePC_shared/bin/libkogmo_rtdb.so: undefined reference to pthread_kill' /home/profit/Work/Development/bv_ProFIT_guidePC_shared/bin/libkogmo_rtdb.so:
undefined reference to `pthread_mutexattr_setpshared'/home/profit/Work/Development/bv_ProFIT_guidePC_shared/bin/libkogmo_rtdb.so: undefined reference to mq_send' /home/profit/Work/Development/bv_ProFIT_guidePC_shared/bin/libkogmo_rtdb.so: undefined reference to mq_unlink' /home/profit/Work/Development/bv_ProFIT_guidePC_shared/bin/libkogmo_rtdb.so: undefined reference to pthread_join' /home/profit/Work/Development/bv_ProFIT_guidePC_shared/bin/libkogmo_rtdb.so: undefined reference to pthread_create' /home/profit/Work/Development/bv_ProFIT_guidePC_shared/bin/libkogmo_rtdb.so: undefined reference
to `pthread_mutexattr_init'/home/profit/Work/Development/bv_ProFIT_guidePC_shared/bin/libkogmo_rtdb.so: undefined reference to pthread_mutexattr_destroy' /home/profit/Work/Development/bv_ProFIT_guidePC_shared/bin/libkogmo_rtdb.so: undefined reference to mq_getattr' /home/profit/Work/Development/bv_ProFIT_guidePC_shared/bin/libkogmo_rtdb.so: undefined reference to shm_open' /home/profit/Work/Development/bv_ProFIT_guidePC_shared/bin/libkogmo_rtdb.so: undefined reference to mq_receive' /home/profit/Work/Development/bv_ProFIT_guidePC_shared/bin/libkogmo_rtdb.so: undefined reference to mq_close' /home/profit/Work/Development/bv_ProFIT_guidePC_shared/bin/libkogmo_rtdb.so: undefined reference to mq_open'
collect2: ld returned 1 exit status
Does
somebody know what does it mean? Is it possible that the error refers
to the commands inside the file and not to the file itself?
I use the following cmake
commands:cmake_minimum_required(VERSION 2.8)
##################################
# BEGIN OF EDITING THIS TEMPLATE #
##################################
############################################
# PLEASE ENTER HERE THE NAME OF YOUR PROJECT
set(ProjectName "kogmo_man")
PROJECT(${ProjectName})
###############################################
# ENTER HERE THE VERSION NUMBER OF YOUR PROJECT set(${ProjectName}_VERSION_MAJOR 1) set(${ProjectName}_VERSION_MINOR 0)
###############################################
# ENABLE OR DIABLE THE USE OF XENOMAI AND QT option(USE_XENOMAI "xenomai" ON ) option(USE_RTDB "rtdb" ON ) option(USE_RTDB_DEBUG "rtdb_debug"
OFF )option(USE_RTMALLOC_SUBA "suba" ON )
#############################################
# NOW ADD ALL SOURCE FILES OF YOUR PROJECT
# IF YOU'RE USING QT, ALSO ADD ALL HEADERS OF
# QT-OBJECTS, UI-FILES AND RESOURCES
#####################
# INCLUDE DIRECTORIESset(MAIN_DIR ${PROJECT_SOURCE_DIR}/../..)set(RTDB_INC ../include)
#############################################
# ENTER THE INSTALL DIRECTORYset(INSTALLDIR ${MAIN_DIR}/bin)
include_directories(
${RTDB_INC}
)
###########
# LIBRARIES
set(EXTRA_LIBS
)
######
# CPPs
set(SOURCES
main.c
)
###########
# Resources
set(RESOURCES
)
##################################
# END OF EDITING THIS TEMPLATE
#
##################################
message ("Usage of Xenomai: ${USE_XENOMAI}")
message ("Usage of RTDB Debugger: ${USE_RTDB_DEBUG}")
message ("Usage of RTDB: ${USE_RTDB}")
message ("If there's something wrong with these values, run rm -r * in the build directory")
message(STATUS
"Generating buid files for project ${ProjectName}, version
${${ProjectName}_VERSION_MAJOR}.${${ProjectName}_VERSION_MINOR}")
include_directories(${INCLUDES})
IF(USE_XENOMAI)
message(STATUS "Starting Xenomai configuration")
set(XENOMAI_DIR "/usr/xenomai") set(XENOMAI_INCLUDE_DIR ${XENOMAI_DIR}/include) set(XENOMAI_INCLUDE_POSIX_DIR ${XENOMAI_DIR}/include/posix)
execute_process(COMMAND
"${XENOMAI_DIR}/bin/xeno-config" "--skin=posix" "--ldflags" OUTPUT_VARIABLE XENOMAI_EXE_LINKER_FLAGS)
set(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} ${XENOMAI_EXE_LINKER_FLAGS}) execute_process(COMMAND "${XENOMAI_DIR}/bin/xeno-config" "--skin=posix" "--cflags" OUTPUT_VARIABLE XENOMAI_DEFINITIONS) set(EXTRA_DEFINITIONS ${EXTRA_DEFINITIONS} ${XENOMAI_DEFINITIONS}) ADD_DEFINITIONS(${EXTRA_DEFINITIONS})
set(EXTRA_LIBS ${EXTRA_LIBS} rtdk)
message(STATUS ${XENOMAI_EXE_LINKER_FLAGS})
message(STATUS ${XENOMAI_DEFINITIONS})
message(STATUS "Xenomai configuration finished")ELSE(USE_XENOMAI)
set(EXTRA_DEFINITIONS ${EXTRA_DEFINITIONS} "-O2 -fno-strict-aliasing -Wstrict-prototypes -O2 -g -Wall")
set(EXTRA_DEFINITIONS ${EXTRA_DEFINITIONS} "-D_GNU_SOURCE -D_REENTRANT")
find_library(THREAD_LIB pthread ../usr/lib)
set(EXTRA_LIBS ${EXTRA_LIBS} ${THREAD_LIB})
find_library(C_LIB c ../usr/lib)
set(EXTRA_LIBS ${EXTRA_LIBS} ${C_LIB})
find_library(RT_LIB rt ../usr/lib)
set(EXTRA_LIBS ${EXTRA_LIBS} ${RT_LIB})ENDIF(USE_XENOMAI)
IF (USE_RTDB)
message(STATUS "startign RTDB configuration") set(KOGMO_DIR ../)
find_library(KOGMO_LIBRARY_KOGMO_RTDB kogmo_rtdb ${KOGMO_DIR}../bin) set(EXTRA_LIBS ${EXTRA_LIBS} ${KOGMO_LIBRARY_KOGMO_RTDB}) include_directories(${KOGMO_DIR}/include) include_directories(${KOGMO_DIR}/../bin)
message(STATUS "RTDB configuration finished")
ENDIF
(USE_RTDB)
IF(USE_RTDB_DEBUG)
set(EXTRA_DEFINITIONS ${EXTRA_DEFINITIONS} "-DDEBUG=1023") ENDIF(USE_RTDB_DEBUG)
IF(USE_RTMALLOC_SUBA)
set(KOGMO_DEFINITIONS "-DRTMALLOC_suba") set(EXTRA_DEFINITIONS ${EXTRA_DEFINITIONS} ${KOGMO_DEFINITIONS}) ENDIF(USE_RTMALLOC_SUBA)
ADD_DEFINITIONS(${EXTRA_DEFINITIONS})
add_executable(${ProjectName} ${SOURCES})
TARGET_LINK_LIBRARIES(${ProjectName} ${EXTRA_LIBS})
install(TARGETS ${ProjectName} DESTINATION ${INSTALLDIR})
Thanks,
Franz
Quoted 2 lines · Franz Engel
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
What is that ';' doing there? That looks weird. That would end one command and make it seem the -Wl... is a command to try and execute, which is unlikely to work.
The rest of your message is probably just symptoms of the above problem.
Signature · 1 line
Len Sorensen
----- Ursprüngliche Message -----
Quoted 9 lines
Von: Lennart Sorensen <[email protected]>
An: Franz Engel <[email protected]>
CC: "[email protected]" <[email protected]>
Gesendet: 20:20 Montag, 3.Juni 2013
Betreff: Re: [Xenomai] gcc error: posix.wrappersQuoted 1 line · Franz Engel
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:
Quoted 12 lines
Quoted 1 line
gcc: error: ;-Wl,@/usr/xenomai/lib/posix.wrappers: No such file or
directory
What is that ';' doing there? That looks weird. That would end one command and make it seem the -Wl... is a command to try and execute, which is unlikely to work.
The rest of your message is probably just symptoms of the above problem.
Signature · 1 line
Len Sorensen
I have no idee where the ";" is coming from. When I print my ldflags I get use this: -Wl,@//usr/xenomai/lib/posix.wrappers-L/usr/xenomai/lib-lpthread_rt-lxenomai-lpthread-lrt
The ";" must be set by the compiler.
Quoted 4 lines · Franz Engel
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).
Signature · 1 line
Gilles.
Quoted 12 lines
________________________________
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.wrappersQuoted 2 lines · Franz Engel
Hi,
Quoted 11 lines
Quoted 2 lines
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 directoryIf 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).Signature · 1 line
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?
----- Ursprüngliche Message -----
Quoted 71 lines
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.wrappersQuoted 8 lines
________________________________
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.wrappersQuoted 5 lines
Quoted 3 lines · Franz Engel
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:
Quoted 1 line
Quoted 1 line
gcc: error: ;-Wl,@/usr/xenomai/lib/posix.wrappers: No such file or
directory
Quoted 5 lines
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 calledlibxenomai_posix.pc).
Quoted 4 lines
Signature · 2 lines
-- 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:
Quoted 8 lines
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.
Quoted 29 lines · Franz Engel
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})
Quoted 4 lines
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:
Clearly something is using ';' as a delimiter where you don't want one.
I wasn't even aware xenomai used cmake. I just assumed it had plain old simple to understand makefiles. I guess if I ever had a need to poke at how it builds I would know. Or are these makefiles for your own project that uses xenomai?
I would think it is your EXTRA_LIBS that is wrong.
Signature · 1 line
Len Sorensen