public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: <renwang101@gmail.com>
To: <fedor_qd@mail.ru>
Cc: "'gcc-help'" <gcc-help@gcc.gnu.org>
Subject: RE: undefined reference
Date: Sun, 5 Jun 2022 18:54:34 -0400	[thread overview]
Message-ID: <003301d8792f$3a1f6730$ae5e3590$@gmail.com> (raw)
In-Reply-To: <1654466822.369451905@f27.my.com>

Ok, but which library?

 

From: fedor_qd@mail.ru <fedor_qd@mail.ru> 
Sent: June 5, 2022 6:07 PM
To: renwang101@gmail.com
Cc: gcc-help <gcc-help@gcc.gnu.org>
Subject: Re: undefined reference

 

You need linked to appropriate library if windows you target.

--
Sent from Outlook Email App for Android

нядзеля, 05 чэрвеня 2022, 04:04PM +03:00 from renwang101--- via Gcc-help gcc-help@gcc.gnu.org <mailto: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:

 

undefined reference to _disable, _enable. 

 

I have code included, very simple. I am not sure what the problem is, maybe I should link with a specific library. Please advise.

 

Regards,

 

Ren

---------------------------

#include 
#include 
#include 
int main()
{
    _disable();
    printf("Hello world!\n");
    _enable();
    return 0;
}


  reply	other threads:[~2022-06-05 22:54 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CA+JCqFYCePkAWFyUv5gp4rZbMUL8j71hBxY6=-4ju2DduhpCGA@mail.gmail.com>
2022-06-05 13:03 ` renwang101
2022-06-05 22:07   ` fedor_qd
2022-06-05 22:54     ` renwang101 [this message]
2004-09-11 15:35 zippo
2004-09-11 15:58 ` Eljay Love-Jensen
2004-09-11 20:00   ` zippo
2004-09-11 23:35     ` Eljay Love-Jensen
  -- strict thread matches above, loose matches on Subject: below --
2002-10-29 17:22 Undefined Reference Vincent Lee
2002-10-30  1:06 ` bjorn rohde jensen
2000-02-04  8:18 undefined reference Andre Heidenreich
2000-02-06 19:06 ` Alexandre Oliva
2000-04-01  0:00   ` Alexandre Oliva
2000-04-01  0:00 ` Andre Heidenreich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='003301d8792f$3a1f6730$ae5e3590$@gmail.com' \
    --to=renwang101@gmail.com \
    --cc=fedor_qd@mail.ru \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).