Ask Your Question

GLinBoy's profile - activity

2019-02-16 02:06:28 -0500 received badge  Famous Question (source)
2019-01-12 07:43:40 -0500 received badge  Enthusiast
2019-01-09 06:29:44 -0500 received badge  Famous Question (source)
2019-01-09 06:29:44 -0500 received badge  Notable Question (source)
2019-01-09 06:27:53 -0500 commented answer How I can Add .c libraries in my ROS project?

I'm sorry @tfoot but I can't see any checkbox on left to mark it as solved.

2019-01-09 06:27:44 -0500 received badge  Scholar (source)
2019-01-09 06:27:33 -0500 edited question How I can Add .c libraries in my ROS project?

How I can Add .c libraries in my ROS project? I know this question may be duplicated but my problem not solved yet! Lem

2019-01-09 06:24:34 -0500 received badge  Editor (source)
2019-01-09 06:24:34 -0500 edited question How I can Add .c libraries in my ROS project?

[SOLVED] How I can Add .c libraries in my ROS project? I know this question may be duplicated but my problem not solved

2019-01-08 18:31:56 -0500 marked best answer How I can Add .c libraries in my ROS project?

I know this question may be duplicated but my problem not solved yet!

Lemme describe, I have fontx.c, fontx.h, pcd8544.c nad pcd8544.h. I added them as library to CMakeLists.txt like:

add_library(fontx
  src/fontx.c
)
add_dependencies(fontx ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(fontx
  ${catkin_LIBRARIES}
)

add_library(pcd8544
  src/pcd8544.c
)
add_dependencies(pcd8544 ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(pcd8544
  ${catkin_LIBRARIES}
)

add_executable(DisplayNode_pub
  src/DisplayNode_pub.cpp
)
add_dependencies(DisplayNode_pub ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(DisplayNode_pub
  ${catkin_LIBRARIES}
)

add_executable(DisplayNode_sub
  src/DisplayNode_sub.cpp
)
add_dependencies(DisplayNode_sub ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(DisplayNode_sub
  fontx pcd8544
  wiringPi pthread
  ${catkin_LIBRARIES}
)

But when I run catkin_make I got undefined reference again! this is my catkin_make output

Base path: /home/hojjat/projects/shared_printer
Source space: /home/hojjat/projects/shared_printer/src
Build space: /home/hojjat/projects/shared_printer/build
Devel space: /home/hojjat/projects/shared_printer/devel
Install space: /home/hojjat/projects/shared_printer/install
####
#### Running command: "cmake /home/hojjat/projects/shared_printer/src -DCMAKE_CXX_FLAGS=-Wall -DCMAKE_C_FLAGS=-Wallcatkin_make -DCMAKE_CXX_FLAGS=-Wall -DCMAKE_C_FLAGS=-Wall -DCATKIN_DEVEL_PREFIX=/home/hojjat/projects/shared_printer/devel -DCMAKE_INSTALL_PREFIX=/home/hojjat/projects/shared_printer/install -G Unix Makefiles" in "/home/hojjat/projects/shared_printer/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/hojjat/projects/shared_printer/devel
-- Using CMAKE_PREFIX_PATH: /home/hojjat/projects/shared_printer/devel;/opt/ros/melodic
-- This workspace overlays: /home/hojjat/projects/shared_printer/devel;/opt/ros/melodic
-- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.15", minimum required is "2") 
-- Using PYTHON_EXECUTABLE: /usr/bin/python2
-- Using Debian Python package layout
-- Using empy: /usr/bin/empy
-- Using CATKIN_ENABLE_TESTING: ON
-- Call enable_testing()
-- Using CATKIN_TEST_RESULTS_DIR: /home/hojjat/projects/shared_printer/build/test_results
-- Found gmock sources under '/usr/src/googletest': gmock will be built
-- Found PythonInterp: /usr/bin/python2 (found version "2.7.15") 
-- Found gtest sources under '/usr/src/googletest': gtests will be built
-- Using Python nosetests: /usr/bin/nosetests-2.7
-- catkin 0.7.14
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing 1 packages in topological order:
-- ~~  - display
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'display'
-- ==> add_subdirectory(display)
-- Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
-- display: 0 messages, 1 services
-- Configuring done
-- Generating done
-- Build files have been written to: /home/hojjat/projects/shared_printer/build
####
#### Running command: "make -j2 -l2" in "/home/hojjat/projects/shared_printer/build"
####
[  0%] Built target std_msgs_generate_messages_nodejs
[  0%] Built target std_msgs_generate_messages_lisp
[  0%] Built target _display_generate_messages_check_deps_DisplayService
[  0%] Built target std_msgs_generate_messages_cpp
[  0%] Built target std_msgs_generate_messages_py
[  0%] Built target std_msgs_generate_messages_eus
[  0%] Built target roscpp_generate_messages_cpp
[  0%] Built target rosgraph_msgs_generate_messages_py
[  0%] Built target rosgraph_msgs_generate_messages_nodejs
[  0%] Built target rosgraph_msgs_generate_messages_lisp
[  0%] Built target rosgraph_msgs_generate_messages_eus
[  0%] Built target roscpp_generate_messages_lisp
[  0%] Built target roscpp_generate_messages_py
[  0%] Built target roscpp_generate_messages_nodejs
[  0%] Built target roscpp_generate_messages_eus
[  0%] Built target _catkin_empty_exported_target
[  0%] Built target rosgraph_msgs_generate_messages_cpp
[  6%] Built target display_generate_messages_nodejs
[ 13%] Built target display_generate_messages_lisp
[ 26%] Built target display_generate_messages_py
[ 33%] Built target display_generate_messages_cpp
[ 46%] Built target display_generate_messages_eus
[ 46%] Built target display_generate_messages
[ 60%] Built target fontx
[ 73%] Built target pcd8544
[ 86%] Built target DisplayNode_pub
[ 93%] Linking CXX executable /home/hojjat/projects/shared_printer/devel/lib/display/DisplayNode_sub
CMakeFiles/DisplayNode_sub.dir/src/DisplayNode_sub.cpp.o: In function `looper(char const*, int)':
DisplayNode_sub.cpp:(.text+0x16f): undefined reference to `Fontx_init(FontxFile*, char const*, char const*)'
DisplayNode_sub.cpp:(.text+0x1c6): undefined reference to `LCDdrawSJISChar(FontxFile*, unsigned char ...
(more)
2019-01-06 16:43:32 -0500 received badge  Notable Question (source)
2019-01-06 09:38:41 -0500 received badge  Popular Question (source)
2019-01-06 07:31:08 -0500 commented question How I can Add .c libraries in my ROS project?

ohhh thank you man! I lost that answer in my search and and after add this lines #ifdef __cplusplus extern "C" { #endif

2019-01-06 07:29:56 -0500 edited question How I can Add .c libraries in my ROS project?

How I can Add .c libraries in my ROS project? I know this question may be duplicated but my problem not solved yet! Lem

2019-01-06 07:28:58 -0500 commented question How I can Add .c libraries in my ROS project?

ohhh thank you man! I lost that answer in my search and and after add #ifdef __cplusplus extern "C" { #endif #ifdef __c

2019-01-06 05:09:09 -0500 asked a question How I can Add .c libraries in my ROS project?

How I can Add .c libraries in my ROS project? I know this question may be duplicated but my problem not solved yet! Lem

2019-01-06 04:52:38 -0500 received badge  Supporter (source)
2018-03-04 10:50:56 -0500 commented question GPIO Not response

another tip, i must call wiringPiSetup & pin configuration before ros::spin; now my robot work well.

2018-03-02 22:58:45 -0500 commented question GPIO Not response

I think find out! I doesn't call setup method! :D sorry, but let me test it and report result.

2018-03-02 22:57:27 -0500 received badge  Popular Question (source)
2018-03-02 11:36:39 -0500 asked a question GPIO Not response

GPIO Not response I install ROS Kinetic on Ubuntu core on Nanopi M1, and run this code: #include "ros/ros.h" #include "