Eclipse CDT Indigo CLOCKS_PER_SEC无法解决问题 [英] Eclipse CDT Indigo CLOCKS_PER_SEC could not be resolved issue

查看:95
本文介绍了Eclipse CDT Indigo CLOCKS_PER_SEC无法解决问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道这是一个错误还是我唯一遇到的错误,

I dont know if this is a bug or i am the only one facing this,

在Eclipse CDT indigo中,创建一个新的C ++可执行项目并创建一个CPP C ++源文件夹中的文件。 src / test.cpp

In Eclipse CDT indigo, create a new C++ executable project and create a CPP file in a C++ source folder.i.e. src/test.cpp

#include<iostream>
#include<ctime>
using namespace std;
int main()
{
    clock_t strt = clock();
    int i = 2;
    clock_t end = clock();
    cout<<(end-strt)*1000.0f/CLOCKS_PER_SEC;
    return 0;
}

现在看到CLOCKS_PER_SEC尚未解决,但是项目编译成功并且运行正常。我使用的是Ubuntu 10.10 64位。这是一个错误还是某些设置搞砸了(索引器?)?

now see that the CLOCKS_PER_SEC is unresolved, but project compiles sucessfully and runs fine too. I am on ubuntu 10.10 64 bit. Is this a bug or some settings screw up ( indexer? ) ?

推荐答案

您可以手动将time.h添加到索引器中,请转到偏好设置-> C / C ++->索引器,然后将其放在现有的要预先建立索引的文件的前面:

You can manually add the time.h to the indexer, go to Preferences -> C/C++ -> Indexer and put it in front of the existing "Files to be indexed up-front" like this:

time.h, cstdarg, ...

然后它应该可以正常工作

Then it should work just fine.

这篇关于Eclipse CDT Indigo CLOCKS_PER_SEC无法解决问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆