**1.**略
**2.**略
**3.**g++参数可见该博客点击此处,更改生成的程序名g++ -o <name> <filename>
**4.**略
**5.**略
**6.**删除target_link_libraries(xxx xxx)
后,提示下列错误
CMakeFiles/helloSLAM.dir/src/main.cpp.o: In function `main':
main.cpp:(.text+0x5): undefined reference to `helloslam()'
main.cpp:(.text+0xa): undefined reference to `helloslam()'
collect2: error: ld returned 1 exit status
CMakeFiles/helloSLAM.dir/build.make:94: recipe for target '../bin/helloSLAM' failed
make[2]: *** [../bin/helloSLAM] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/helloSLAM.dir/all' failed
make[1]: *** [CMakeFiles/helloSLAM.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2