this is my code
#include<stdio.h>
int main()
{
printf("I just started");
return 0;
}
and this is the error
PS E:\coding> cd "e:\coding\" ; if ($?) { gcc tempCodeRunnerFile.c -o tempCodeRunnerFile } ; if ($?) { .\tempCodeRunnerFile }
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../libmingw32.a(main.o):(.text.startup+0xc0): undefined reference to `WinMain@16'
collect2.exe: error: ld returned 1 exit status
The main issue is that "YOU DIDN'T save YOUR FILE", first save your cpp file then enter the command (g++ file.cpp) or run it. Usually, this error occurs when file was not saved.
so click anywhere on your file and press ctrl+s to save it again, NOW YOUR ERROR GOT FIXXED, ......................
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.