加上#include<windows.h>后出现的奇葩错误
来源:互联网 发布:滴滴快车车主软件 编辑:程序博客网 时间:2024/05/22 00:13
先来看一个没错的程序:
#include <iostream>using namespace std;struct Rectangle {int width;int height;};int main(){Rectangle rect;return 0;}
加上#include<windows.h>就有错:
#include <windows.h>#include <iostream>using namespace std;struct Rectangle {int width;int height;};int main(){Rectangle rect;return 0;}原来的程序很大, 我通过不断缩减的方法才定位到, 是Rectangle出了问题, 原因是Windows早已有了。 可以改为正确程序如下:
#include <windows.h>#include <iostream>using namespace std;struct xxxRectangle {int width;int height;};int main(){xxxRectangle rect;return 0;}
0 0
- 加上#include<windows.h>后出现的奇葩错误
- 加上#include<windows.h>后出现的奇葩错误
- 添加#include "windef.h"后出现编译错误的解决办法
- 解决windows下eclipse创建project时没有include导致出现“unresolved inclusion: <stdio.h>”错误的方法
- 解决在头文件加入#include"winsock2.h"后出现重复定义的办法
- VS2008的项目出现错误“找不到windows.h”的解决办法
- VS2008的项目出现错误“找不到windows.h”的解决办法
- evc 编译网上下载的SDK时候,出现错误Cannot open include file: 'pkfuncs.h'
- VC6.0编程用到#include <unistd.h>编译时出现的错误及解决方法
- 关于VC++错误提示WINDOWS.H already included. MFC apps must not #include 的处理办法。
- Windows编程之cannot open include“d3dx9.h”错误
- JSP中使用include指令出现“Duplicate local variable basePath”错误提示后的发现
- #include <Windows.h> 和 <Winsock2.h>冲突的改进解决方案
- #include <Windows.h> 和 <Winsock2.h>冲突的改进解决方案
- linux标准库#include <unistd.h>与windows的#include <windows.h>(C语言开发)
- linux标准库#include <unistd.h>与windows的#include <windows.h>(C语言开发)
- linux标准库#include <unistd.h>与windows的#include <windows.h>
- 编译mysql5.1.68 make时候出现./include/my_global.h:1088: 错误:对 C++ 内建类型 ‘bool’ 的重声明
- 《C#高级教程》学习笔记3
- 指针比两数大小
- Codeigniter MongoDB 扩展之使用 Aggregate 方法实现 Mysql 的 Sum 方法
- 第四章字符串和多维数组知识点导图
- Android开发中WindowManager.LayoutParams详解
- 加上#include<windows.h>后出现的奇葩错误
- 第五章树和二叉树知识点导图
- 第六章图知识点导图
- 指针调用函数求两数和与差
- iOS APP 架构漫谈(二)
- iphone自定手机铃声
- git clone error: RPC failed; result=52, HTTP code = 0 fatal: The remote end hung up unexpectedly
- Ubuntu-关于bashrc与profile的区别
- HDU 1878 欧拉回路 【并查集+欧拉图】