编译错误标识符“clock_t”未定义 [英] Compile error identifier "clock_t" is undefined

查看:1951
本文介绍了编译错误标识符“clock_t”未定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Visual Studio 2015中编译一个新项目,我收到一条错误消息:

I'm compiling a new project in Visual Studio 2015 and I am getting an error stating:

Severity	Code	Description	Project	File	Line	Suppression State
Error (active)		identifier "clock_t" is undefined	WinUsbProj	c:\Users\kris\Documents\Visual Studio 2015\Projects\WinUsbProj\WinUsbProj\canvas_usb.cpp	94	

它遇到问题的源代码如下:

The source code that it is having a problem with is the following:

clock_t nextRetryTime = (clock_t)RETRY_DELAY;

它不知道 clock_t 是什么。 如果我右键单击
clock_t
并选择转到定义,Visual Studio 2015会声明:"无法找到符号'clock_t'的定义" 。

It does not know what clock_t is.  If I right click on clock_t and select Go To Definition, Visual Studio 2015 states: "A definition fir the symbol 'clock_t' could not be located".

我有另一个较旧的项目,如果我查看相同的源代码并右键单击
clock_t 并选择转到定义,Visual Studio打开" C:\Program Files(x86)\ Windows Wits\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ;。

I have another older project where if I look at the same source code and right click on clock_t and select Go To Definition, Visual Studio opens "C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt\time.h".

为什么一个项目可以找到这个文件而另一个项目不能找到? 我已经确认它们的包含路径值相同。

Why is it that one project can find this file and the other can't?  I've already verified that they have the same values for the include path.

推荐答案

>它不知道 clock_t 是什么。如果我右键单击
clock_t 并选择转到定义,Visual Studio 2015将声明:"无法找到符号'clock_t'的定义" 。

>It does not know what clock_t is.  If I right click on clock_t and select Go To Definition, Visual Studio 2015 states: "A definition fir the symbol 'clock_t' could not be located".

大概你的源文件丢失了:

Presumably your source file is missing:

#include< time.h>

#include <time.h>

戴夫

<


这篇关于编译错误标识符“clock_t”未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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