gcc链接订单问题 [英] gcc Link Order issue

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

问题描述

我目前在编译以下行时遇到问题:

I am currently having problems compiling with the following line:

gcc test.c -I/usr/include -L/lib -lipc -lpcd -lrt -o /home/examples/bin/test

建议我使用开始组和结束组对它们进行分组.

I was suggested to group them using start-group and end-group.

我无法获得正确的语法.

I am not able to get the proper syntax.

我认为我需要这部分,但是整行是什么样的?

I think i need this part, but what do the whole line look like?

-Wl,--start-group -lipc -lpcd -lrt -Wl,--end-group

推荐答案

您遇到什么问题?

无论如何,请尝试将链接器参数放在最后:

Anyway, try putting the linker arguments at the end:

gcc test.c -o /home/examples/bin/test -I/usr/include -L/lib -lipc -lpcd -lrt

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

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