Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 332384

Summary: how to define links to libraries like semaphore.h or mat.h
Product: [Tools] CDT Reporter: xtremelu
Component: cdt-buildAssignee: cdt-build-inbox <cdt-build-inbox>
Status: CLOSED INVALID QA Contact: Andrew Gvozdev <angvoz.dev>
Severity: critical    
Priority: P3 CC: cdtdoug
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description xtremelu CLA 2010-12-11 22:32:01 EST
Build Identifier: M20100211-1343

I'm using libraries semaphore.c and math.c which requires some arguments to link them on compilation time, using terminal works like:

bash$ gcc -o name name.c -lm -pthread -lrt

I need to set that options (-lm -pthread -lrt) when building the binary file from eclipse, otherwise I get errors informing that the fuctions which belongs to those libraries are undefined, and I can't run my program from eclipse.

I want to compile, say build binary, passing that options to gcc, in order to build links to those libraries.

BR.
LP

Reproducible: Always

Steps to Reproduce:
1.#include <math.h>
  #include <semaphore.h>
2.try to use pow() or sem_wait()
3.try to build binary
Comment 1 Andrew Gvozdev CLA 2010-12-11 23:54:16 EST
Please, use bugzilla for reporting bugs only. For questions use user forums http://www.eclipse.org/forums/ and select CDT. You are more likely to get help there anyway. We do not do user support here.