zoukankan      html  css  js  c++  java
  • "void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z) 已经在 LIBCMTD.lib(delete2.obj) 中定义 错误

    error LNK2005: "void * __cdecl operator new(unsigned int)" (??2@YAPAXI@Z) 已经在 LIBCMTD.lib(new.obj) 中定义error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) 已经在 LIBCMTD.lib(dbgdel.obj) 中定义
    error LNK2005: "void * __cdecl operator new[](unsigned int)" (??_U@YAPAXI@Z) 已经在 LIBCMTD.lib(new2.obj) 中定义
    error LNK2005: "void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z) 已经在 LIBCMTD.lib(delete2.obj) 中定义
    上网搜了下,是CRT库与MFC库的冲突,解决方法是:让程序先链接Nafxcwd.lib,然后再链接Libcmtd.lib


    you've got to change the order inwhich the libraries are linked. This is a bit tricky, since the library are linked automatically, without you explicitly specifying them.

    So, first step, tell the linker to ignore the implicit libraries: Project/Setting/Linker, Input Tab, and put "Nafxcwd.lib Libcmtd.lib" in the "Libraries to Ignore" box.

    Next, on the same page, in the Object/library Modules box, put the same to libraries. (in you still get the same error, try reversing them on this line)
    --

    中文

    项目--属性 ---连接器---输入  

                                  附加依赖项    空格Nafxcwd.lib Libcmtd.lib

                                  忽略指定库    空格Nafxcwd.lib Libcmtd.lib

    清除项目。重新编译。搞定

  • 相关阅读:
    最好的委托与事件详解一(转自张子阳博客)
    事务处理两种方式(转自一壶茶水)
    条目列表点击效果
    html可变大小字体
    udp群聊
    vbs隐藏运行bat之木马合体
    淘宝客网站的链接跳转形式
    工作之外八小时,用辛苦换幸福
    怕吃苦,吃苦一辈子
    外链建设的六个方法
  • 原文地址:https://www.cnblogs.com/xianqingzh/p/1591868.html
Copyright © 2011-2022 走看看