Search code examples
csdlcl

Compile a C / SDL program with Visual C++ 2013 from the Command Line


How do I that? I don't want to use the Visual Studio IDE, yet I want to use the provided compiler (cl.exe) and the Developer Command Prompt for VS2013.


Solution

  • cl.exe /Wall /Tc main.c
    

    will generate a proper main.exe.

    and before that:

    • ensure that c:\Windows\System32 is in the PATH
    • execute vcvarsall.bat from your install directory of VC

    If you want to use a library (e.g., SDL) you need to list the libraries with /link option (library paths can be added with /LIBPATH) and the library include directories with /I option.