+1  A: 

First, check you did actually save your main.c file (eclipse does not automatically save a source file)

Then, check if your makefile is autogenerated or if you can write it yourself, as in this thread.

CXXFLAGS = -O2 -g -Wall -fmessage-length=0

OBJS =  main.o

LIBS =

TARGET =    say.exe

$(TARGET):  $(OBJS)
    $(CXX) -o $(TARGET) $(OBJS) $(LIBS)

all:    $(TARGET)

clean:
    rm -f $(OBJS) $(TARGET)
VonC
See also http://yongshin.blogspot.com/2005/11/how-to-use-cdt-and-mingw-for-eclipse.html#c8263974258284865
VonC
+1  A: 

You're building a Windows Application, but you don't have a WinMain that is required by Windows applications.

Likely, you have a main instead. You'll need to either change your project settings (to something along the lines of "Console Application"), or use WinMain instead. You likely want the former.

Note, WinMain is not standard. This is just the Windows linkage requirement.

GMan
+2  A: 

(Is this a duplicate?)

You could keep your main but look up the options

--subsystem,windows -mwindows

in the documentation to your MinGW c++ compiler.

Peter Jansson