【发布时间】:2019-12-10 18:13:29
【问题描述】:
我正在尝试使用编译this Gurobi 示例
g++ dense_cpp.cpp -I $GUROBI_HOME/include
$GUROBI_HOME 是我的 Gurobi 安装的主目录。我收到以下错误:
Undefined symbols for architecture x86_64:
"GRBLinExpr::GRBLinExpr(double)", referenced from:
dense_optimize(GRBEnv*, int, int, double*, double*, double*, char*, double*, double*, double*, char*, double*, double*) in dense_cpp-1ed621.o
"GRBLinExpr::operator+=(GRBLinExpr const&)", referenced from:
dense_optimize(GRBEnv*, int, int, double*, double*, double*, char*, double*, double*, double*, char*, double*, double*) in dense_cpp-1ed621.o
[...]
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
有谁知道如何解决这个问题?
【问题讨论】:
-
g++ dense_cpp.cpp -I $GUROBI_HOME/include 好像你错过了链接到一个库。
标签: c++ compiler-errors compilation linker gurobi