Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 20:39 Go to next message
tal man is currently offline tal manFriend
Messages: 1
Registered: August 2012
Junior Member
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:

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

Re: Problem with building code in C [message #902724 is a reply to message #902696] Mon, 20 August 2012 07:10 Go to previous message
Axel Mueller is currently offline Axel MuellerFriend
Messages: 1973
Registered: July 2009
Senior Member

Before you ask
- search this forum
- see the FAQ
- google
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: Thu Apr 26 04:11:30 GMT 2018

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

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