Static linking - Visual Studio 2017

First of all, let's see how we generate an object file. I am quite sure you have already understood how to produce different targets in general and for this example in particular. Let's begin with a 32-bit MSCOFF object file by setting the ACTIVE_TARGET variable to TARGET_W32_OBJ and compiling the main source file.

Create a C/C++ project in Visual Studio and copy the object file into the project directory as shown in the following screenshot (the screenshot shows object files for both 32-bit and 64-bit):

As you can see in the preceding screenshot, there is at least one more file we need, namely the header ...

Get Mastering Assembly Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.