需要有关在VS2010中运行程序的帮助

时间:2012-12-29 14:00:30

标签: c++ visual-studio-2010 opencv compiler-errors

我是VS201O和OpenCV编程的新手。我正在尝试实现SIFT算法。谁能告诉我这些错误代表什么?如果有人需要整个程序,我会发给他。 先感谢您。你的帮助真的很宝贵。

以下是错误:

1>------ Build started: Project: sift, Configuration: Debug Win32 ------
1>  sift.cpp
1>c:\users\dell\documents\visual studio 2010\projects\sift\sift\sift.cpp(2): warning            C4627: '#include <iostream>': skipped when looking for precompiled header use
1>          Add directive to 'StdAfx.h' or rebuild precompiled header
1>c:\users\dell\documents\visual studio 2010\projects\sift\sift\sift.cpp(3): warning C4627: '#include "opencv2/core/core.hpp"': skipped when looking for precompiled header use
1>          Add directive to 'StdAfx.h' or rebuild precompiled header
1>c:\users\dell\documents\visual studio 2010\projects\sift\sift\sift.cpp(4): warning C4627: '#include "opencv2/features2d/features2d.hpp"': skipped when looking for precompiled header use
1>          Add directive to 'StdAfx.h' or rebuild precompiled header
1>c:\users\dell\documents\visual studio 2010\projects\sift\sift\sift.cpp(5): warning C4627: '#include "opencv2/highgui/highgui.hpp"': skipped when looking for precompiled header use
1>          Add directive to 'StdAfx.h' or rebuild precompiled header
1>c:\users\dell\documents\visual studio 2010\projects\sift\sift\sift.cpp(83): fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "StdAfx.h"' to your source?
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

1 个答案:

答案 0 :(得分:2)

您需要使用#include <StdAfx.h>作为项目中每个.cpp文件的第一行。那是因为StdAfx.h是预编译头,并且有一些特殊规则适用于它。因此,即使您不使用它,也必须包含它。