2
Today I reinstalled Mingw and set it up again, I tried it several times with some programs in c++ and it was working fine, but now I try to create new programs and when I will compile using the command:
g++ -o file file.cpp
He accuses the following mistake:
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../libmingw32.a(main.o):(.text.startup+0xa0): undefined reference to 'WinMain@16'
I managed to solve the problem by changing the main statement of:
int main()
for:
int main(int argc, char* argv[])
And now I can compile the programs normally. However, I would like to know what was the origin of the error, since earlier today I wrote and compiled programs with the main structure of the above example without any problem. Would anyone know to tell me?
What code you tried to compile and failed?
– Mário Feroldi
You will not have tried to compile before you even save the file ?
– Isac