Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » symbol 'CLOCK_PROCESS_CPUTIME_ID' cannot be resolved?(I have all the necessary includes, but it still won't recognise?)
symbol 'CLOCK_PROCESS_CPUTIME_ID' cannot be resolved? [message #1065001] Sat, 22 June 2013 22:56 Go to next message
R G is currently offline R GFriend
Messages: 5
Registered: June 2013
Junior Member
Hi, Eclipse Indigo CDT won't recognise CLOCK_PROCESS_CPUTIME_ID in my program (below). It can, however, recognise clock_gettime()! Can someone please help? The code executes, just Eclipse CDT highlights it as a syntax error (which it shouldn't).

#include <iostream>
#include <time.h>

using namespace std;

timespec diff(timespec start, timespec end);

int main()
{
timespec time1, time2;
char b = 'A';
bool result;
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &time1);
result = (b < 58 & b > 47);
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &time2);
return 0;
}

I have the following in my discovery options:

-E -P -v -dM ${plugin_state_location}/${specs_file}
Re: symbol 'CLOCK_PROCESS_CPUTIME_ID' cannot be resolved? [message #1065004 is a reply to message #1065001] Sat, 22 June 2013 23:43 Go to previous messageGo to next message
R G is currently offline R GFriend
Messages: 5
Registered: June 2013
Junior Member
Ok to solve this I had to go into my project settings, "Indexer" and there is a list of header files you index "up front". I added "time.h" to this list and then rebuilt the project.

Absolutely no idea why this is required?! Can someone please tell me? Otherwise I may encounter this time and time again?
Re: symbol 'CLOCK_PROCESS_CPUTIME_ID' cannot be resolved? [message #1065043 is a reply to message #1065004] Mon, 24 June 2013 03:42 Go to previous message
Nobody Mising name is currently offline Nobody Mising nameFriend
Messages: 75
Registered: July 2010
Member
Using MinGW GCC 4.7.2 and there are no problems with this macro:
http://i41.tinypic.com/2w1sb2f.png

Discovery options string:
Quote:
-E -P -v -dD -std=c++11 "${plugin_state_location}/specs.cpp"

[Updated on: Mon, 24 June 2013 03:45]

Report message to a moderator

Previous Topic:Set C++ include/linker settings for all projects, not just per project?
Next Topic:non-stop mode is not supported when using gdb from cygwin
Goto Forum:
  


Current Time: Thu Mar 28 09:40:42 GMT 2024

Powered by FUDForum. Page generated in 0.02224 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top