You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking at your CMakeLists.txt I don't think you want to add rt unless you are linux. I get the following error when it tries to build:
[kevin@tardis serial]$ make
cd build && cmake -DCMAKE_INSTALL_PREFIX=/tmp/usr/local ..
-- The C compiler identification is Clang 4.1.0
-- The CXX compiler identification is Clang 4.1.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Using CATKIN_DEVEL_PREFIX: /Users/kevin/tmp/serial/build/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/groovy
-- This workspace overlays: /opt/ros/groovy
-- Found PythonInterp: /usr/bin/python (found version "2.7.2")
-- Found PY_em: /Library/Python/2.7/site-packages/em.pyc
-- Found gtest: gtests will be built
-- catkin 0.5.52
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/kevin/tmp/serial/build
cd build && make
Scanning dependencies of target serial
[ 33%] Building CXX object CMakeFiles/serial.dir/src/serial.cc.o
[ 66%] Building CXX object CMakeFiles/serial.dir/src/impl/unix.cc.o
Linking CXX shared library devel/lib/libserial.dylib
ld: library not found for -lrt
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [devel/lib/libserial.dylib] Error 1
make[2]: *** [CMakeFiles/serial.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [serial] Error 2
You need to change CMakeLists.txt where you add library rt:
if (UNIX AND NOT APPLE)
target_link_libraries(${PROJECT_NAME} rt)
endif()
Here is the diff:
[kevin@tardis serial]$ git diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7ea1c80..216bc04 100644
--- a/CMakeLists.txt+++ b/CMakeLists.txt@@ -37,7 +37,7 @@ endif()
add_library(${PROJECT_NAME}
${serial_SRCS}
)
-if (UNIX)+if (UNIX AND NOT APPLE)
target_link_libraries(${PROJECT_NAME} rt)
endif()
The text was updated successfully, but these errors were encountered:
Looking at your CMakeLists.txt I don't think you want to add rt unless you are linux. I get the following error when it tries to build:
You need to change CMakeLists.txt where you add library rt:
Here is the diff:
The text was updated successfully, but these errors were encountered: