Ok, but which library? From: fedor_qd@xxxxxxx <fedor_qd@xxxxxxx> Sent: June 5, 2022 6:07 PM To: renwang101@xxxxxxxxx Cc: gcc-help <gcc-help@xxxxxxxxxxx> 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@xxxxxxxxxxx <mailto:gcc-help@xxxxxxxxxxx> : 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; }