How do I link to a library with Code::Blocks?

后端 未结 2 1264
终归单人心
终归单人心 2020-11-22 06:04

C++ GUI Tutorial: undefined reference to TextOut

I have the same problem, but I\'m new to programming and Code::Blocks, and I want to use the GDI32 library. How can

2条回答
  •  余生分开走
    2020-11-22 06:24

    At a guess, you used Code::Blocks to create a Console Application project. Such a project does not link in the GDI stuff, because console applications are generally not intended to do graphics, and TextOut is a graphics function. If you want to use the features of the GDI, you should create a Win32 Gui Project, which will be set up to link in the GDI for you.

提交回复
热议问题