From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) by sourceware.org (Postfix) with ESMTPS id 81F403857BB2 for ; Sun, 5 Jun 2022 10:14:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 81F403857BB2 Received: by mail-oi1-x232.google.com with SMTP id w130so16220966oig.0 for ; Sun, 05 Jun 2022 03:14:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=O8lEEl7kbOD5IKKL8qHjWYIbVddqineInfTjezaF3nQ=; b=PayMaiEWStnH5p+Zz5iDpauok6BcKUYKmD1uFFIUadkgCQ2RLPxrWaPX0afxu2ODvw xHqvmu5OHPnFbdKEdxewOqSDr+OkHTfCUpPOY4dX1tV4tcfXWPuVqDqTwCn1rJ5zgoOo qwYV2N3uVq109qcQBnqV8HpYMbPU/jsP+ZKo1lYiE5fAQbKHEpPG4zEXg8lE6hP7iIjG EJDNUh9PVPbfzYKut9/ITMWMxf10SRBcwuQU588KIR28L2ePbi3zq2XZ63enY9fCVWkH Ck1pqm+4I7DyYI+mWW5ZERdXGZq2vJzg2zjCz9mLOnNQaglnca3VVRL5chWFF4eJtm/M G87g== X-Gm-Message-State: AOAM530uOqxzgst+ehZTAHltVRryImeifk5sIq6i0YpMXQbv95NCP9KG lyDZROMZcTN2K0dNp+hqOgD1Eb5tfWJRaox3gFyej/ceppnakw== X-Google-Smtp-Source: ABdhPJywk+sYB4/eLNjLE7Zv5oQlkFO2aPYF/XfW+dE+gPJYqf+xGnrYe1AXeUJYgeWUSZZQOt9NOGElOB7qLjrTFXQ= X-Received: by 2002:a05:6808:d4a:b0:32e:578d:3e97 with SMTP id w10-20020a0568080d4a00b0032e578d3e97mr5847509oik.134.1654424041554; Sun, 05 Jun 2022 03:14:01 -0700 (PDT) MIME-Version: 1.0 From: Ren Wang Date: Sun, 5 Jun 2022 06:13:50 -0400 Message-ID: Subject: undefined reference To: libc-help@sourceware.org X-Spam-Status: No, score=-0.1 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" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: libc-help@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-help mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Jun 2022 10:14:03 -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 with Microsoft Visual Studio, but failed with gcc compiler with link errors: undefined reference to _disable, _enable. I have code included, very simple. I am not sure what the problem is, please advise. Regards, Ren --------------------------- #include #include #include int main() { _disable(); printf("Hello world!\n"); _enable(); return 0; }