-
Install Visual Studio in your machine and open developer cmd prompt in VS.
-
Let's call the file 'moo.cpp' which you want to create library for.
-
Write functions to that file. only compile using cl command. eg. cl /c moo.cpp
-
This will create a obj file. To create a static library, use the following command.
$lib /out:static_library.lib moo.cppeg. $lib /out:output_file_name.lib inputfile.cpp
-
To link your library file to you file in which you are calling that lib function use: cl main.coo /link static_lib.lib