C++ 2003 vs C++ 2005

C

calin.hanchevici

Hi all,

I'm trying to use unmanaged C++ code with Visual Studio 2005. My
libraries were built using VC++ 2003.

When I'm calling my functions I get an AccesViolationException:
Attempted to read or write protected memory. This is often an
indication that other memory is corrupt.

If I complile all libraries using VC++ 2005 it works fine.

Did anyone encountered this problem before? How did you solve it?

Thank you
Calin
 
C

Carl Daniel [VC++ MVP]

Hi all,

I'm trying to use unmanaged C++ code with Visual Studio 2005. My
libraries were built using VC++ 2003.

When I'm calling my functions I get an AccesViolationException:
Attempted to read or write protected memory. This is often an
indication that other memory is corrupt.

If I complile all libraries using VC++ 2005 it works fine.

Did anyone encountered this problem before? How did you solve it?

It's usually best to not mix C++ libraries built with different versions of
the compiler. That said, in many cases it's possible to make it work (even
going as far back as VC++ 1.0, 32 bit edition).

The first thing I would check is to look through all of the project settings
to make sure that the code that's calling the library and the implementation
of the library itself are compiled with the same (or as close to the same)
settings as possible.

If you can narrow down what's causing the Access Violation, someone might be
able to give you more specific help - or tell you why it just won't work.

-cd
 
C

calin.hanchevici

Thank you CD,
my dlls were build using vcproj files generated by Visual Studion 2003.

calin
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top