从命令行使用 Visual C++ 2013 编译 C/SDL 程序 [英] Compile a C / SDL program with Visual C++ 2013 from the Command Line

查看:41
本文介绍了从命令行使用 Visual C++ 2013 编译 C/SDL 程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我该怎么做?我不想使用 Visual Studio IDE,但我想使用提供的编译器 (cl.exe) 和 VS2013 的开发人员命令提示符.

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.

推荐答案

cl.exe /Wall /Tc main.c

会生成一个合适的main.exe.

在那之前:

  • 确保 c:\Windows\System32 在 PATH 中
  • 从你的VC安装目录执行vcvarsall.bat

如果你想使用一个库(例如,SDL),你需要用 /link 选项列出库(库路径可以用 /LIBPATH 添加)和库包含带有 /I 选项的目录.

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.

这篇关于从命令行使用 Visual C++ 2013 编译 C/SDL 程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆