将项目设置->C/C++->Use run-time library的设置设为Multithreaded DLL.

解决方案 »

  1.   

    原来的错误是没有了,不过出来这么一堆东西:((
    MSVCRT.lib(dllsupp.obj) : error LNK2005: __fltused already defined in StdAfx.obj
    MSVCRT.lib(MSVCRT.dll) : error LNK2005: _free already defined in StdAfx.obj
    MSVCRT.lib(MSVCRT.dll) : error LNK2005: _malloc already defined in StdAfx.obj
    MSVCRT.lib(MSVCRT.dll) : error LNK2005: _realloc already defined in StdAfx.obj
    MSVCRT.lib(dllsupp.obj) : warning LNK4006: __fltused already defined in StdAfx.obj; second definition ignored
    MSVCRT.lib(MSVCRT.dll) : warning LNK4006: _free already defined in StdAfx.obj; second definition ignored
    MSVCRT.lib(MSVCRT.dll) : warning LNK4006: _malloc already defined in StdAfx.obj; second definition ignored
    MSVCRT.lib(MSVCRT.dll) : warning LNK4006: _realloc already defined in StdAfx.obj; second definition ignored
       Creating library ReleaseUMinDependency/CHANEL.lib and object ReleaseUMinDependency/CHANEL.exp
    ReleaseUMinDependency/CHANEL.dll : fatal error LNK1169: one or more multiply defined symbols found
    Error executing link.exe.
      

  2.   

    检查你的Release模式的宏定义,看是否漏掉了什么。(对照Debug模式,不包括DEBUG,_DEBUG)。
      

  3.   

    把你的所需要的DLL拷贝到你的源程序下【不是DEBUG子目录,也不是Release子目录】,重编译运行时要DLL和EXE文件拷贝到一起【同一个子目录】
      

  4.   

    这个问题我找到答案了,在msdn上Q167946
    原文如下
    BUG: ATL Service EXE Doesn't Build in Release Build
    Last reviewed: June 16, 1997
    Article ID: Q167946  
    The information in this article applies to: 
    Microsoft Visual C++, 32-bit Editions, version 5.0 
    SYMPTOMS
    If you try to build a release mode of an ATL service EXE created with ATL COM AppWizard, you get the following the error message: 
       "error LNK2001: unresolved external symbol _main"
    CAUSE
    Builds in release mode automatically include the preprocessor directive _ATL_MIN_CRT, while the default ATL service code generated by the wizard requires the CRT library. RESOLUTION
    Remove _ATL_MIN_CRT from the list of preprocessor defines to allow CRT startup code to be included. 
    On the Project menu, click Settings. In the Settings For: drop-down list, choose Multiple Configurations. In the "Select project configuration(s) to modify" dialog box that appears, select the check boxes for all Release versions, and then click OK. Click the C/C++ tab in the Project Settings dialog box, and then choose the General category. Remove _ATL_MIN_CRT from the Preprocessor definitions edit box. Alternatively, you can remove calls to the CRT functions within the generated CServiceModule::LogEvent function. 
    STATUS
    Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available. MORE INFORMATION