Linking

WIN32.MAK contains the following macros to simplify linking applications:

Use one of the following flags, depending on whether you are building a console application or a GUI application:

Notice that these macros provide entry points in the CRT libraries. These CRT entry points will call your entry-point function (main or WinMain).

Use one of the following flags if you are using the single-threaded CRT:

Use one of the following flags if you are using the multithreaded CRT:

Use one of the following flags if you are using the CRT in a DLL:

The following example links the object files and libraries to produce the application executable file. Note that the resource file (generic.res) is linked along with the object file (generic.obj).

generic.exe : generic.obj generic.res
    $(link) $(ldebug) $(guilflags) generic.obj generic.res \
        $(guilibsdll) -out:generic.exe