Giter Site home page Giter Site logo

Comments (3)

LongruiDong avatar LongruiDong commented on July 2, 2024 1

====================[ Build | eigenGeometry | Debug ]===========================
/snap/clion/82/bin/cmake/linux/bin/cmake --build /home/xhyu/slambook2/ch3/useGeometry/cmake-build-debug --target eigenGeometry -- -j 6
Scanning dependencies of target eigenGeometry
[ 33%] Building CXX object CMakeFiles/eigenGeometry.dir/home/xhyu/slambook2/ch3/examples/coordinateTransform.cpp.o
[ 66%] Linking CXX executable eigenGeometry
CMakeFiles/eigenGeometry.dir/home/xhyu/slambook2/ch3/examples/coordinateTransform.cpp.o: In function main': /usr/include/eigen3/Eigen/src/Core/IO.h:129: multiple definition of main'
CMakeFiles/eigenGeometry.dir/eigenGeometry.cpp.o:/home/xhyu/slambook2/ch3/useGeometry/eigenGeometry.cpp:13: first defined here
collect2: error: ld returned 1 exit status
CMakeFiles/eigenGeometry.dir/build.make:98: recipe for target 'eigenGeometry' failed
make[3]: *** [eigenGeometry] Error 1
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/eigenGeometry.dir/all' failed
make[2]: *** [CMakeFiles/eigenGeometry.dir/all] Error 2
CMakeFiles/Makefile2:84: recipe for target 'CMakeFiles/eigenGeometry.dir/rule' failed
make[1]: *** [CMakeFiles/eigenGeometry.dir/rule] Error 2
Makefile:118: recipe for target 'eigenGeometry' failed
make: *** [eigenGeometry] Error 2

错误提示如上,然后经过阅读个人认为是main函数重复定义,另外在cmakelist中直接将两个文件都生成了可执行文件,冲突了,修改cmakelist或者修改任意一个main函数的文件名可以解决该问题,但是本人刚刚开始学习,所以不敢肯定,恳求大佬指点

我也是改了cmakelists ,。。

from slambook2.

ten1er avatar ten1er commented on July 2, 2024

在useGeometry的CMakeLists.txt中将:
add_executable( eigenGeometry eigenGeometry.cpp ../examples/coordinateTransform.cpp)
改为:
add_executable( eigenGeometry eigenGeometry.cpp )
解决了我的问题。

from slambook2.

gaoxiang12 avatar gaoxiang12 commented on July 2, 2024

已修复,应该是IDE自动加了一句不该加的executable。

from slambook2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.