0

I want to using one version of VC++, e.g. VC++2003, to make a DLL for my customers.

They may use VC++2005, VC++2008Express, VC++2010Pro,... and they may compile their projects with debug setting and release setting.

Can I make just one DLL for this purpose, or must I make several DLLs corresponding to all these possibilities?

Crackertastic
  • 4,958
  • 2
  • 30
  • 37
  • 1
    It's pretty easy to use just one version if you stick to a pure C interface (or COM, if you prefer that). – Jerry Coffin Sep 25 '15 at 23:05
  • You make one `.DLL` file that exports only flat C-style functions that do not use any compiler-dependent types/conventions/features. And one `.H` file for use in C/C++ compilers. Then, each compiler has its own means of importing the DLL into projects as needed, whether that is by creating a compiler-specific import LIB file, or providing specific code syntax to load/access the DLL function(s) directly. Or, the user can simply call the Win32 `LoadLibrary()` and `GetProcAddress()` functions (or utilize their compiler's delay-load capabilities to call those functions automatically). – Remy Lebeau Sep 25 '15 at 23:45
  • How about debug build and release build? Do I have to provide debug version .dll and release version .dll? – JoeChou Sep 26 '15 at 05:52

1 Answers1

0

I just create 2 DLL projects. One for release build and one for debug build. These 2 projects use multi-byte character set. To test, I create a EXE project using Unicode character set. Both debug and release build of the EXE project link to these 2 DLL without problem.

It's not what I already known. I have to update what I learned.

By the way, I use VC++2012 Express to test the above condition.