vc++编译错误什么意思???

来源:百度知道 编辑:UC知道 时间:2024/09/24 01:42:28
Compiling...
Dib1.cpp
e:\xiu\dib1.cpp(5) : warning C4652: compiler option 'Generate Browser Info' inconsistent with precompiled header; current command-line option will override that defined in the precompiled header
Linking...
Dib1.obj : error LNK2001: unresolved external symbol _DrawDibRealize@12
Debug/xiu.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.
还有关于头文件的问题,总是出现如下错误:
e:\xiu\dib1.cpp(5) : warning C4652: compiler option 'Generate Browser Info' inconsistent with precompiled header; current command-line option will override that defined in the precompiled header
解释正确即可得分。奖励50分!

error LNK2001: unresolved external symbol _DrawDibRealize@12
Debug/xiu.exe : fatal error LNK1120: 1 unresolved externals
这是说明,你用了DrawDibRealize()函数,但是你只包含了含有该函数的头文件,而没引用含有该函数的库(.lib)文件。你应该用#pragma comment(lib, "那个库.lib")编译命令,引用那个库。

e:\xiu\dib1.cpp(5) : warning C4652: compiler option 'Generate Browser Info' inconsistent with precompiled header; current command-line option will override that defined in the precompiled header
首先这是个警告,意思是:编译器选项 "生成浏览器信息" 与预编译头文件选项冲突;当前命令行选项将会覆盖定义在预编译头文件中的选项。
这个问题,你可以试着修改项目属性中的"生成浏览器信息"的选项,不过这个你也可以不管,同样可以编译通过。

第一错误是:
找不到 _DrawDibRealize(它后面出现的@12是编译器给它加上的,根据函数调用约定不同有所不同,有Pascal和C调用约定两种)符号的定义,它是在连接的时候出现的,有两种可能:1、你写的这个函数只有省名,没有定义,2、这个函数是动态连接库导出的函数,而你没有连接它的lib库文件可以用“#pragma comment(lib, "那个库.lib")”编译命令或设置VC的lib文件路径。

第二个是个警告,与你设置编译器选项有关这里你可以不用管它。如果你想去掉这个警告可以用在你工程的适当位置加上#pragma warning( disable : 4652)编译命令。

头文件的东西只是警告,不是错误,程序中常常见到;
下面的东