读书人

mfc改为静态编译有关问题

发布时间: 2013-10-23 11:39:13 作者: rapoo

mfc改为静态编译问题
作了一个mfc小程序,之前使用共享dll使用mfc,之后要尝试部署到其他机器上去,修改为静态了,运行库选择的还是多线程调试 DLL (/MDd),并且在头文件添加#define _AFXDLL后可以编译成功,但是mfc程序到别的机器上无法运行 提示 找不到mfc100d.dll;
当修改运行库为多线程/mt时,编译又报错 如下
>cximage.lib(ximaexif.obj) : warning LNK4217: 本地定义的符号 _free 在函数 "public: bool __thiscall CxImageJPG::CxExifInfo::DecodeExif(class CxFile *,int)" (?DecodeExif@CxExifInfo@CxImageJPG@@QAE_NPAVCxFile@@H@Z) 中导入
1>jpeg.lib(Jmemnobs.obj) : warning LNK4049: 已导入本地定义的符号 _free
1>cximage.lib(ximalyr.obj) : warning LNK4049: 已导入本地定义的符号 _free
1>cximage.lib(xmemfile.obj) : warning LNK4049: 已导入本地定义的符号 _free
1>cximage.lib(ximagif.obj) : warning LNK4217: 本地定义的符号 _free 在函数 "public: bool __thiscall CxImageGIF::Decode(class CxFile *)" (?Decode@CxImageGIF@@QAE_NPAVCxFile@@@Z) 中导入
1>cximage.lib(ximabmp.obj) : warning LNK4049: 已导入本地定义的符号 _free
1>cximage.lib(ximatran.obj) : warning LNK4217: 本地定义的符号 _free 在函数 "public: bool __thiscall CxImage::Flip(bool,bool)" (?Flip@CxImage@@QAE_N_N0@Z) 中导入
1>cximage.lib(xImage.obj) : warning LNK4217: 本地定义的符号 _free 在函数 "public: void __thiscall CxImage::Copy(class CxImage const &,bool,bool,bool)" (?Copy@CxImage@@QAEXABV1@_N11@Z) 中导入
1>cximage.lib(ximalpha.obj) : warning LNK4049: 已导入本地定义的符号 _free
1>cximage.lib(ximasel.obj) : warning LNK4049: 已导入本地定义的符号 _free
1>jpeg.lib(Jmemnobs.obj) : warning LNK4049: 已导入本地定义的符号 _malloc
1>cximage.lib(xmemfile.obj) : warning LNK4049: 已导入本地定义的符号 _malloc
1>cximage.lib(ximagif.obj) : warning LNK4049: 已导入本地定义的符号 _malloc
1>cximage.lib(ximabmp.obj) : warning LNK4217: 本地定义的符号 _malloc 在函数 "public: bool __thiscall CxImageBMP::Decode(class CxFile *)" (?Decode@CxImageBMP@@QAE_NPAVCxFile@@@Z) 中导入
1>cximage.lib(ximaexif.obj) : warning LNK4049: 已导入本地定义的符号 _malloc
1>cximage.lib(ximatran.obj) : warning LNK4217: 本地定义的符号 _malloc 在函数 "public: bool __thiscall CxImage::Flip(bool,bool)" (?Flip@CxImage@@QAE_N_N0@Z) 中导入
1>cximage.lib(xImage.obj) : warning LNK4217: 本地定义的符号 _malloc 在函数 "public: void __thiscall CxImage::Copy(class CxImage const &,bool,bool,bool)" (?Copy@CxImage@@QAEXABV1@_N11@Z) 中导入
1>cximage.lib(ximalpha.obj) : warning LNK4049: 已导入本地定义的符号 _malloc
1>cximage.lib(ximasel.obj) : warning LNK4217: 本地定义的符号 _malloc 在函数 "public: bool __thiscall CxImage::SelectionAddEllipse(struct tagRECT,unsigned char)" (?SelectionAddEllipse@CxImage@@QAE_NUtagRECT@@E@Z) 中导入
1>cximage.lib(ximatran.obj) : warning LNK4217: 本地定义的符号 _ldiv 在函数 "public: bool __thiscall CxImage::RotateLeft(class CxImage *)" (?RotateLeft@CxImage@@QAE_NPAV1@@Z) 中导入
1>cximage.lib(ximatran.obj) : warning LNK4217: 本地定义的符号 _floor 在函数 "public: bool __thiscall CxImage::Rotate(float,class CxImage *)" (?Rotate@CxImage@@QAE_NMPAV1@@Z) 中导入
1>cximage.lib(ximainfo.obj) : warning LNK4049: 已导入本地定义的符号 _floor
1>cximage.lib(ximajpg.obj) : warning LNK4049: 已导入本地定义的符号 _floor
1>cximage.lib(ximabmp.obj) : warning LNK4049: 已导入本地定义的符号 _floor
1>cximage.lib(ximainfo.obj) : warning LNK4217: 本地定义的符号 __strnicmp 在函数 "public: static unsigned long __cdecl CxImage::GetTypeIdFromName(char const *)" (?GetTypeIdFromName@CxImage@@SAKPBD@Z) 中导入
1>cximage.lib(ximaenc.obj) : warning LNK4217: 本地定义的符号 _fclose 在函数 "public: bool __thiscall CxImage::Save(char const *,unsigned long)" (?Save@CxImage@@QAE_NPBDK@Z) 中导入
1>cximage.lib(ximaenc.obj) : warning LNK4217: 本地定义的符号 _fread 在函数 "public: virtual unsigned int __thiscall CxIOFile::Read(void *,unsigned int,unsigned int)" (?Read@CxIOFile@@UAEIPAXII@Z) 中导入
1>cximage.lib(ximaenc.obj) : warning LNK4217: 本地定义的符号 _fwrite 在函数 "public: virtual unsigned int __thiscall CxIOFile::Write(void const *,unsigned int,unsigned int)" (?Write@CxIOFile@@UAEIPBXII@Z) 中导入
1>cximage.lib(ximaenc.obj) : warning LNK4217: 本地定义的符号 _fseek 在函数 "public: virtual bool __thiscall CxIOFile::Seek(long,int)" (?Seek@CxIOFile@@UAE_NJH@Z) 中导入
1>cximage.lib(ximaenc.obj) : warning LNK4217: 本地定义的符号 _ftell 在函数 "public: virtual long __thiscall CxIOFile::Tell(void)" (?Tell@CxIOFile@@UAEJXZ) 中导入
1>cximage.lib(ximaenc.obj) : warning LNK4217: 本地定义的符号 _fflush 在函数 "public: virtual bool __thiscall CxIOFile::Flush(void)" (?Flush@CxIOFile@@UAE_NXZ) 中导入
1>cximage.lib(ximaenc.obj) : warning LNK4217: 本地定义的符号 _fgets 在函数 "public: virtual char * __thiscall CxIOFile::GetS(char *,int)" (?GetS@CxIOFile@@UAEPADPADH@Z) 中导入


1>cximage.lib(ximasel.obj) : warning LNK4217: 本地定义的符号 _calloc 在函数 "public: bool __thiscall CxImage::SelectionCreate(void)" (?SelectionCreate@CxImage@@QAE_NXZ) 中导入
1>cximage.lib(xmemfile.obj) : warning LNK4217: 本地定义的符号 _realloc 在函数 "protected: bool __thiscall CxMemFile::Alloc(unsigned long)" (?Alloc@CxMemFile@@IAE_NK@Z) 中导入
1>cximage.lib(ximagif.obj) : warning LNK4217: 本地定义的符号 _strncmp 在函数 "public: bool __thiscall CxImageGIF::Decode(class CxFile *)" (?Decode@CxImageGIF@@QAE_NPAVCxFile@@@Z) 中导入
1>cximage.lib(ximaexif.obj) : warning LNK4217: 本地定义的符号 _printf 在函数 "public: bool __thiscall CxImageJPG::CxExifInfo::DecodeExif(class CxFile *,int)" (?DecodeExif@CxExifInfo@CxImageJPG@@QAE_NPAVCxFile@@H@Z) 中导入
1>cximage.lib(ximaexif.obj) : warning LNK4217: 本地定义的符号 _isprint 在函数 "protected: void __thiscall CxImageJPG::CxExifInfo::process_COM(unsigned char const *,int)" (?process_COM@CxExifInfo@CxImageJPG@@IAEXPBEH@Z) 中导入
1>jpeg.lib(Jerror.obj) : warning LNK4217: 本地定义的符号 _exit 在函数 _error_exit 中导入
1>jpeg.lib(Jerror.obj) : warning LNK4217: 本地定义的符号 __iob 在函数 _output_message 中导入
1>jpeg.lib(Jerror.obj) : warning LNK4217: 本地定义的符号 _sprintf 在函数 _format_message 中导入
1>jpeg.lib(Jmemmgr.obj) : warning LNK4217: 本地定义的符号 _sscanf 在函数 _jinit_memory_mgr 中导入
1>jpeg.lib(Jmemmgr.obj) : warning LNK4217: 本地定义的符号 _getenv 在函数 _jinit_memory_mgr 中导入
1>cximage.lib(ximaenc.obj) : error LNK2019: 无法解析的外部符号 __imp__fopen,该符号在函数 "public: bool __thiscall CxImage::Save(char const *,unsigned long)" (?Save@CxImage@@QAE_NPBDK@Z) 中被引用
1>cximage.lib(ximaenc.obj) : error LNK2019: 无法解析的外部符号 __imp__fputc,该符号在函数 "public: virtual bool __thiscall CxIOFile::PutC(unsigned char)" (?PutC@CxIOFile@@UAE_NE@Z) 中被引用
1>cximage.lib(ximaenc.obj) : error LNK2019: 无法解析的外部符号 __imp__getc,该符号在函数 "public: virtual long __thiscall CxIOFile::GetC(void)" (?GetC@CxIOFile@@UAEJXZ) 中被引用
1>cximage.lib(ximaenc.obj) : error LNK2019: 无法解析的外部符号 __imp__fscanf,该符号在函数 "public: virtual long __thiscall CxIOFile::Scanf(char const *,void *)" (?Scanf@CxIOFile@@UAEJPBDPAX@Z) 中被引用
1>cximage.lib(ximagif.obj) : error LNK2019: 无法解析的外部符号 __imp__strncpy,该符号在函数 "public: bool __thiscall CxImageGIF::Encode(class CxFile *,class CxImage * *,int,bool,bool)" (?Encode@CxImageGIF@@QAE_NPAVCxFile@@PAPAVCxImage@@H_N2@Z) 中被引用
1>cximage.lib(ximabmp.obj) : error LNK2001: 无法解析的外部符号 __imp__strncpy
1>cximage.lib(ximaexif.obj) : error LNK2001: 无法解析的外部符号 __imp__strncpy
1>cximage.lib(ximajpg.obj) : error LNK2019: 无法解析的外部符号 __imp__longjmp,该符号在函数 "public: bool __thiscall CxImageJPG::Decode(class CxFile *)" (?Decode@CxImageJPG@@QAE_NPAVCxFile@@@Z) 中被引用
1>jpeg.lib(Jerror.obj) : error LNK2019: 无法解析的外部符号 __imp__fprintf,该符号在函数 _output_message 中被引用
1>C:\Users\传龙\documents\visual studio 2010\Projects\Picsimilarity\Debug\Picsimilarity.exe : fatal error LNK1120: 7 个无法解析的外部命令
1> mfc visual?studio?2010 库
[解决办法]
你就用/MD 呗,把依赖的dll都copy过去和你的exe放到同一级目录下不行吗?
可以用depends工具来查看~

读书人网 >VC/MFC

热点推荐