Showing posts with label command prompt. Show all posts
Showing posts with label command prompt. Show all posts

Monday, April 11, 2016

VS Express and command line compiling

C言語を勉強するためVS Expressをwindowsに入れているが、使うのはもっぱらcommand promptでのcompilingである。いちいちGUIを開くのは煩わしく感じる。まとまったprojectを組む必要がなければ、command line compilingがさくさく作業が進んでいいように思う。
VS Expressのバージョンにもよるが、私は次のようにcommand promptを呼び出している。

1. exploreでvisual studioのフォルダを開き、次いでvisual studio toolsを開く。
2. Developer Command Prompt を選択する。
3. 開いたpromptで任意のファイル保存フォルダに移動する。
4. clコマンドを使いcompile。
5. 作成された実行ファイルを実行及び確認。

linuxではgccが利用できるので、もっと簡単である。だがまったく同じ使い方ができるとは限らない。
例えば、プログラムの終端にEOFがなければならない、conio.hなどのヘッダーファイルが存在しない、など。しかしprogrammingの勉強には大して差し障ることはない。