Today, when writing a program with code::blocks, undefined reference to ' [email protected] linker this error.
Workaround 1: Right-click the project-->properties pop-up project/targets Options dialog box and select Project ' Build Options ' in Project settings to eject project The Build Options dialog box selects the Linker Settings tab and adds-mwindows save in the other linker options.
Workaround 2: MSDN, Getstockobject This function requires the use of Gdi32.lib. So to set the connector to connect to this library,
#pragma comment (lib, "Gdi32.lib") cause Analysis: Link parameter error. That is, different project parameters are set differently. Windows projects, like Windows projects, use Windows subsystems instead of the console subsystem, so if you do not use the MFC Wizard, you will get an error if you do not set the parameters properly. So make the following settings: [Project]--[Settings]--Select the "Link" property page and change the/subsystem:console to/subsystem:windows in Project options.
This article is from the "whatever957" blog, make sure to keep this source http://whatever957.blog.51cto.com/6835003/1629301
Undefined reference to '[email protected] linker