1

So after a bit of searching for Win32 GUI tutorials (I decided a tutorial on making GUIs might make me more active in making C++ applications and therefore stronger at programming in C++ in general,) I came across a rohitab tutorial. There are two parts that I have been able to find. Part 1 worked fine, and I'm now working on Part 2, however, I'm getting this error in Code::Blocks:

C:\Users\John\Documents\Windows GUIs\first_gui.cpp||In function 'C:\Users\John\Documents\Windows GUIs\first_gui.o:first_gui.cpp:(.text+0x281)||undefined reference to '_TextOutA@20'|

My code can be found here (broken link).

I would greatly appreciate any help.

John M.
  • 2,234
  • 4
  • 24
  • 36

3 Answers3

3

Did you link your app against GDI32.LIB?

David Titarenco
  • 32,662
  • 13
  • 66
  • 111
  • Thanks. I didn't, and I don't have the library, so I'm just going to use a better tutorial I just found. Thanks. =] – John M. Feb 01 '10 at 23:40
  • If you have windows, then you don't need the library. You can get the same result with statements in your .def file. – John Knoeller Feb 01 '10 at 23:42
3

Looks like a linker error, are you linking to gdi32.lib?

John Knoeller
  • 33,512
  • 4
  • 61
  • 92
0

You should download a WINDOWS SDK package, this include all libraries that you will need to create programs with GDI (including gdi32); Then in codeblocks/compiler/linkersettings choose folder where SDK's lib files are stored. That's is it!!.