Library compatibility using C with Visual C++ Express

Discussion in 'C++' started by mido, Dec 5, 2006.

  1. mido

    mido Guest

    I am currently trying to compile code which uses old C code with a C++
    wrapper. It had compiled on earlier versions of software (within the
    past two years), but Maya needs an updated version.
    I think one source of the problems is that the C code relies on old
    libraries. I tried changing <iostream.h> to <iostream> but it
    introduced a handful of errors in the C code which I am hoping to avoid
    getting wrapped up in.

    I get the following errors using Visual C++ 2005 Express Edition:

    LIBCMTD.lib(stdexcpt.obj) : error LNK2005: "public: __thiscall
    std::bad_cast::bad_cast(char const *)" (??0bad_cast@std@@QAE@PBD@Z)
    already defined in handsimulatenode.obj
    LIBCMTD.lib(stdexcpt.obj) : error LNK2005: "public: __thiscall
    std::bad_cast::bad_cast(class std::bad_cast const &)"
    (??0bad_cast@std@@QAE@ABV01@@Z) already defined in handsimulatenode.obj
    LIBCMTD.lib(stdexcpt.obj) : error LNK2005: "public: virtual __thiscall
    std::bad_cast::~bad_cast(void)" (??1bad_cast@std@@UAE@XZ) already
    defined in handsimulatenode.obj
    LINK : fatal error LNK1104: cannot open file 'libcimtd.lib'

    I am wondering if anyone else has already dealt with this problem.

    Is the problem just a matter of linking to the debug library
    'libcimtd.lib'? (There is no version for x86 but there is one for
    AMD64, but it will take figuring out how to use it.)
    Or is the root of the problem something else?

    Thanks,
    mido
    mido, Dec 5, 2006
    #1
    1. Advertising

  2. mido

    David Harmon Guest

    On 5 Dec 2006 07:42:47 -0800 in comp.lang.c++, "mido"
    <> wrote,
    >I think one source of the problems is that the C code relies on old
    >libraries. I tried changing <iostream.h> to <iostream> but it
    >introduced a handful of errors in the C code which I am hoping to avoid
    >getting wrapped up in.


    Of course actual C code cannot depend on <iostream.h> as that was always
    C++ only. I predict that you will not be happy until you get away from
    <iostream.h> and on to <iostream>. If nothing else, they are so
    incompatible that you cannot link them both in the same program.

    >I get the following errors using Visual C++ 2005 Express Edition:
    >
    >LIBCMTD.lib(stdexcpt.obj) : error LNK2005: "public: __thiscall
    >std::bad_cast::bad_cast(char const *)" (??0bad_cast@std@@QAE@PBD@Z)
    >already defined in handsimulatenode.obj


    Clutching at a straw, is there any chance that you did not recompile
    handsimulatenode.cpp with the new compiler?
    David Harmon, Dec 5, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Q2FybCBNLg==?=
    Replies:
    4
    Views:
    2,478
    sivlookingforu
    Aug 7, 2006
  2. Ronde
    Replies:
    1
    Views:
    9,700
    Karl Seguin [MVP]
    Apr 25, 2006
  3. hunkgym
    Replies:
    1
    Views:
    1,986
    =?Utf-8?B?TGVvbiBNYXluZQ==?=
    Oct 30, 2006
  4. jonny
    Replies:
    1
    Views:
    466
    Michael Nemtsev
    Oct 6, 2007
  5. Jake Henderson

    Visual Web Developer 2005 Express and SQL 2005 Express

    Jake Henderson, Mar 10, 2006, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    223
    Jake Henderson
    Mar 10, 2006
Loading...

Share This Page