编译在Eclipse中使用gcc的-lpthread和-lrt集 [英] Compiling in Eclipse with gcc's -lpthread and -lrt set
问题描述
我目前正在使用Eclipse开发一些code,我已经在用C文本编辑器一直在做。
I am currently trying to use Eclipse to develop some code that I've been doing in a text editor in C.
我目前在Linux下,海湾合作委员会与以下参数编译它:
I am currently under Linux, compiling it with GCC with the following arguments:
gcc -o SO SO.c -lpthread -lrt
我试着加入 - lpthread -lrt
Eclipse的C / C ++生成 - >查找选项 - >编译器调用参数,但它似乎无济于事。
I've tried adding "-lpthread -lrt"
to Eclipse's "C/C++ Build"->"Discovery Options"-> "Compiler Invocation Arguments" but it seems of no avail.
我也试过在C / C ++生成 - >查找选项 - >设置,但似乎并没有做到这一点,太
I also tried on "C/C++ Build"->"Discovery Options"-> "Settings" but that doesn't seem to do it, too.
如何可能会覆盖Eclipse的GCC命令行参数?
How may I override Eclipse's GCC command line arguments?
推荐答案
在项目属性,进入:C / C ++编译 - >设置。结果
然后选择工具设置,选择库,连接器下。结果
您可以添加所有的项目库有(不带-l)。此外,在下部,你可以添加到检索库自定义路径。
In the project properties, go to : C/C++ Build --> Settings.
Then "Tool Settings", select "Libraries" under "Linker".
You can add all your project libraries there (without the "-l"). Also in the lower part, you can add custom path to search libraries.
这篇关于编译在Eclipse中使用gcc的-lpthread和-lrt集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!