VC问题锦集

1. mfcs100ud.lib(dllmodul.obj) error LNK2005 _DllMain@12 already defined in MSVCRTD.lib(dllmain.obj)

参考自:

1、http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/d86b96a2-a5c9-4bfc-98e1-61b55e50ecae/mfcs80udlibdllmodulobj-error-lnk2005-dllmain12-already-defined-in-msvcrtdlibdllmainobj?forum=vclanguage

2、http://support.microsoft.com/kb/148652/zh-cn

 

The KB article is apply to the previous version of VC, in visual studio 2005, there is a little different on how to set the configurations. but the principle under the configuration is the same.

 

To solve it, do the following steps:

1. Open project property pages by Alt+F7

2. Navigate to Configuration properties->Linker->Input section.

3. Add msvcrtd.lib; mfcs80ud.lib to the Ignore specific library. // MSVCRTD.lib;mfcs100ud.lib

4. Add mfcs80ud.lib msvcrtd.lib to the Additional dependencies. // mfcs100ud.lib;MSVCRTD.lib

 

Now we will tell you how to find out these two disorder libraries. In the project property pages, navigate to configuration properties->linker->command line, add /verbose:lib to the additional option. Rebuild your project, and look carefully to the output window, you will find that is mfcs80ud.lib generated the link error, look before mfcs80ud.lib, you will find there is only one CRT library before it, so ignore these 2 libraries in the Ignore specific library, then add them in the additional dependencies with right order. Rebuild again, it should works.

2. 当exe依赖的ocx控件未注册,运行exe,会出现如下图错误提示。解决方法:注册ocx控件。

 

3. 创建控件失败,m_pCtrlCont = afxOccManager->CreateContainer(this); 报错,因为m_pOccManagerNULL

解决方法:

BOOL CNewPatientApp::InitInstance()
{
    CWinApp::InitInstance();

    // 添加
    // Call if using OLE Controls  //  异常:m_pCtrlCont = afxOccManager->CreateContainer(this);
    AfxEnableControlContainer();

    return TRUE;
}

 可参考:http://blog.csdn.net/jszj/article/details/3876068

 

4. 若发现vs2010ResourceView标签页为空,可以尝试删除*.sdf  *.ipch,再重新编译工程,再查看ResouceView标签页是否有资源。

5. 编译发生错误时,默认不运行

   Tools -> Options -> Projects and Solutions -> Build and Run:    On Run, when build or deployment errors occur: Do not launch

原文地址:https://www.cnblogs.com/ant-wjf/p/3555988.html