Compiling in Eclipse with gcc's -lpthread and -lrt set

后端 未结 2 2040
日久生厌
日久生厌 2020-12-19 13:30

I am currently trying to use Eclipse to develop some code that I\'ve been doing in a text editor in C.

I am currently under Linux, compiling it with GCC with the fol

相关标签:
2条回答
  • 2020-12-19 13:48

    -lpthread and -lrt are passed to the linker, not the compiler. There should be some way in Library to add these as new libraries.

    0 讨论(0)
  • 2020-12-19 14:08

    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.

    0 讨论(0)
提交回复
热议问题