Click here to Skip to main content
15,889,216 members
Articles / Programming Languages / C++
Tip/Trick

HelloWorld.dll: The simplest way to create your first DLL

Rate me:
Please Sign up or sign in to vote.
4.50/5 (2 votes)
7 Feb 2013CPOL 19.5K   6  
How to create your first DLL without coding too much... :)

Introduction

This tip is for seriously lazy people who don't take themselves too seriously and want to get over the creation of their first DLL quickly. This is an advanced beginner tutorial, not necessarily recommended for beginners.

Prerequisites 

You need to have the Microsoft Incremental Linker (link.exe). It comes with Microsoft Visual C++ and older MASM32 distributions. If you have Visual C++ installed then the linker is located somewhere around "c:\Program Files (x86)\Microsoft Visual Studio X.0\VC\bin\".

Creating your DLL

Run the following command: 

LINK /OUT:HelloWorld.dll /DLL /NOENTRY /NODEFAULTLIB 

And voila! Congratulations!!! You have created your first DLL! You can load it with LoadLibrary(), and unload it with FreeLibrary(), but demonstrating that is out of the scope of this beginner tutorial.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --