我在 ubuntu 12.04 上安装 pyipopt 时遇到问题。在链接期间,我收到错误:
/usr/bin/ld: 找不到 -lcoinhsl
即使我知道这个库已经安装并且 .so 和 .la 文件在/home/mostafa/MyBuilds/CoinIpopt/build/lib/
有人对此有解决方案吗?
下面是运行 setup.py build 的完整返回:
root@ubuntu:~/MyBuilds/pyipopt# sudo python setup.py build 运行构建 运行 build_ext 构建“pyipopt”扩展 gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/home/ mostafa/MyBuilds/CoinIpopt/build/include/coin/ -I/usr/include/python2.7 -c src/callback.c -o build/temp.linux-x86_64-2.7/src/callback.o gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/lib/python2.7/dist-packages/numpy/core/include -I/home/ mostafa/MyBuilds/CoinIpopt/build/include/coin/ -I/usr/include/python2.7 -c src/pyipopt.c -o build/temp.linux-x86_64-2.7/src/pyipopt.o src/pyipopt.c:在函数“set_intermediate_callback”中: src/pyipopt.c:452:15:警告:变量“myowndata”设置但未使用[-Wunused-but-set-variable] gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relrobuild/temp.linux-x86_64-2.7/src/callback.o build/temp.linux -x86_64-2.7/src/pyipopt.o -L/home/mostafa/MyBuilds/CoinIpopt/build/lib/ -lipopt -lblas -lcoinhsl -lcoinmetis -llapack -ldl -lm -o build/lib.linux-x86_64-2.7 /pyipopt.so -Wl,--rpath -Wl,/home/mostafa/MyBuilds/CoinIpopt/build/lib/ /usr/bin/ld: 找不到 -lcoinhsl collect2: ld 返回 1 个退出状态 错误:命令“gcc”失败,退出状态为 1