ld:找不到 -lgsl 的库 [英] ld: library not found for -lgsl

查看:29
本文介绍了ld:找不到 -lgsl 的库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 OSX 中工作,我正在尝试运行一个 make 文件,当我尝试时,我得到以下信息:

I'm working in OSX and I'm attempting to run a make file and when I try I get the following:

ld: library not found for -lgsl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [harm] Error 1

早些时候我发现我需要获取 gsl 库,我使用 mac 端口并输入:

Earlier I found out the I needed to get the gsl library and I used mac ports and typed:

sudo port install gsl

进入我的命令行窗口,它似乎没有问题.缺少的 lgsl 是没有正确配置还是没有随 gsl 一起提供?我尝试谷歌搜索 lgsl 但没有得到太多.我只接触了几天的编程,我不知道我是否应该设置路径,甚至不知道该怎么做.

into my command line window and it seemed to isntall okay. Is the missing lgsl not configured correctly or does it not come with gsl? I tried googling lgsl but didn't get much. I've only been at programming a few days and I don't know if I was supposed to set a path, or even really how to do that.

感谢你们提供的任何帮助.

Thanks for any help you guys could offer.

推荐答案

我只想说我在 OSX 上遇到了确切的问题.我没有设置环境变量,而是使用了一个额外的编译器标志 -L/opt/local/lib,然后允许使用 -lgsl.我参考了这个答案.

I just wanted to say that I had the exact problem on OSX. Rather than setting an environment variable, I used an additional compiler flag -L/opt/local/lib, which then lets one use -lgsl. I reference this answer.

这篇关于ld:找不到 -lgsl 的库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆