简体   繁体   中英

gcc Link Order issue

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

Which problem are you having ?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM