locked
error LNK2005: _exit already defined in msvcrt.lib(MSVCR90.dll)_LIBCMTD.lib_ RRS feed

  • Question

  • Hi Experts,

       Hi i am using cuda lib and openCV lib in my application...

      when i compile my application in debug mode..it is working fine...

      But  when I compile my application in release mode i am getting following link error...

     

    Warning    1    Command line warning D9035 : option 'Wp64' has been deprecated and will be removed in a future release    cl    ImageRotate
    Warning    2    Command line warning D9035 : option 'Wp64' has been deprecated and will be removed in a future release    cl    ImageRotate
    Warning    3    Command line warning D9035 : option 'Wp64' has been deprecated and will be removed in a future release    cl    ImageRotate
    Warning    4    Command line warning D9035 : option 'Wp64' has been deprecated and will be removed in a future release    cl    ImageRotate
    Warning    5    Command line warning D9035 : option 'Wp64' has been deprecated and will be removed in a future release    cl    ImageRotate
    Warning    6    Command line warning D9035 : option 'Wp64' has been deprecated and will be removed in a future release    cl    ImageRotate
    Warning    7    warning C4244: '=' : conversion from 'double' to 'float', possible loss of data    d:\Documents\CUDA\My Cuda Programs\ImageRotate\ImageRotate\Rotate.cpp    56    ImageRotate
    Warning    8    warning C4996: 'getch': The POSIX name for this item is deprecated. Instead, use the ISO C++ conformant name: _getch. See online help for details.    d:\Documents\CUDA\My Cuda Programs\ImageRotate\ImageRotate\Rotate.cpp    68    ImageRotate
    Error    9    error LNK2005: _exit already defined in msvcrt.lib(MSVCR90.dll)    LIBCMTD.lib    ImageRotate
    Error    10    error LNK2005: __exit already defined in msvcrt.lib(MSVCR90.dll)    LIBCMTD.lib    ImageRotate
    Error    11    error LNK2005: __cexit already defined in msvcrt.lib(MSVCR90.dll)    LIBCMTD.lib    ImageRotate
    Error    12    error LNK2005: __amsg_exit already defined in msvcrt.lib(MSVCR90.dll)    LIBCMTD.lib    ImageRotate
    Error    13    error LNK2005: __initterm_e already defined in msvcrt.lib(MSVCR90.dll)    LIBCMTD.lib    ImageRotate
    Error    14    error LNK2005: __expand already defined in msvcrt.lib(MSVCR90.dll)    LIBCMTD.lib    ImageRotate
    Error    15    error LNK2005: __msize already defined in msvcrt.lib(MSVCR90.dll)    LIBCMTD.lib    ImageRotate
    Error    16    error LNK2005: __encode_pointer already defined in msvcrt.lib(MSVCR90.dll)    LIBCMTD.lib    ImageRotate
    Error    17    error LNK2005: __decode_pointer already defined in msvcrt.lib(MSVCR90.dll)    LIBCMTD.lib    ImageRotate
    Error    18    error LNK2005: ___xi_a already defined in msvcrt.lib(cinitexe.obj)    LIBCMTD.lib    ImageRotate
    Error    19    error LNK2005: ___xi_z already defined in msvcrt.lib(cinitexe.obj)    LIBCMTD.lib    ImageRotate
    Error    20    error LNK2005: ___xc_a already defined in msvcrt.lib(cinitexe.obj)    LIBCMTD.lib    ImageRotate
    Error    21    error LNK2005: ___xc_z already defined in msvcrt.lib(cinitexe.obj)    LIBCMTD.lib    ImageRotate
    Error    22    error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in msvcrt.lib(MSVCR90.dll)    LIBCMTD.lib    ImageRotate
    Error    23    error LNK2005: __XcptFilter already defined in msvcrt.lib(MSVCR90.dll)    LIBCMTD.lib    ImageRotate
    Error    24    error LNK2005: __invoke_watson already defined in msvcrt.lib(MSVCR90.dll)    LIBCMTD.lib    ImageRotate
    Error    25    error LNK2005: __crt_debugger_hook already defined in msvcrt.lib(MSVCR90.dll)    LIBCMTD.lib    ImageRotate
    Error    26    error LNK2005: __configthreadlocale already defined in msvcrt.lib(MSVCR90.dll)    LIBCMTD.lib    ImageRotate
    Error    27    error LNK2005: _mainCRTStartup already defined in msvcrt.lib(crtexe.obj)    LIBCMTD.lib    ImageRotate
    Error    28    error LNK2005: ___set_app_type already defined in msvcrt.lib(MSVCR90.dll)    LIBCMTD.lib    ImageRotate
    Error    29    error LNK2005: __lock already defined in msvcrt.lib(MSVCR90.dll)    LIBCMTD.lib    ImageRotate
    Error    30    error LNK2005: __unlock already defined in msvcrt.lib(MSVCR90.dll)    LIBCMTD.lib    ImageRotate
    Error    31    error LNK2005: __errno already defined in msvcrt.lib(MSVCR90.dll)    LIBCMTD.lib    ImageRotate
    Error    32    error LNK2005: ___doserrno already defined in msvcrt.lib(MSVCR90.dll)    LIBCMTD.lib    ImageRotate
    Error    33    error LNK2005: _atoi already defined in msvcrt.lib(MSVCR90.dll)    LIBCMTD.lib    ImageRotate
    Error    34    error LNK2005: _printf already defined in msvcrt.lib(MSVCR90.dll)    LIBCMTD.lib    ImageRotate
    Warning    35    warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library    ImageRotate    ImageRotate
    Warning    36    warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library    ImageRotate    ImageRotate
    Error    37    fatal error LNK1169: one or more multiply defined symbols found    D:\Documents\CUDA\My Cuda Programs\ImageRotate\Release\ImageRotate.exe    ImageRotate

     

     

    I don't have much knowledge in linker properties....

    please help me to solve this issue...:(


    Thanks, Karguvel
    Thursday, July 8, 2010 3:01 PM

Answers

  • Hello Karguvel,

    Please refer to this similiar thread:

    http://social.msdn.microsoft.com/Forums/en/vcgeneral/thread/45a46d37-5e20-4e1a-87e7-9f9f65986f6a

     As Jonathan says:

    You are linking against both libcmtd.lib and msvcrt.lib - you can't do this. One is the statically linked runtime (libcmtd.lib) and the other is the dynamically linked runtime (msvcrt.lib). You are also mixing debug libraries (libcmtd.lib) and release libraries (msvcrt.lib) this is also a very bad idea.

    Please check your compiler and linker settings and ensure that you are using a consistent set of libraries.

    Best Regards,
    Nancy


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by Nancy Shao Thursday, July 15, 2010 8:33 AM
    Tuesday, July 13, 2010 8:18 AM
  • K. I solved that issue by adding

    LIBCMTD.LIB

    in Project properties -> Linker -> Input ->Ignore Specific Library

     

    Is it correct way to do...?!


    Thanks, Karguvel
    • Marked as answer by Nancy Shao Thursday, July 15, 2010 8:33 AM
    Thursday, July 8, 2010 3:45 PM

All replies

  • K. I solved that issue by adding

    LIBCMTD.LIB

    in Project properties -> Linker -> Input ->Ignore Specific Library

     

    Is it correct way to do...?!


    Thanks, Karguvel
    • Marked as answer by Nancy Shao Thursday, July 15, 2010 8:33 AM
    Thursday, July 8, 2010 3:45 PM
  • Hello Karguvel,

    Please refer to this similiar thread:

    http://social.msdn.microsoft.com/Forums/en/vcgeneral/thread/45a46d37-5e20-4e1a-87e7-9f9f65986f6a

     As Jonathan says:

    You are linking against both libcmtd.lib and msvcrt.lib - you can't do this. One is the statically linked runtime (libcmtd.lib) and the other is the dynamically linked runtime (msvcrt.lib). You are also mixing debug libraries (libcmtd.lib) and release libraries (msvcrt.lib) this is also a very bad idea.

    Please check your compiler and linker settings and ensure that you are using a consistent set of libraries.

    Best Regards,
    Nancy


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by Nancy Shao Thursday, July 15, 2010 8:33 AM
    Tuesday, July 13, 2010 8:18 AM