错误: fatal error C1083: Cannot open include file: 'iostream.h': No such file or directory
我的源代码测试回调函数,编译不通过,出现如上错误。
原因:
将#include <iostream.h>改为
#include <iostream>using namespace std;
新的c++标准库摒弃了.h的头文件形式,因此是没有iostream.h文件的。在老的编辑环境中,例如VC6里面,iostream.h的形式还是存在的,因此你的程序在VC6里面是可以编译通过的。但是vs2005及以上的版本,对应新的c++标准,引入了名字空间的概念,没有.h的形式。
我的错误源码:
#include "stdafx.h"
#include "windows.h"
#include <iostream.h>
//回调函数指针
typedef int(WINAPI* WNDCALLBACK)(int*,int*);
//回调函数
int __stdcall Call(int *a,int *b);
//定义类
class A
{
public:
//比较两个数字大小
int Compare(int m,int n,WNDCALLBACK function)
{
int *a=&m;
int *b=&n;
return (*function)(a,b);
}
};
int main(int argc, char* argv[])
{
int a=10;
int b=6;
A m_a;
cout<<m_a.Compare(a,b,Call)<<endl;
return 0;
}
//回调函数
int CALLBACK Call(int *a,int *b)
{
return *a>(*b)?(*a):(*b);
}
分享到:
相关推荐
网友分享的能够解决fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory问题的程序。MySQL-python-1.2.3.win32-py2.7.exe-32位MySQL-python-1.2.3.win-amd64-py...
fatal error C1083: Cannot open include file: 'io.h': No such file or directory
fatal error C1083: 无法打开包括文件:“stdint.h”: No such file or directory. stdint.h是c99标准的头文件,vc不支持,所以肯定会提示“No such file or directory”的。使用方法:下载压缩包,解压得到两个.h...
下载该文件后,分别将glaux.h、glaux.dll、glaux.lib拷贝到VS2013的安装目录即:VS2013/VC/lib ; VS2013/VC/bin ; VS2013/VC/include/GL中,重新编译即可。
fatal error C1083: 无法打开包括文件:“stdint.h”: No such file or directory. stdint.h是c99标准的头文件,vc不支持,所以肯定会提示“No such file or directory”的。
error C1083: 无法打开包括文件:“pthread.h”: No such file or directory cocos2d-x-2.1.5\extensions\AssetsManager\AssetsManager.h 30 1 AssetsManagerTest
在VS2008中,经常会遇到“fatal error C1083: 无法打开包括文件:“afxcontrolbars.h””这样的问题,该文档提供了一个解决方案。
Python安装MySQL文件,EXE文件 ..._mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory 原来还是驱动问题,不管mysql的事。 希望该安装包对你有所帮助~
_mysql.c(42) : fatal error C1083: Cannot open include file: 'config-win.h': No such file or directory error: Microsoft Visual C++ 9.0 is required. Get it from http://aka.ms/vcpython27 希望软件对您...
LINK : fatal error LNK1104: cannot open file "mfc42u.lib"-附件资源
fatal error C1083: 无法打开包括文件:“inttypes.h”: No such file or direct
fatal error: zmq.hpp: No such file or directory compilation terminated. 找不到zmq.hpp的原因是, zmq.hpp只存在master中。 如果你使用release版本,那么是没有zmq.hpp这个文件的。去master中找到zmq.hpp。 将...
加载sklearn库有可能遇到Intel MKL FATAL ERROR: Cannot load mkl_intel_thread.dll 问题,解决卸载掉numpy,scipy,sklearn三个库重新安装,资源的版本为py35,cpu,64位,全程分别为numpy-1.15.4+mkl-cp35-cp35m-win_...
VS2010没有inttypes.h文件,程序运行时无法打开包括文件:“inttypes.h”: No such file or directory,解决方案。
fatal error: pcre2.h: No such file or directory 27 | #include "pcre2.h" 安装swoole遇到错误,把pcre2.h 放到、usr/include下
18年7月更新,清华镜像,完美解决 Yocto,Android fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle 错误,绕开GFW
fatal error: boostdesc_bgm.i: No such file or directory补充文件
2、fatal error C1083: Cannot open include file: 'R…….h': No such file or directory 不能打开包含文件“R…….h”:没有这样的文件或目录。 3、error C2011: 'C……': 'class' type redefinition 类“C……...
用于解决错误: fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory fatal error C1083: 无法打开包括文件:“stdint.h”: No such file or directory stdint.h是c99标准的头文件...