커뮤니티
포인트
쿠폰
내 강의실
국비 신청 내역
증명서
계정
로그아웃
학습 질문
개발 일지
나의 활동
답변 완료
3강 g++ variable.cpp가 작동하지 않습니다.
undefined주차
북마크
이*수
댓글
1
추천
0
조회수
5
조회수
5
답변 완료


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




취소
 공유
취소
댓글 0
댓글 알림
나의얼굴