GCC链接选项 [英] GCC Linking Options

查看:103
本文介绍了GCC链接选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是建筑界的新手.我一直让我的IDE帮我解决这个问题,但是现在我正在使用自动工具和命令行.

I'm new to the world of building. I've always let my IDE take care of it for me, but now I'm working with autotools and command line.

有人可以解释一下gcc的区别
-l LIBNAME - Search for library LIBNAME
-L DIRECTORY - Add DIRECTORY to library search path

Could someone explain the difference between gcc's
-l LIBNAME - Search for library LIBNAME
and -L DIRECTORY - Add DIRECTORY to library search path

是否可以通过任何一个完成相同的链接,而这只是使用的样式首选项?还是实际上发生了严重的不同?

Can the same linking be accomplished with either and it's just a style preference which gets used? Or is there actually something seriously different happening?

谢谢

安德鲁

推荐答案

通常,您同时使用这两种方法:

Usually you use both:

  • -l libname指定要链接的库,请考虑单个文件.
  • -L指定链接器应在其中查找路径(除了标准路径之外),思考目录

这篇关于GCC链接选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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