Menu

Problems building with VC++ 6.0

Help
mélanie
2004-03-08
2004-03-13
  • mélanie

    mélanie - 2004-03-08

    Hi everybody,

    When i try to build  my project, which contains the cppunit tests, I have this errors :

    LIBCD.lib(crt0.obj) : error LNK2005: _mainCRTStartup already defined in
    MSVCRT.lib(crtexe.obj)
    LIBCD.lib(dbgheap.obj) : error LNK2005: _free already defined in MSVCRT.lib
    (MSVCRT.dll)
    LIBCD.lib(crt0dat.obj) : error LNK2005: _exit already defined in MSVCRT.lib
    (MSVCRT.dll)
    LIBCD.lib(crt0dat.obj) : error LNK2005: __exit already defined in MSVCRT.lib
    (MSVCRT.dll)
    LIBCD.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in MSVCRT.lib
    (cinitexe.obj)
    LIBCD.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in MSVCRT.lib
    (cinitexe.obj)
    LIBCD.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in MSVCRT.lib
    (cinitexe.obj)
    LIBCD.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in MSVCRT.lib
    (cinitexe.obj)
    LIBCD.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in
    MSVCRT.lib(MSVCRT.dll)
    LINK : warning LNK4098: defaultlib "MSVCRT" conflicts with use of other libs;
    use /NODEFAULTLIB:library
    LINK : warning LNK4098: defaultlib "LIBCD" conflicts with use of other libs;
    use /NODEFAULTLIB:library
    Debug/TestCalculator.exe : fatal error LNK1169: one or more multiply defined
    symbols found

    It seems to be a problem with the librairies. Do someone know hox to fix that?

    Thamks,
    Mlanie

     
    • coinoperated

      coinoperated - 2004-03-08

      Try ignoring the msvcrt library by changing the  project settings:
      - Link tab - category "input" - Ingore Libraries: "msvcrt.lib"

       
      • mélanie

        mélanie - 2004-03-09

        thanks, ignoring the "msvrct.lib" librairie works, but now when I execute my project, it says that the cppunit_dll.dll can't be found and that I have to reinstall cppunit.

        When it tryed to add cppunit_dll.dll in project settings/ link (for now I only link cppunit_dll.lib and cppunitd_dll.lib), I have an error when I build the project :
        cppunit_dll.dll : fatal error LNK1136: invalid or corrupt file

        Do you know how to fix it?
        Thanks

         
    • Baptiste Lepilleur

      You're most likely not using the same c run-time library as cppunit.

      Check the Projects settings/C++/Code generation and compare between the cppunit project and yours (should be (debug) multithreaded dll if my memory does not fail me).

      Baptiste.

       
    • Baptiste Lepilleur

      I'm not sure that ignoring the library is the right thing to do (likely to result in crash at run time).

      You never add .dll to a project, just the .lib that come along with it.

      For the .dll to be found, it need to be in one of the directory in your PATH or in the same directory as your executable. Try to copy the .dll to the Debug and Release build directory, that should do the trick.

      You can also try linking against the non dll version of cppunit (cppunit.lib & cppunitd.lib), though you will not be able to use the test plug-in stuff.

      Baptiste.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.