From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) by sourceware.org (Postfix) with ESMTPS id 793CE385DC04 for ; Sun, 5 Jun 2022 22:54:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 793CE385DC04 Received: by mail-qk1-x731.google.com with SMTP id br33so8096898qkb.0 for ; Sun, 05 Jun 2022 15:54:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:references:in-reply-to:subject:date :message-id:mime-version:thread-index:content-language; bh=B/sqXmONMM35HSThvW1QgiTmhPkppMQzSUTssPEx7iE=; b=cN2n4HmJl+WkUX2hKA+NPFoyux3P7ZUIZtOVxULLyyRB/KOsNkmWOAJEX3MXTlukV5 baKixCGXAe9WImlumHpFz8qlrhmHwe+NpCA8024RH/krDnPyFXNkF8eHFUXAoyO6Wzs+ 9dJAflEERzsusAAbZpmiGqpSFkYdnD8g/rTHFGxTpkB13DwQnWTX4O6xxypST3hTmfIL B6T0zmoDumFY7Anln8pp0/1OzSiHHjx5l2n9Ucj0wlW3XdlEH3Vts9tm9kZc4cPjFmjD 1SpuckwNC1ozzCuTksUGh+2Gz0LKVyENcbejWzNyvoU2u3qSJBdSySuE9PE5fGPVgyXX WCnA== X-Gm-Message-State: AOAM532pkiDsLJSpHO+c1KcV7n7mKKJ58Wp/RhE8lIIWmuRN4gEYekZP nzb13auTYAzx65W2sHjK9y8= X-Google-Smtp-Source: ABdhPJyaT19dTVHsR/U0k8NIQpZR/7sF6rbYdvwF8//r6jzgAKevEs7mlFc9p34eblF9NWB+z/6xzg== X-Received: by 2002:a05:620a:45a4:b0:6a4:bb4f:a8ff with SMTP id bp36-20020a05620a45a400b006a4bb4fa8ffmr13814784qkb.590.1654469675568; Sun, 05 Jun 2022 15:54:35 -0700 (PDT) Received: from DESKTOPNEJ3BL1 ([142.186.54.253]) by smtp.gmail.com with ESMTPSA id n79-20020a374052000000b0069fc13ce23dsm10211766qka.110.2022.06.05.15.54.34 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 05 Jun 2022 15:54:35 -0700 (PDT) From: To: Cc: "'gcc-help'" References: <001401d878dc$9d2167a0$d76436e0$@gmail.com> <1654466822.369451905@f27.my.com> In-Reply-To: <1654466822.369451905@f27.my.com> Subject: RE: undefined reference Date: Sun, 5 Jun 2022 18:54:34 -0400 Message-ID: <003301d8792f$3a1f6730$ae5e3590$@gmail.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQHo7f3AKdW+B/Hs0ANXTkEydv/SvAJcQU1bAjf7tsSs++BhQA== Content-Language: en-ca X-Spam-Status: No, score=0.9 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, FREEMAIL_REPLY, HTML_MESSAGE, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: gcc-help@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-help mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2022 22:54:39 -0000 Ok, but which library? =20 From: fedor_qd@mail.ru =20 Sent: June 5, 2022 6:07 PM To: renwang101@gmail.com Cc: gcc-help Subject: Re: undefined reference =20 You need linked to appropriate library if windows you target. -- Sent from Outlook Email App for Android =D0=BD=D1=8F=D0=B4=D0=B7=D0=B5=D0=BB=D1=8F, 05 = =D1=87=D1=8D=D1=80=D0=B2=D0=B5=D0=BD=D1=8F 2022, 04:04PM +03:00 from = renwang101--- via Gcc-help gcc-help@gcc.gnu.org = : I am working on a project which calls _disable and _enable interrupt = built in functions in the Windows environment. I can build the code with = /Oi flag with Microsoft Visual Studio, but failed with gcc compiler with = link errors: =20 undefined reference to _disable, _enable.=20 =20 I have code included, very simple. I am not sure what the problem is, = maybe I should link with a specific library. Please advise. =20 Regards, =20 Ren --------------------------- #include=20 #include=20 #include=20 int main() { _disable(); printf("Hello world!\n"); _enable(); return 0; }