Ask Your Question
0

Help It doesn't compile my program.

asked 2013-03-11 12:42:13 -0500

Bernardo gravatar image

updated 2013-03-11 16:56:53 -0500

ahendrix gravatar image

Hi ,I have a problem when I try compiling my program I have the files fismain.cpp , fis.h and fis.c and when I compiled without ROS I havent a problem but when I try to integrate in ROS I cant compiling,There is not defined as certain functions are in the file fis. c.

  • I've added in CMakelist.txt:

add_library(fis /home/magno/proyecto/fis.c)

rosbuild_add_executable(fismain src/fismain.cpp) target_link_libraries(fismain fis)

The error is:

Linking CXX executable ../bin/fismain
CMakeFiles/fismain.dir/src/fismain.o: In function `inicializaSistemaDifuso(char*)':
/home/magno/proyecto/prueba5/src/fismain.cpp:40: undefined reference to `returnFismatrix'
/home/magno/proyecto/prueba5/src/fismain.cpp:43: undefined reference to `fisBuildFisNode'
CMakeFiles/fismain.dir/src/fismain.o: In function `finalizaSistemaDifuso()':
/home/magno/proyecto/prueba5/src/fismain.cpp:56: undefined reference to `fisFreeMatrix'
/home/magno/proyecto/prueba5/src/fismain.cpp:57: undefined reference to `fisFreeMatrix'
/home/magno/proyecto/prueba5/src/fismain.cpp:58: undefined reference to `fisFreeMatrix'
CMakeFiles/fismain.dir/src/fismain.o: In function `presentarInformacion':
/home/magno/proyecto/prueba5/src/fismain.cpp:64: undefined reference to `fisPrintData'
CMakeFiles/fismain.dir/src/fismain.o: In function `evaluarFisOnLine':
/home/magno/proyecto/prueba5/src/fismain.cpp:73: undefined reference to `getFisOutput'
CMakeFiles/fismain.dir/src/fismain.o: In function `presentarInformacion':
/home/magno/proyecto/prueba5/src/fismain.cpp:64: undefined reference to `fisPrintData'
CMakeFiles/fismain.dir/src/fismain.o: In function `evaluarFisOnLine':
/home/magno/proyecto/prueba5/src/fismain.cpp:73: undefined reference to `getFisOutput'
collect2: ld devolvió el estado de salida 1
make[3]: *** [../bin/fismain] Error 1
make[3]: se sale del directorio «/home/magno/proyecto/prueba5/build»
make[2]: *** [CMakeFiles/fismain.dir/all] Error 2
make[2]: se sale del directorio «/home/magno/proyecto/prueba5/build»
make[1]: *** [all] Error 2
make[1]: se sale del directorio «/home/magno/proyecto/prueba5/build»
make: *** [all] Error 2

sorry for my english.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2013-03-12 01:18:36 -0500

davinci gravatar image

Try to use relative paths and use the ros package structure. Then your makefile is in the root of the package and the source files in src. Then add_library(fis src/fis.c)

You are also mixing c++ and c, that could also give problems.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2013-03-11 12:42:13 -0500

Seen: 151 times

Last updated: Mar 12 '13