From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) by sourceware.org (Postfix) with ESMTPS id 4C7023856DEB for ; Sun, 5 Jun 2022 13:03:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4C7023856DEB Received: by mail-qt1-x82c.google.com with SMTP id j8so6025801qtn.13 for ; Sun, 05 Jun 2022 06:03:14 -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:references:in-reply-to:subject:date :message-id:mime-version:content-language:thread-index; bh=Nv9CPKaeHzN4yGlxnyKddthbTK5Dsly8VSwe3n9qPYw=; b=dSRsWwmMjQTIvAU5KXJYFoVDRouJE6wSkj/X075SsBJzS5M/99GB5PoKXAen82rMDQ 9B3RqpZtAwYfXpNoEVq14ZrEgR+NwP1avJqBQRCznfuK0qQmcaBCvVBIg/HMDVSsYa83 OMiRi/qWMLYI5MEzZucmXBYTLsqEhFA5zhSDUnvooKlWWhj3iaAkaEfHcei51mMHa5xm IZbR+ArBbagygWoBMYnAMtBSOdHQ50dqcizecy0pU6d9pA6Drd1NFp+DLVx17OJXbH9C CL5Dzr3Yy4jxEIM4W9qdzH2sJenO73RdpOUzHGDaIwUCwEbErXLyp2cbRzowhLLvMhec Fc1A== X-Gm-Message-State: AOAM530ITBV5A+MxgNqS5h2CuK/bhqxxZhlNfSzuSjhm9+9gw3nKkgdp L89PRg5vW2UjAKktjzGwtA3nlijnoeLBVQ== X-Google-Smtp-Source: ABdhPJxC07QIF0n5pj5iK8DAhgkBAHGnspTdBOlZ+lmoWDUPg2leLJTUmrbOVQhx8BuS8RnvZ/Hlnw== X-Received: by 2002:a05:622a:164e:b0:304:de40:3446 with SMTP id y14-20020a05622a164e00b00304de403446mr10369907qtj.407.1654434193204; Sun, 05 Jun 2022 06:03:13 -0700 (PDT) Received: from DESKTOPNEJ3BL1 ([142.186.54.253]) by smtp.gmail.com with ESMTPSA id u16-20020a05620a455000b006a6b1c11235sm2396658qkp.84.2022.06.05.06.03.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 05 Jun 2022 06:03:12 -0700 (PDT) From: To: References: In-Reply-To: Subject: undefined reference Date: Sun, 5 Jun 2022 09:03:12 -0400 Message-ID: <001401d878dc$9d2167a0$d76436e0$@gmail.com> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Content-Language: en-ca Thread-Index: AQHo7f3AKdW+B/Hs0ANXTkEydv/SvK0f3Mqw X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham 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 13:03:16 -0000 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 #include #include int main() { _disable(); printf("Hello world!\n"); _enable(); return 0; }