小编小小程*_*程序猿的帖子

体系结构 x86_64 的 Clion 未定义符号

我的代码在 CodeLite 中按预期编译和运行。然后我尝试在 Clion 中运行相同的代码,但它给了我这个错误:

Scanning dependencies of target leastSquareFitting
[ 50%] Building CXX object CMakeFiles/leastSquareFitting.dir/main.cpp.o
[100%] Linking CXX executable leastSquareFitting
Undefined symbols for architecture x86_64:
  "printMatrix(Matrix)", referenced from:
      _main in main.cpp.o
  "constructMatrix(int, std::__1::vector<double, 
std::__1::allocator<double> >)", referenced from:
      _main in main.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see 
invocation)
make[3]: *** [leastSquareFitting] Error 1
make[2]: *** [CMakeFiles/leastSquareFitting.dir/all] Error 2
make[1]: *** [CMakeFiles/leastSquareFitting.dir/rule] Error 2
make: *** [leastSquareFitting] …
Run Code Online (Sandbox Code Playgroud)

c++ cmake clion

3
推荐指数
1
解决办法
8324
查看次数

标签 统计

c++ ×1

clion ×1

cmake ×1