1

I have a Visual C++ DLL project (just a project, without parent solution) and need to build the DLL.

Build command doesn't generate any error messages. In the Debug folder there is mylibrary.lib, but no mylibrary.dll.

I looked at Visual Studio 2010 C++ DLL project - No output DLL file!, but my case differs from that question. In the build output, there is no message like

MFCInterop.vcxproj -> C:\temp\sotest\Debug\MFCInterop.dll

only

MFCInterop.vcxproj -> C:\temp\sotest\Debug\MFCInterop.lib

What can I do in order to generate the DLL file?

Community
  • 1
  • 1
Glory to Russia
  • 17,289
  • 56
  • 182
  • 325

2 Answers2

5

I may be that the dll generated but not in the Debug folder.You should set the output directory for the project.For this go to

project property--->General--->Output Directory--->.\Debug

jiten
  • 5,128
  • 4
  • 44
  • 73
  • Thank! For me, the .dll appears in `SolutionDirectory\Debug`, not `SolutionDirectory\ProjectDirectory\Debug` as I expected. – cppBeginner May 29 '19 at 06:53
2

It may happen if your DLL does not expose anything. Normally public API classes of your DLL should be exposed using following construction:

#ifdef YOUR_DLL_EXPORTS
    #define YOUR_API __declspec(dllexport)
#else
    #define YOUR_API __declspec(dllimport)
#endif 

class YOUR_API ClassToExpose {};

Then you have to define YOUR_DLL_EXPORTS inside DLL project. If you don't have exposed stuff DLL is not generated. I hope this helps.

nogard
  • 9,432
  • 6
  • 33
  • 53