Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   Library compatibility using C with Visual C++ Express (http://www.velocityreviews.com/forums/t458973-library-compatibility-using-c-with-visual-c-express.html)

mido 12-05-2006 03:42 PM

Library compatibility using C with Visual C++ Express
 
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


David Harmon 12-05-2006 08:00 PM

Re: Library compatibility using C with Visual C++ Express
 
On 5 Dec 2006 07:42:47 -0800 in comp.lang.c++, "mido"
<midori.hyndman@gmail.com> 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?



All times are GMT. The time now is 01:28 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.