WARhead
WARhead

Reputation: 691

How To Deploy a C++ DLL

I have written a dll in visual studio community 2017. To be used as a general purpose library. Which could be ideally used for any c++ program for any compiler. How will I best deploy it. (An installer)

In Visual Studio, I can simply add the project and reference it through settings in my IDE, but for it to work in any IDE, what kind of installer project should i use and what all files should be included and how.

Upvotes: 0

Views: 600

Answers (1)

MSalters
MSalters

Reputation: 180295

You can't deploy a C++ DLL for all compilers. C++ doesn't have an ABI. Not even MSVC++ is compatible across versions, let alone compilers from different vendors.

The Windows solution for binary compatibility is COM. Conveniently, MSVC++ will use the COM ABI for classes that inherit from IUnknown, although you'll also have to adhere to other COM rules for full compatibility. E.g. you can't rely on dynamic_cast, you need QueryInterface.

Upvotes: 2

Related Questions