在一个Clion项目中定义多个main函数编译的时候会报这个错误
显示就是main函数重复了,查阅了下好像可以通过修改CMakeList.txt
来修改,将其定义成两个独立的executable即可
add_executable(hello test/hello_world.cpp)
add_executable(sqrt test/sqrt.cpp)
在一个Clion项目中定义多个main函数编译的时候会报这个错误
显示就是main函数重复了,查阅了下好像可以通过修改CMakeList.txt
来修改,将其定义成两个独立的executable即可
add_executable(hello test/hello_world.cpp)
add_executable(sqrt test/sqrt.cpp)