undefined reference to `WinMain@16'

前端 未结 6 2403
花落未央
花落未央 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:24

    Check that All Files are Included in Your Project:

    I had this same error pop up after I updated cLion. After hours of tinkering, I noticed one of my files was not included in the project target. After I added it back to the active project, I stopped getting the undefined reference to winmain16, and the code compiled.

    Edit: It's also worthwhile to check the build settings within your IDE.

    (Not sure if this error is related to having recently updated the IDE - could be causal or simply correlative. Feel free to comment with any insight on that factor!)

提交回复
热议问题