Skip to content

Instantly share code, notes, and snippets.

@jsancheznet
Created March 4, 2016 17:43
Show Gist options
  • Save jsancheznet/23b1fc8c592455f1bb84 to your computer and use it in GitHub Desktop.
Save jsancheznet/23b1fc8c592455f1bb84 to your computer and use it in GitHub Desktop.
Building Static Library in MSVC Command Line
When you build on the Visual Studio command line, you must build the program in two steps.
First, run cl /c /EHsc MyLib.cpp to compile the code and create an object file that's named MyLib.obj.
(The cl command invokes the compiler, Cl.exe, and the /c option specifies compile without linking. For more information, see /c (Compile Without Linking).)
Second, run lib MathFuncsLib.obj to link the code and create the static library MathFuncsLib.lib.
(The lib command invokes the Library Manager, Lib.exe. For more information, see LIB Reference.)
@Keshizin
Copy link

oh thank you for the answer!!!! i resolved with /OUT :DD

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment