* undefined reference
[not found] <CA+JCqFYCePkAWFyUv5gp4rZbMUL8j71hBxY6=-4ju2DduhpCGA@mail.gmail.com>
@ 2022-06-05 13:03 ` renwang101
2022-06-05 22:07 ` fedor_qd
0 siblings, 1 reply; 13+ messages in thread
From: renwang101 @ 2022-06-05 13:03 UTC (permalink / raw)
To: gcc-help
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 <stdio.h>
#include <stdlib.h>
#include <intrin.h>
int main()
{
_disable();
printf("Hello world!\n");
_enable();
return 0;
}
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: undefined reference
2022-06-05 13:03 ` undefined reference renwang101
@ 2022-06-05 22:07 ` fedor_qd
2022-06-05 22:54 ` renwang101
0 siblings, 1 reply; 13+ messages in thread
From: fedor_qd @ 2022-06-05 22:07 UTC (permalink / raw)
To: renwang101; +Cc: gcc-help
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 :
>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;
>}
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* RE: undefined reference
2022-06-05 22:07 ` fedor_qd
@ 2022-06-05 22:54 ` renwang101
0 siblings, 0 replies; 13+ messages in thread
From: renwang101 @ 2022-06-05 22:54 UTC (permalink / raw)
To: fedor_qd; +Cc: 'gcc-help'
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;
}
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: undefined reference
2004-09-11 20:00 ` zippo
@ 2004-09-11 23:35 ` Eljay Love-Jensen
0 siblings, 0 replies; 13+ messages in thread
From: Eljay Love-Jensen @ 2004-09-11 23:35 UTC (permalink / raw)
To: zippo, gcc-help
Hi zippo,
I don't know what the dvdread library is called. Whatever it's called, you
need to add it to the compile/link line.
Something sort of like...
gcc myapp.c -o myapp -L/usr/dvdread -ldvdread
HTH,
--Eljay
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: undefined reference
2004-09-11 15:58 ` Eljay Love-Jensen
@ 2004-09-11 20:00 ` zippo
2004-09-11 23:35 ` Eljay Love-Jensen
0 siblings, 1 reply; 13+ messages in thread
From: zippo @ 2004-09-11 20:00 UTC (permalink / raw)
To: Eljay Love-Jensen, gcc-help
I would say that is a very strong possablity. I hate to bother you, for a dumb question. How would i go about linking it?! i am useing files in /usr/include/dvdread and they come frome the libdvdread package. Any help and i would be most thankful.
On Sat, 11 Sep 2004 10:58:06 -0500
Eljay Love-Jensen <eljay@adobe.com> wrote:
> Hi zippo,
>
> Your code looks okay.
>
> Did you forget to include your dvdread library on the compile/link line?
>
> HTH,
> --Eljay
>
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: undefined reference
2004-09-11 15:35 zippo
@ 2004-09-11 15:58 ` Eljay Love-Jensen
2004-09-11 20:00 ` zippo
0 siblings, 1 reply; 13+ messages in thread
From: Eljay Love-Jensen @ 2004-09-11 15:58 UTC (permalink / raw)
To: zippo, gcc-help
Hi zippo,
Your code looks okay.
Did you forget to include your dvdread library on the compile/link line?
HTH,
--Eljay
^ permalink raw reply [flat|nested] 13+ messages in thread
* undefined reference
@ 2004-09-11 15:35 zippo
2004-09-11 15:58 ` Eljay Love-Jensen
0 siblings, 1 reply; 13+ messages in thread
From: zippo @ 2004-09-11 15:35 UTC (permalink / raw)
To: gcc-help
I am getting a undefined reference error to this code. I don't see why. Any help would be great.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dvdread/dvd_reader.h>
#include <dvdread/ifo_types.h>
#include <dvdread/ifo_read.h>
#include <dvdread/nav_read.h>
#include <dvdread/nav_print.h>
int main() {
ifo_handle_t *vmg_file;
dvd_reader_t *dvd;
vmg_file = ifoOpen( dvd, 0 );
//printf ("YAY %s", vmg_file);
ifoClose( vmg_file );
}
$ gcc main.c -o rip
/tmp/cc8cLKIQ.o(.text+0x2b): In function `main':
: undefined reference to `ifoOpen'
/tmp/cc8cLKIQ.o(.text+0x39): In function `main':
: undefined reference to `ifoClose'
collect2: ld returned 1 exit status
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: Undefined Reference
2002-10-29 17:22 Undefined Reference Vincent Lee
@ 2002-10-30 1:06 ` bjorn rohde jensen
0 siblings, 0 replies; 13+ messages in thread
From: bjorn rohde jensen @ 2002-10-30 1:06 UTC (permalink / raw)
To: axwack; +Cc: gcc-help
Hi Vincent,
Undefined references sounds more like a linker problem,
are you linking with the library, where the methods
declared in db2.h are defined?
Yours sincerely,
Bjorn
^ permalink raw reply [flat|nested] 13+ messages in thread
* Undefined Reference
@ 2002-10-29 17:22 Vincent Lee
2002-10-30 1:06 ` bjorn rohde jensen
0 siblings, 1 reply; 13+ messages in thread
From: Vincent Lee @ 2002-10-29 17:22 UTC (permalink / raw)
To: gcc-help
I'm new to using C and the GNU compilers. I'm trying
to use the Db2 C samples. I am getting a problem with
an UNDEFINED REFERENCE. In a header file called
db2util.h there are some static METHODS that the
compiler is complaining about.
Does anyone know what this means? What kind of problem
is this?
=====
Regards,
Vincent
__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/
^ permalink raw reply [flat|nested] 13+ messages in thread
* undefined reference
2000-02-04 8:18 undefined reference Andre Heidenreich
2000-02-06 19:06 ` Alexandre Oliva
@ 2000-04-01 0:00 ` Andre Heidenreich
1 sibling, 0 replies; 13+ messages in thread
From: Andre Heidenreich @ 2000-04-01 0:00 UTC (permalink / raw)
To: gcc-help
hi gcc-users
i've a problem when i compiling and linking glibc-2.1.2.
the following error occured
$> gcc -nostdlib -nostartfiles -o /usr/src/misc/glibc-2.1.2.obj/db2/makedb
/usr/src/misc/glibc-2.1.2.obj/csu/crt1.o
/usr/src/misc/glibc-2.1.2.obj/csu/crti.o `gcc
--print-file-name=crtbegin.o`
/usr/src/misc/glibc-2.1.2.obj/db2/makedb.o
/usr/src/misc/glibc-2.1.2.obj/db2/libdb.so.3
-Wl,-rpath-link=/usr/src/misc/glibc-2.1.2.obj:/usr/src/misc/glibc-2.1.2.obj/math:/usr/src/misc/glibc-2.1.2.obj/elf:/usr/src/misc/glibc-2.1.2.obj/nss:/usr/src/misc/glibc-2.1.2.obj/nis:/usr/src/misc/glibc-2.1.2.obj/db2:/usr/src/misc/glibc-2.1.2.obj/rt:/usr/src/misc/glibc-2.1.2.obj/resolv:/usr/src/misc/glibc-2.1.2.obj/linuxthreads
/usr/src/misc/glibc-2.1.2.obj/libc.so.6.1
/usr/src/misc/glibc-2.1.2.obj/libc_nonshared.a -lgcc `gcc
--print-file-name=crtend.o` /usr/src/misc/glibc-2.1.2.obj/csu/crtn.o
/usr/src/misc/glibc-2.1.2.obj/elf/ld-linux.so.2: undefined reference to
`__libc_global_ctors'
why was /usr/src/misc/glibc-2.1.2.obj/elf/ld-linux.so.2 used?
$> nm /usr/src/misc/glibc-2.1.2.obj/elf/ld-linux.so.2 | grep
__libc_global_ctors
U __libc_global_ctors
and
$> nm /usr/src/misc/glibc-2.1.2.obj/libc.so.6.1 | grep
__libc_global_ctors
0000000000031ba0 t __libc_global_ctors
and also
$> nm /lib/libc.so.6.1 | grep __libc_global_ctors
0000000000032280 t __libc_global_ctors
why are there errors during linking?
my system:
$> gcc -v
Reading specs from
/usr/local/lib/gcc-lib/alphaev56-unknown-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)
with glibc-2.1.2-17.alpha.rpm installed
thx for advise
andre
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: undefined reference
2000-02-06 19:06 ` Alexandre Oliva
@ 2000-04-01 0:00 ` Alexandre Oliva
0 siblings, 0 replies; 13+ messages in thread
From: Alexandre Oliva @ 2000-04-01 0:00 UTC (permalink / raw)
To: Andre Heidenreich; +Cc: gcc-help
On Feb 4, 2000, Andre Heidenreich <andre@swol.de> wrote:
> i've a problem when i compiling and linking glibc-2.1.2.
This is not really the place to ask for help on installing glibc. How
about writing to a glibc mailing list?
> 0000000000032280 t __libc_global_ctors
> why are there errors during linking?
`t' indicates a local symbol, i.e., one that is not available to other
libraries/objects.
--
Alexandre Oliva http://www.ic.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
oliva@{lsd.ic.unicamp.br,guarana.{org,com}} aoliva@{acm,computer}.org
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
** I may forward mail about projects to mailing lists; please use them
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: undefined reference
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
1 sibling, 1 reply; 13+ messages in thread
From: Alexandre Oliva @ 2000-02-06 19:06 UTC (permalink / raw)
To: Andre Heidenreich; +Cc: gcc-help
On Feb 4, 2000, Andre Heidenreich <andre@swol.de> wrote:
> i've a problem when i compiling and linking glibc-2.1.2.
This is not really the place to ask for help on installing glibc. How
about writing to a glibc mailing list?
> 0000000000032280 t __libc_global_ctors
> why are there errors during linking?
`t' indicates a local symbol, i.e., one that is not available to other
libraries/objects.
--
Alexandre Oliva http://www.ic.unicamp.br/~oliva IC-Unicamp, Bra[sz]il
oliva@{lsd.ic.unicamp.br,guarana.{org,com}} aoliva@{acm,computer}.org
oliva@{gnu.org,kaffe.org,{egcs,sourceware}.cygnus.com,samba.org}
** I may forward mail about projects to mailing lists; please use them
^ permalink raw reply [flat|nested] 13+ messages in thread
* undefined reference
@ 2000-02-04 8:18 Andre Heidenreich
2000-02-06 19:06 ` Alexandre Oliva
2000-04-01 0:00 ` Andre Heidenreich
0 siblings, 2 replies; 13+ messages in thread
From: Andre Heidenreich @ 2000-02-04 8:18 UTC (permalink / raw)
To: gcc-help
hi gcc-users
i've a problem when i compiling and linking glibc-2.1.2.
the following error occured
$> gcc -nostdlib -nostartfiles -o /usr/src/misc/glibc-2.1.2.obj/db2/makedb
/usr/src/misc/glibc-2.1.2.obj/csu/crt1.o
/usr/src/misc/glibc-2.1.2.obj/csu/crti.o `gcc
--print-file-name=crtbegin.o`
/usr/src/misc/glibc-2.1.2.obj/db2/makedb.o
/usr/src/misc/glibc-2.1.2.obj/db2/libdb.so.3
-Wl,-rpath-link=/usr/src/misc/glibc-2.1.2.obj:/usr/src/misc/glibc-2.1.2.obj/math:/usr/src/misc/glibc-2.1.2.obj/elf:/usr/src/misc/glibc-2.1.2.obj/nss:/usr/src/misc/glibc-2.1.2.obj/nis:/usr/src/misc/glibc-2.1.2.obj/db2:/usr/src/misc/glibc-2.1.2.obj/rt:/usr/src/misc/glibc-2.1.2.obj/resolv:/usr/src/misc/glibc-2.1.2.obj/linuxthreads
/usr/src/misc/glibc-2.1.2.obj/libc.so.6.1
/usr/src/misc/glibc-2.1.2.obj/libc_nonshared.a -lgcc `gcc
--print-file-name=crtend.o` /usr/src/misc/glibc-2.1.2.obj/csu/crtn.o
/usr/src/misc/glibc-2.1.2.obj/elf/ld-linux.so.2: undefined reference to
`__libc_global_ctors'
why was /usr/src/misc/glibc-2.1.2.obj/elf/ld-linux.so.2 used?
$> nm /usr/src/misc/glibc-2.1.2.obj/elf/ld-linux.so.2 | grep
__libc_global_ctors
U __libc_global_ctors
and
$> nm /usr/src/misc/glibc-2.1.2.obj/libc.so.6.1 | grep
__libc_global_ctors
0000000000031ba0 t __libc_global_ctors
and also
$> nm /lib/libc.so.6.1 | grep __libc_global_ctors
0000000000032280 t __libc_global_ctors
why are there errors during linking?
my system:
$> gcc -v
Reading specs from
/usr/local/lib/gcc-lib/alphaev56-unknown-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)
with glibc-2.1.2-17.alpha.rpm installed
thx for advise
andre
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2022-06-05 22:54 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CA+JCqFYCePkAWFyUv5gp4rZbMUL8j71hBxY6=-4ju2DduhpCGA@mail.gmail.com>
2022-06-05 13:03 ` undefined reference renwang101
2022-06-05 22:07 ` fedor_qd
2022-06-05 22:54 ` renwang101
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
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).