我是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 ==========
答案 0 :(得分:2)
您需要使用#include <StdAfx.h>
作为项目中每个.cpp文件的第一行。那是因为StdAfx.h是预编译头,并且有一些特殊规则适用于它。因此,即使您不使用它,也必须包含它。