VC++自编图像处理程序错误fatal error C1189: #error

发布时间:2024-05-16 11:58 发布:上海旅游网

问题描述:

全部提示:
--------------------Configuration: wj - Win32 Debug--------------------
Compiling resources...
Compiling...
StdAfx.cpp
d:\vc98\mfc\include\afxver_.h(130) : fatal error C1189: #error : Please use the /MD switch for _AFXDLL builds
执行 cl.exe 时出错.

wj.exe - 1 error(s), 0 warning(s)
所写的程序是进行位图的读写,复制粘贴等简单操作的程序
有按照网上查到的,设置了Project Settings -> Link 选项卡和C/C++
error LNK2001: unresolved external symbol "int __stdcall SaveDIB(struct HDIB__ *,class CFile &)" (?SaveDIB@@YGHPAUHDIB__@@AAVCFile@@@Z)
error LNK2001: unresolved external symbol "unsigned long __stdcall DIBHeight(char *)" (?DIBHeight@@YGKPAD@Z)
error LNK2001: unresolved external symbol "unsigned long __stdcall DIBHeight(char *)" (?DIBHeight@@YGKPAD@Z)
error LNK2001: unresolved external symbol "unsigned long __stdcall DIBWidth(char *)" (?DIBWidth@@YGKPAD@Z)
error LNK2001: unresolved external symbol "unsigned long __stdcall DIBWidth(char *)" (?DIBWidth@@YGKPAD@Z)
error LNK2001: unresolved external symbol "int __stdcall PaintDIB(struct HDC__ *,struct tagRECT *,struct HDIB__ *,struct tagRECT *,class CPalette *)" (?PaintDIB@@YGHPAUHDC__@@PAUtagRECT@@PAUHDIB__@@1PAVCPalette@@@Z)
error LNK2001: unresolved external symbol "void * __stdcall CopyHandle(void *)" (?CopyHandle@@YGPAXPAX@Z)

问题解答:

可能问题是你所声明的函数没有定义,即你声明了一个函数却没有实现这个函数。
你可以把函数的声明和定义都放在一个文件里试试。或者把函数定义文件.cpp也包含在主调函数的文件里。
更多具体情况还得看你的代码。

估计是编译选项的问题,请参考示例图片。

热点新闻