rookee
11th December 2015, 15:06
Hello All,
I'm getting the following error while accessing real time clock.
I have the following in my glbs.cpp file. Included both glbs.cpp and glbs.h in mainwindow.cpp headers
struct timespec gettime_now;
Here's the code in mainwindow.cpp
clock_gettime(CLOCK_REALTIME, &gettime_now);
fprintf(file1, "%li %i", (gettime_now.tv_sec+(gettime_now.tv_nsec/1000000)
Here's the error I'm getting:
mainwindow.o: undefined reference to symbol 'clock_gettime@@GLIBC_2.4'
error adding symbols: DSO missing from command line
collect2: Id returned 1 exit status
I looked up online and few of the posts said to add -lrt to the makefile, I added "-lrt" to the end of the line in mainwindow.o. Still I'm getting the same error. One of the posts says "try Project -> Build Options -> Linker Settings ; then add library rt" I didn't understand where to do that. I'm using Qt4.8.1(Qt Creator 2.5). Please help. It's a little urgent. Thanks in advance.
I'm getting the following error while accessing real time clock.
I have the following in my glbs.cpp file. Included both glbs.cpp and glbs.h in mainwindow.cpp headers
struct timespec gettime_now;
Here's the code in mainwindow.cpp
clock_gettime(CLOCK_REALTIME, &gettime_now);
fprintf(file1, "%li %i", (gettime_now.tv_sec+(gettime_now.tv_nsec/1000000)
Here's the error I'm getting:
mainwindow.o: undefined reference to symbol 'clock_gettime@@GLIBC_2.4'
error adding symbols: DSO missing from command line
collect2: Id returned 1 exit status
I looked up online and few of the posts said to add -lrt to the makefile, I added "-lrt" to the end of the line in mainwindow.o. Still I'm getting the same error. One of the posts says "try Project -> Build Options -> Linker Settings ; then add library rt" I didn't understand where to do that. I'm using Qt4.8.1(Qt Creator 2.5). Please help. It's a little urgent. Thanks in advance.