
1-1 파일로 이동해서 g++ helloworld.cpp라고 작성하면 a.exe파일이 만들어 지는데,
여기서 1-2파일로 이동한다음 g++ variable.cpp를 실행하면 아래 오류가 뜹니다

작성한 코드 및 에러 메세지
#include <iostream>
int main(){
using namespace std;
int age = 10;
cout << " I am " << age << endl;
return 0;
}
collect2.exe: error: ld returned 1 exit status
PS C:\Users\82109\Desktop\스파르타코딩\cpp\1-2> g++ variable.cpp
C:/Program Files (x86)/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/lib/../lib/libmingw32.a(lib64_libmingw32_a-crt0_c.o):crt0_c.c:(.text.startup+0x2e): undefined reference to `WinMain'
collect2.exe: error: ld returned 1 exit status
