您的位置:首页 > 其它

VS编译链接错误总结ing

2012-10-10 15:48 127 查看
1.怎么解决Excel.ApplicationClass' cannot be embedded问题?

当升级VS2008到VS2010时出现Interop type 'Microsoft.Office.Interop.Excel.ApplicationClass' cannot be embedded. Use the applicable interface instead问题

解决方案:打开相关调用 的DLL然后,the Properties tab for the assembly in Visual Studio 2010 and set "Embed Interop Types" to "False



Reference:http://www.cnblogs.com/computer-lzy/archive/2011/11/08/2240727.html



2.fatal error RC1015: cannot open include file '***.h'.

这个问题倒是头次遇到,连资源头文件也要包含进来,项目属性->资源->常规->附件包含目录。



3. mfcs90d.lib(dllmodul.obj) : error LNK2005: _DllMain@12 already defined in MSVCRTD.lib(dllmain.obj)

网上找了一下,原来是CRT 库对某些函数使用弱外部链接导致的。

microsoft给出了解决办法:http://support.microsoft.com/kb/148652

由于其给出的解决方案是基于VC6.0的,因此我在VS2008编译器上实践如下:

进入工程的Properties,然后Linker的input下,在“Additional Dependencies”中填入 mfcs90d.lib MSVCRTD.lib,然后在Ignore Specific Library中填入mfcs90d.lib;MSVCRTD.lib,再链接即可通过。

其实也就是手动指定两个库的链接顺序罢了。(先链接MFC库,再链接CRT库)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: