D - problem compiling dli : undefined reference to `errno'
- Giles Constant (25/25) May 19 2003 Hi there,
- Walter (4/4) May 19 2003 Since errno is implemented as a macro on many C compiler systems,
- Giles Constant (6/10) May 20 2003 **I** didn't use errno! :-) It doesn't appear in the source either.. it
- Giles Constant (14/20) May 20 2003 eg:
- Walter (1/1) May 20 2003 I suggest switching to the DMD linux version.
- Giles Constant (5/6) May 21 2003 ah.. now i'm getting results.. thanks :-)
- John Reimer (12/18) May 21 2003 So far as I know, Walter has released DMD Linux in binary form only
Hi there, Is this a problem with gcc3.2, or with the dli sources? I've heard there's problems in libc with gcc3.2 relating to errno, but didn't really understand the thread :-) make -C phobos make[1]: Entering directory `/usr/local/src/dli-0.1.2/phobos' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/usr/local/src/dli-0.1.2/phobos' ./dli test.d -unittest phobos/libphobos.so: undefined reference to `errno' collect2: ld returned 1 exit status ./test hello arguments make: ./test: Command not found make: *** [testfoo] Error 127 BST 2003 i686 Pentium III (Coppermine) GenuineIntel GNU/Linux gcc (GCC) 3.2.2 Copyright (C) 2002 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Thanks for any help, Giles
May 19 2003
Since errno is implemented as a macro on many C compiler systems, referencing "errno" from D code will rarely work. Therefore, use instead the function getErrno() which is defined in phobos/errno.c, which essentially translates the macro into something usable by D.
May 19 2003
Walter wrote:Since errno is implemented as a macro on many C compiler systems, referencing "errno" from D code will rarely work. Therefore, use instead the function getErrno() which is defined in phobos/errno.c, which essentially translates the macro into something usable by D.**I** didn't use errno! :-) It doesn't appear in the source either.. it appears to be a linker error when compiling with dli itself - even if I try to compile "hello_world.d" without referencing 'errno' at all, it pops up with a complaint about errno. See the original comment - I got the error immediately after typing "make" within the dli sources.
May 20 2003
I wrote:**I** didn't use errno! :-) It doesn't appear in the source either.. it appears to be a linker error when compiling with dli itself - even if I try to compile "hello_world.d" without referencing 'errno' at all, it pops up with a complaint about errno. See the original comment - I got the error immediately after typing "make" within the dli sources.eg: import string; int main(char[][] args) { printf("Hello world!\n"); return 0; } phobos/libphobos.so: undefined reference to `errno' collect2: ld returned 1 exit status /usr/local/src/dli-0.1.2
May 20 2003
ah.. now i'm getting results.. thanks :-) Quick question - how does one build it from source? There don't appear to be any makefiles or anything. I'd be interested in creating a gentoo package out of it. Walter wrote:I suggest switching to the DMD linux version.
May 21 2003
Giles Constant wrote:ah.. now i'm getting results.. thanks :-) Quick question - how does one build it from source? There don't appear to be any makefiles or anything. I'd be interested in creating a gentoo package out of it.So far as I know, Walter has released DMD Linux in binary form only (except for the front end?). I think a gentoo ebuild would be great too, but it would have to be a binary only package (which is completely feasible). A future Redhat RPM and Gentoo ebuild (and perhaps other distribution packages) would be a great form of publicity for the D language, I think. I really hope this happens soon. By the way, has anyone tried DMD Linux on FreeBSD yet (using the linux compatibility layer)? Later, John
May 21 2003
"John Reimer" <jjreimer telus.net> wrote in message news:bag9mn$2lio$1 digitaldaemon.com...So far as I know, Walter has released DMD Linux in binary form only (except for the front end?).That's correct.A future Redhat RPM and Gentoo ebuild (and perhaps other distribution packages) would be a great form of publicity for the D language, I think. I really hope this happens soon.I fully support the D community integrating D in with GCC!By the way, has anyone tried DMD Linux on FreeBSD yet (using the linux compatibility layer)?Not yet that I know of.
May 22 2003
In article <baj0m1$2e0e$1 digitaldaemon.com>, Walter says..."John Reimer" <jjreimer telus.net> wrote in message news:bag9mn$2lio$1 digitaldaemon.com...I think he really met packaging up your binary etc as a RPM for ease of installation. RPM is one of the standard install techniques for Linux, it is separate from GCC etc. For an Alpha/Beta product I'm not sure if this is necessary, I found DMD linux to be very easy to get working. If someday in the future, you sell a commercial DMD Linux distribution you would really need to address this. I'm sure many of the smart folks in this forum would be glad to give their assistance with this.So far as I know, Walter has released DMD Linux in binary form only (except for the front end?).That's correct.A future Redhat RPM and Gentoo ebuild (and perhaps other distribution packages) would be a great form of publicity for the D language, I think. I really hope this happens soon.I fully support the D community integrating D in with GCC!
May 23 2003
"Mark T" <Mark_member pathlink.com> wrote in message news:baldfn$2lag$1 digitaldaemon.com...I think he really met packaging up your binary etc as a RPM for ease of installation. RPM is one of the standard install techniques for Linux, it is separatefrom GCCetc. For an Alpha/Beta product I'm not sure if this is necessary, I foundDMDlinux to be very easy to get working. If someday in the future, you sell a commercial DMD Linux distribution youwouldreally need to address this. I'm sure many of the smart folks in thisforumwould be glad to give their assistance with this.Ok, I see.
May 23 2003