Visual Studio在调试代码时跳过头文件
Visual Studio is skipping the header files while debugging the code
我正在尝试使用opencv运行面部检测程序。我已经正确地在属性中包含opencv库的路径,但程序仍然给出错误,未能构建可执行文件并在调试期间跳过头文件,并给出这些消息:
1> Add directive to 'stdafx.h' or rebuild precompiled header
1>.avi2.cpp(241) : fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?
1>Build log was saved at "file://c:UsersAbdullahDocumentsVisual Studio 2008Projectsavi2avi2ReleaseBuildLog.htm"
1>avi2 - 1 error(s), 10 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
avi2.cpp
配置为使用预编译头文件。为了使这个特性工作,编译器期望第一个非空白/非注释行代码是#include "stdafx.h"
。它不在那里,所以你会得到这个错误。
要解决这个问题,您可以禁用预编译头为.cpp文件错误,或添加#include
使其工作
您的项目设置为使用预编译头文件,但您还没有提供一个。项目中的每个文件都应该将#include "stdafx.h"
作为第一行。
所以,取决于你是否想要使用它们,要么添加包含,要么将项目设置更改为'不使用预编译头'
如果使用预编译头文件,每个cpp
文件的第一个非注释行必须是#include "stdafx.h"
。之前的所有行都被忽略。
必须是第一个 include。
查看来自Microsoft的KB
相关文章:
- 在C++代码中包含opencv时,使用ctypes创建.so文件
- 此代码编译良好,但文件未创建?请指出错误
- 找不到Linux Visual Studio代码C++文件
- C++(.cpp文件和.h文件)拆分代码并添加一个函数,提取 - 这很容易吗?
- 如何使代码打印文本文件中的第一行?
- 编译多个C++文件.调用二进制文件以运行代码
- VI工作室代码错误无法打开输出文件主.exe
- 获取 clang++:错误:在编译文件系统库的代码时
- 如何在软件代码中使用ofstream创建文件
- 我可以删除 *.o文件(代码:: blocks)
- 用于人脸检测的Haar级联xml文件代码解释OpenCV
- 如何直接从分配的内存中执行mmaped二进制文件/代码
- 文件 I/O 代码未正确读取C++
- 单个文件代码中未定义的引用错误
- 将数组写入文件代码不起作用(C++)
- IO文件代码不一致
- 如何在单个文件C++代码中使用库
- 是否有可能改变.so文件代码在android工作室本身,并使构建
- 疑难解答阅读CSV文件代码
- Bazel头文件代码生成器