undefined reference to `WinMain@16'

前端 未结 6 2264
花落未央
花落未央 2020-11-21 06:46

When I try to build a program using Eclipse CDT, I get the following:

/mingw/lib/libmingw32.a(main.o):main.c:(.text+0x106): undefined r

6条回答
  •  长情又很酷
    2020-11-21 07:11

    To summarize the above post by Cheers and hth. - Alf, Make sure you have main() or WinMain() defined and g++ should do the right thing.

    My problem was that main() was defined inside of a namespace by accident.

提交回复
热议问题