Thread overview
DMD Linux Compilation
Jun 21, 2003
Simon J Mackenzie
Jun 22, 2003
Walter
Jun 22, 2003
Simon J Mackenzie
Jun 22, 2003
Walter
Jun 23, 2003
Simon J Mackenzie
June 21, 2003
Howdy,
Help with D Linux needed!
I havn't been able to compile the phobos library (errno.c is missing/is it needed??) for D linux compilation.
Has anyone been successful with compiling D programs under linux using version 0.67?  Also vsnprintf seems to be incorrectly declared in some D souce modules - vsnprintf instead of _vsnprintf??

Thanks in advance

Simon / new DeeVoteTee

June 22, 2003
I forgot to add errno.c into dmd.zip. Here it is:

---------------------------------------------
/* Make D independent of all the various ways errno can be defined.
 */

#include <errno.h>

int getErrno()
{
    return errno;
}
---------------------------------------------

vsnprintf works on Redhat linux - what are you using?

"Simon J Mackenzie" <project.d@smackoz.fastmail.fm> wrote in message news:bd158r$1adk$1@digitaldaemon.com...
> Howdy,
> Help with D Linux needed!
> I havn't been able to compile the phobos library (errno.c is missing/is
> it needed??) for D linux compilation.
> Has anyone been successful with compiling D programs under linux using
> version 0.67?  Also vsnprintf seems to be incorrectly declared in some D
> souce modules - vsnprintf instead of _vsnprintf??
>
> Thanks in advance
>
> Simon / new DeeVoteTee
>


June 22, 2003
I'm using Mandrake 9.0. gcc 3.2.
The error is in outbuffer.d, line 224, stream.d, line 734 and math2.d,line 1338.

#make libphobos.a
#.
#.
#.
#dmd -c -O -release outbuffer.d
#outbuffer.d(224): undefined identifier vsnprintf
#make: *** [outbuffer.o] Error 1

etc.

My compiler seems happy when I change vnsprintf to _vnsprintf and snprintf to _snprintf and make the phobos library...

#make libphobos.a
#.
#.
#.
#dmd -c -O -release outbuffer.d
#dmd -c -O -release stream.d
#dmd -c -O -release math2.d
#ar -r libphobos.a assert.o deh2.o switch.o complex.o gcstats.o
#.
#.
#.
#ti_char.o date.o dateparse.o llmath.o math2.o gc2/gc.o gc2/gcx.o #gc2/gcbits.o gc2/gclinux.o

But if I try to make the unittest programs.
Then the following errors occur...

make
gcc -o unittest unittest.o libphobos.a -lpthread -lm -g
unittest.o: In function `_Dmain':
unittest.o(.gnu.linkonce.t_Dmain+0xde): undefined reference to `_Dutf_isValidDchar_FkZb'
unittest.o(.gnu.linkonce.t_Dmain+0xe5): undefined reference to `_Duri_ascii2hex_FkZk'
libphobos.a(outbuffer.o): In function `_Doutbuffer_OutBuffer_vprintf_FAaPhZv':
outbuffer.o(.gnu.linkonce.t_Doutbuffer_OutBuffer_vprintf_FAaPhZv+0x4d): undefined reference to `_vsnprintf'
libphobos.a(stream.o): In function `_Dstream_Stream_vprintf_FAaPhZk':
stream.o(.gnu.linkonce.t_Dstream_Stream_vprintf_FAaPhZk+0x4e): undefined reference to `_vsnprintf'
libphobos.a(math2.o): In function `_Dmath2_toString_FeZAa':
math2.o(.gnu.linkonce.t_Dmath2_toString_FeZAa+0x42): undefined reference to `_snprintf'
collect2: ld returned 1 exit status
make: *** [unittest] Error 1

Hope this helps

Simon J Mackenzie

Walter wrote:
> I forgot to add errno.c into dmd.zip. Here it is:
> 
> ---------------------------------------------
> /* Make D independent of all the various ways errno can be defined.
>  */
> 
> #include <errno.h>
> 
> int getErrno()
> {
>     return errno;
> }
> ---------------------------------------------
> 
> vsnprintf works on Redhat linux - what are you using?
> 
> 

June 22, 2003
I uploaded some missing files to dmd.zip, pls try again.


June 23, 2003
Walter wrote:
> I uploaded some missing files to dmd.zip, pls try again.
> 
> 

Thank you. Got lots further...

Some notes...

The phobos library compiled ok.
linux.mak: The make rule for testgc still points to phobos.a instead of libphobos.a. With this correction the GC unit test compiled and ran ok.

The phobos unit test make broke during the compile stage with the following error...

#[smack@smack phobos]$ make
#gcc -o unittest unittest.o libphobos.a -lpthread -lm -g
#unittest.o: In function `_Dmain':
#unittest.o(.gnu.linkonce.t_Dmain+0xe0): undefined reference to #`_Dutf_isValidDchar_FkZb'
#unittest.o(.gnu.linkonce.t_Dmain+0xe7): undefined reference to #`_Duri_ascii2hex_FkZk'
#collect2: ld returned 1 exit status
#make: *** [unittest] Error 1

chow for now

Simon J Mackenzie

NB: I made sure the old libphobos.a library was deleted before running make on the updated dmd.zip source.