U++ framework
Do not panic. Ask here before giving up.

Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » missing library - linking error
missing library - linking error [message #12437] Tue, 30 October 2007 17:26 Go to next message
pippo is currently offline  pippo
Messages: 17
Registered: October 2007
Location: Italy
Promising Member
I'm compiling a simple program and I'm using a time variable.
I'm including <time.h> because I want to use the clock_gettime() function to retrieve the system time clock.
The only think I get back it's a linking error reported below:

Linking...
/home/user/upp/out/CodaArtigianale/GCC.Debug.Gui.Main.Mt.Shared/CodaArtigianale.o: In function `MS_CodaArtig::funzione_suo()':
CodaArtigianale.cpp:(.text+0x49): undefined reference to `clock_gettime'
collect2: ld returned 1 exit status

There were errors. (0:04.00)


Can someone say to me which library I have to include in my project?


10aa3a8774daeb994a88cc07572e2b6c
Re: missing library - linking error [message #12442 is a reply to message #12437] Wed, 31 October 2007 18:11 Go to previous message
willysignori is currently offline  willysignori
Messages: 4
Registered: September 2007
Location: Italy
Junior Member
Hi PIPPO,

the "clock_gettime()" is inserted into the library LIBRT (Ubuntu 7.04).
Often it's used the function "gettimeofday" with less resolution (microsecond instead of nanosecond) but enough for most of applications.
Under U++ you have to add the library to your project; to do this you have to:
1) menu PROJECT -> Package organizer
2) on the right frame, click right mouse button and add new LIBRARY row
3) type "rt" (to link "librt" library, because suffix "lib" is "added" by default by GNU linker) and press OK


Bye.
Previous Topic: linking difficulties under msvc
Next Topic: Question about Memory Leak Detection
Goto Forum:
  


Current Time: Sat Apr 25 19:53:16 GMT+2 2026

Total time taken to generate the page: 0.00693 seconds