LoginSignup
1
0

More than 5 years have passed since last update.

VisualStudioでC言語

Last updated at Posted at 2017-01-03

Windows環境になると気軽ベタなC言語を使うことはできません。そこでちょっとメモ。
まずVisual Stduioをインストールします。C言語でコンパイルするためには、VisualStudioの命令(clコマンド)をお借りします。そのコマンドを使うために、環境変数を登録します。
まず、C言語のソースを入力して任意の位置に保存します。Cドライブの直下でもいいでしょう。次に、バッチファイルを作ります。
cd c:\src
%windir%\system32\cmd.exe /k "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\vcvars32.bat"
上をテキストエディタで編集し任意の名前で保存、クリックして実行します。
環境変数が設定され、clコマンドが任意の場所から実行できます。
Cのソースファイルをコンパイルします。

cl helloworld.c
を実行します。コンパイルに成功すると実行ファイルが作成され
helloworld.exe
と入力すればOK。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0