解决Visual Studio 2019运行C++时无法打开源(头)文件time的问题

今天写代码,因为想计算程序的运行时间,需要使用time头文件里的功能,所以包含了头文件time(#include<time.h>),但是我写完后include就标红了,报错提示“无法打开源文件 time”,在网上查到了好几种解决方法,都不奏效,最后灵机一动,在配置里的包含目录里加入time文件的路径,终于解决了。以下为操作步骤:
1.选择调试下的Project属性
在这里插入图片描述2.选择配置属性下的VC++目录,点击包含目录右侧的小箭头,选择编辑
在这里插入图片描述3.点击右下角的
在这里插入图片描述4.在右侧新弹出的窗口的最上方输入框输入time
在这里插入图片描述5.将下面出现的第一条内容的名称抄到左侧上方编辑区,然后点击确定
在这里插入图片描述另外,我发现,执行上述操作以后,去掉文件后缀仍然会报错,因此在Visual Studio 2019中使用time源文件必须加后缀。
在这里插入图片描述加了后缀之后。
在这里插入图片描述

  • 5
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
Visual Studio 2019 is an integrated development environment (IDE) developed by Microsoft. It is used to develop software applications for Windows, Android, iOS, web, and cloud-based platforms. Visual Studio 2019 supports several programming languages, including C++, C#, Visual Basic, F#, JavaScript, Python, and more. Some of the key features of Visual Studio 2019 include: 1. Improved performance: Visual Studio 2019 is faster and more responsive than its predecessors, making it easier to develop complex applications. 2. Enhanced collaboration: Visual Studio 2019 includes tools that enable developers to work together more efficiently. For example, Live Share allows developers to collaborate in real-time, regardless of their location. 3. Better debugging: Visual Studio 2019 includes improved debugging tools that help developers identify and fix issues more quickly. 4. Advanced AI-assisted code completion: Visual Studio 2019 features IntelliSense, which is an AI-assisted code completion tool that helps developers write code more efficiently. 5. Cloud integration: Visual Studio 2019 includes tools that make it easier to develop cloud-based applications. For example, it includes Azure DevOps, which is a set of tools for managing and deploying applications on the Azure cloud platform. 6. Cross-platform development: Visual Studio 2019 supports cross-platform development, allowing developers to create applications for Windows, Android, iOS, and other platforms from a single development environment.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

赴星辰大海

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值