How to export a DLL from Visual Studio 2017 Community Edition C++ Project?

10,220

Solution 1

You have to select DLL in Configuration Properties of your project.

Then probably figured out errors, if any


enter image description here

Solution 2

I have not VS community available right now, but IIRC, in the General project settings, you can select Dynamic Library as the Configuration Type

You may also want to set Map Exports and Generate Map File to Yes or something like that, in the linker Debugging settings.

You probably will also need a

BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)     
{
    //you should keep hinstDll in a global variable

    //...

    return true;// true means "go on with loading the dll"
}
Share:
10,220
Ska
Author by

Ska

Updated on June 04, 2022

Comments

  • Ska
    Ska almost 2 years

    I have a Visual Studio 2017 Community Edition. Started the new C++ console project. Marked the class I want exported as DLL with __declspec(dllexport).

    But when I build my solution, I only get files with following extensions: .exe, .iobj, .ipdb and .pdb.

    I tried searching through various settings in Visual Studiom including configuration manager, but I can't find where to enable the option to build the code as DLL. Is it maybe not a part of community edition?