我有一个使用 CPLEX 的 MIP 模型。我是在 Mac 中编译程序的新手。我想知道编译此类程序的命令行是什么?我已经在我的机器上安装了 CPLEX。 这是我正在使用的命令,但它不起作用:
g++ -I/<'path'>/CPLEX_Studio1261/cplex/include -I/<'path'>/CPLEX_Studio1261/concert/include -L/<'path'>/CPLEX_Studio1261/cplex/lib/x86-64_linux/static_pic -L/<'path'>/CPLEX_Studio1261/concert/lib/x86-64_linux/static_pic hello.cpp -lilocplex -lconcert -lcplex
感谢任何帮助!
最佳答案
我自己没有使用过 CPLEX,但您似乎在以下方面犯了错误:
8.1 add *.h and *.lib path in the "searching path" and "library path"
8.2 add -DIL_STL "in other c flags"
8.3 add -lilocplex -lconcert -lcplex in "other linker flags"
我认为您也需要将源文件的名称 (hello.cpp
) 放在命令行上的所有链接器内容之前。
查看链接 - here .
关于c++ - 通过命令行在 Mac 上编译 Cplex 程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37571202/