LoginSignup
0
0

More than 5 years have passed since last update.

#c#環境構築

Posted at

cプログラミングの環境構築をしようと考えています。(Windows10)

①まず、MinGWを利用しようと思い、下記のサイトから最新のMinGWのファイルをダウンロードしました。
[リンク]https://sourceforge.net/projects/mingw-w64/

②次に、開発環境として、VisualStudioを利用しようと、思いました。
様々なサイトにおいて、環境変数の設定からパスを通すように、と書かれていたので、そのようにしました。
尚、私の場合は、C:\MinGW-w64\mingw32\binという場所に、exeファイルが入っていたので、同箇所のパスを通しました。

③コンパイルができてると思い、VisualStudioにおいて,
hello.cという名で下記のコードを作成し、

include

int main(void){
printf("Hello World!");
return 0;
}

ターミナルに
「gcc hello.c」と入力したところ、

「C:/MinGW-w64/mingw32/bin/../lib/gcc/i686-w64-mingw32/8.1.0/../../../../i686-w64-mingw32/lib/../lib/libmingw32.a(lib32_libmingw32_a-crt0_c.ongw32.a(lib32_libmingw32_a-crt0_c.o):crt0_c.c:(.text.startup 0x39): undefined reference to `WinMain@16'
collect2.exe: error: ld returned 1 exit status」

と表示されました。

何が問題なのでしょうか。ご教授願います。

0
0
1

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
0
0