error C4430: missing type specifier - int assumed. Note: C++ does not ...(转)

来源:互联网 发布:电视围棋直播软件 编辑:程序博客网 时间:2024/06/16 16:33

error C4430: missing type specifier - int assumed. Note: C++ does not ...(转)  

2011-07-06 23:37:58|  分类:编程 |举报|字号 订阅

AdapterBase.cpp
WINVER not defined. Defaulting to 0x0502 (Windows Server 2003)
c:\dxsdk\samples\c++\directshow\baseclasses\ctlutil.h(276) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\dxsdk\incl?\uuids.h : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss

使用VS的时候总是出些很棘手的错误,

看起来一切都正常,什么都没有错,可就是编译不通过。有时候出的错误让你苦笑不得。

往往会折腾上半天甚至好几天,让你编程的热情一下就降到了冰点!!!!


比如说下面这个例子,我昨天碰到的,折腾到今天才搞定,苦啊!:
C:\Program Files\Microsoft Vis l St io 8\VC\PlatformSDK\incl?\winnt.h(222) : 
error C2146: syntax error : missing ';' before identifier 'PVOID64' 

C:\Program Files\Microsoft Vis l St io 8\VC\PlatformSDK\incl?\winnt.h(222) : 
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Program Files\Microsoft Vis l St io 8\VC\PlatformSDK\incl?\winnt.h(5940) : 
error C2146: syntax error : missing ';' before identifier 'B?r' 

C:\Program Files\Microsoft Vis l St io 8\VC\PlatformSDK\incl?\winnt.h(5940) : 
error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

C:\Program Files\Microsoft Vis l St io 8\VC\PlatformSDK\incl?\winnt.h(5940) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

winnt.h都出错了!!!!,真是荒唐。

这样的错误也确实没有办法,只能 去BBS找,你去想吧,让你想半年也想不通!!

我在MSDN的开发论坛里找到答案的

贴出来,希望碰到同样的问题的同志能节省点时间吧。

原因:incl? file 的顺序引起的。可能你的项目文件与默认的包含文件产生了冲突

解决方法

VS2005:

Tools->Options->Projects and Solutions->VC++ Directories->在左边选择
Incl? files

在这里加入你的
Incl? files,比如说你的程序要用到directX sdk.这里加上了也比较方便。以后

建类似的工程不用再重复添加这些
Incl? files了。但是要注意顺序,VS老大的默认Incl? files

你要给它排最前面,你的
Incl? files要排后面。并且把你在工程属性(project ->properties)里添加的

Incl? files删掉,你在这里添加的Incl? files 它会排在 VS默认的Incl? files前面,因此引起了冲突。

(你添加的SDK里可能已经包含了其他版本的winnt.h).

真是苦涩啊。忙乎了大半天,就是为了解决这么个选项!!!!
error C4430: missing type specifier - int assumed. Note: C++ does not ...(转) - 流浪者 - 流浪地图

解决这个问题的同时,我又想起以前出 的错误。

我的程序要使用一些lib,于是我手脚麻利的加库 加头文件。

不一会就卡壳了。link通不过。说无法解析一个外部函数(在我使用lib里)。

这不,我明明把lib 添加到项目里了么,明摆着在那里。可它就是说你缺个外部函数

我又是重建工程,又是一顿加库。可就是不管用。

当时那个沮丧
error C4430: missing type specifier - int assumed. Note: C++ does not ...(转) - 流浪者 - 流浪地图。后来找到老师,老师也是看了半天。不过最后总算解决了。

问题出在lib的编译模式采用的是Compile as C Code (/TC)

而我的工程使用的是Compile as C++ Code (/TP),匹配不上,所以找不到!

这个选项在工程的Properties->Configuration Properties->C/C++->Advanced->Compile as

里面。

为了这个选项又折腾两天,何其苦哇。

呵呵,当然最主要问题还是,,,,--128#%##……

我是个大菜鸟
error C4430: missing type specifier - int assumed. Note: C++ does not ...(转) - 流浪者 - 流浪地图!特意贴出来,希望大家少折腾哇!

0 0
原创粉丝点击