Brad Younie
Brad Younie

Reputation:

Can a app built with Visual C++ 6 use a DLL built with Visual Studio 2008?

I'm developing an SDK, and we have clients that are still coding with VC++ 6, while others use Visual Studio 2005 and others with 2008.

Currently, we build several flavors of our SDK, where we build the exact same source code with each of those compilers. I want to find out if that is really necessary. Is it safe to build our SDK (which takes the form of DLLs) with VS2008 and expect our clients who use VC++ 6 to be able to use it without problems?

Upvotes: 0

Views: 455

Answers (3)

sbi
sbi

Reputation: 224089

If the DLL has a pure C API, your executable will never release any resource allocated by the DLL (and vice versa), then it should work.

Upvotes: 0

Kirill V. Lyadvinsky
Kirill V. Lyadvinsky

Reputation: 99585

It is pretty safe if you'll not allow client's program to delete memory that was allocated in your SDK. And vice versa.

Upvotes: 0

Roel
Roel

Reputation: 19632

Depends. Does your DLL depend on the VC runtime, MFC or ATL? If so, your clients will have to distribute those dlls. Does your dll export C++ structs/classes/functions? There is no standardized ABI for C++, so they may or may not work with other compilers. If your dll only exports extern "C" {} style, you'll be fine.

Upvotes: 2

Related Questions