Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » Problem with building code in C(undefined reference to `WinMain@16')
Problem with building code in C [message #902696] Sun, 19 August 2012 16:39 Go to next message
Eclipse UserFriend
Hi, I'm quite a beginner, I've recently finished a course of intro to C in which we were using Code::Blocks, and now in the more advanced course they told us to switch to Eclipse, I've installed the program along with MinGW, and everything else that the installation guide told me to install, but i have a problem when trying to build even very simple code, (code that works in code::blocks) it always gives me this message:

**** Build of configuration Debug for project DecToBin ****

**** Internal Builder is used for build               ****
gcc -o DecToBin.exe main.o
c:/mingw/bin/../lib/gcc/mingw32/4.6.1/../../../libmingw32.a(main.o): In function `main':
C:\MinGW\msys\1.0\src\mingwrt/../mingw/main.c:73: undefined reference to `WinMain@16'
collect2: ld returned 1 exit status
Build error occurred, build is stopped
Time consumed: 234  ms.  


the code used to produce this example was:
#include <stdio.h>

int main()
{
	int n;
	scanf("%d", &n);
	printf("%d", n);
	return 0;
}


and in case this is needed this is the PATH i have set up:
C:\MinGW\bin;C:\Modeltech_pe_edu_10.1a\win32pe_edu;c:\mingw\msys\1.0\bin

I searched the forum and have noticed that the question has been asked many times before but any answer i could find was way over my head, ism in no way a programmer, i just know some basic C, would be really happy to get some help with this

thanks!
Re: Problem with building code in C [message #902724 is a reply to message #902696] Mon, 20 August 2012 03:10 Go to previous message
Eclipse UserFriend
http://www.eclipse.org/forums/index.php/m/634768/?srch=undefined+reference+to+WinMain#msg_634768
Previous Topic:Extract C method name from a Java Code
Next Topic:Eclipse showing false bugs when using CDT + QT + Opengl
Goto Forum:
  


Current Time: Tue Jun 24 21:28:52 EDT 2025

Powered by FUDForum. Page generated in 0.07033 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top