Undefined reference to ' GETSTOCKOBJECT@4 linker

Source: Internet
Author: User


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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.