"error: 'clock_gettime' was not declared in this scope" and "error: 'CLOCK_MONOTONIC"
Usung qt 4.8.1 unde windows. compiling "pure" c++ code i get the following errors:
Code:
trigwiz.h:149: error: 'CLOCK_MONOTONIC' was not declared in this scope
trigwiz.h:149: error: 'clock_gettime' was not declared in this scope
I know clock_gettime is in rt library and so i modified the .pro file as following:
Code:
TEMPLATE = app
CONFIG += console
CONFIG -= qt
SOURCES += main.cpp \
trigwiz.cpp
HEADERS += \
trigwiz.h
LIBS += -lpthread -lrt
unfortunately it was unsuccessfull...
Re: "error: 'clock_gettime' was not declared in this scope" and "error: 'CLOCK_MONOTO
you have a compiler error. so address the c++ compiler error. This has nothing to do with Qt.
http://linux.die.net/man/3/clock_gettime
Re: "error: 'clock_gettime' was not declared in this scope" and "error: 'CLOCK_MONOTO
It has to do with the windows qt environment and the way it spread the file in the filesystem....
How can I check wether the lib is correctly reachable (presence/lib path) by the linker?
Moreover the time.h include should contain the CLOCK_MONOTONIC define. Where can I find it ?
Quote:
Originally Posted by
amleto
Re: "error: 'clock_gettime' was not declared in this scope" and "error: 'CLOCK_MONOTO
Quote:
Originally Posted by
brunialti
It has to do with the windows qt environment and the way it spread the file in the filesystem....
Qt environment doesn't spread any files anywhere.
Quote:
How can I check wether the lib is correctly reachable (presence/lib path) by the linker?
You can compile a program that uses it. If it fails, then it is not reachable.
Quote:
Moreover the time.h include should contain the CLOCK_MONOTONIC define. Where can I find it ?
time.h? Probably in the place where you had put it. I don't see what Qt has to do with it. You're not even using Qt anywhere: