View Full Version : Build Win32 GUI in Eclipse Instead of Console App

Lysol Pionex
09-30-2011, 03:37 PM
Using Eclipse, I'm trying out this (http://www.codeproject.com/KB/game/TetroGL_Part1.aspx) tutorial to learn OpenGL, and I get 3 compiler errors:

Undefined reference to setpixelformat@12
Undefined reference to swapbuffers@4
Undefined reference to choosepixelformat@8

I have opengl32 and glu32 linked, so that's not the problem.

In fact, I've found the solution in two different areas:

These sites suggest that I need to make sure I'm building a Win32 GUI rather than a Win32 console. But when I create my project in Eclipse, I'm not given either of those options. Under File->New->Project, I only have options for a C project a C++ project and a Makefile project with existing code.

I can't find the option in my project properties either.

How would I build the GUI rather than build a console app?

Ilian Dinev
09-30-2011, 05:56 PM
Those functions are in GDI32.dll. Import the gdi32.a library (-lgdi32)

Lysol Pionex
09-30-2011, 07:30 PM
Oh bless you so much!