www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - linux gcc and/or phobos issues with Build

reply Brad Anderson <brad dsource.dot.org> writes:
I'm trying to upgrade to the latest version of Build on linux, and am 
having some issues with it.  I suspect it's something wrong with 
dmd/gcc/phobos, so I'm posting here.  I don't think it's a 
Build-specific issue.


Here's the error:
------------------------------------------------------------
 make -f Makefile.unix
dmd -op -release -inline -ofbuild build.d util/pathex_bn.d util/pathex.d source_bn.d util/str.d build_bn.d util/fdt_bn.d util/str_bn.d source.d util/fdt.d gcc build.o util/pathex_bn.o util/pathex.o source_bn.o util/str.o build_bn.o util/fdt_bn.o util/str_bn.o source.o util/fdt.o -o build -lphobos -lpthread -lm build.o(.data+0x130): undefined reference to `_ModuleInfo_4util6fileex' build.o(.gnu.linkonce.t_D5build9LoadRulesFZAS5build4Rule+0xef): In function `_D5build9LoadRulesFZAS5build4Rule': : undefined reference to `_D4util6fileex12GetTextLinesFAaE6GetOptZAAa' build.o(.gnu.linkonce.t_D5build5BuildFZi+0xb77): In function `_D5build5BuildFZi': <snip> 10 or so more collect2: ld returned 1 exit status --- errorlevel 1 make: *** [build] Error 1 ------------------------------------------------------------ It may be because I did a Gentoo ebuild for GDC. But I've since re-emerged GCC 3.3.5 w/o GDC. I'm using DMD 0.119 located in /opt/dmd/bin and have libphobos.a in /opt/dmd/lib. I then have symbolic links for /usr/bin/dmd and /usr/lib/libphobos.a, respectively. Anyone see any bonehead thing I'm doing wrong? Thanks, BA
Mar 26 2005
parent reply Derek Parnell <derek psych.ward> writes:
On Sun, 27 Mar 2005 01:03:36 -0600, Brad Anderson wrote:

 I'm trying to upgrade to the latest version of Build on linux, and am 
 having some issues with it.  I suspect it's something wrong with 
 dmd/gcc/phobos, so I'm posting here.  I don't think it's a 
 Build-specific issue.
 
 
 Here's the error:
 ------------------------------------------------------------
  > make -f Makefile.unix
 dmd  -op -release -inline -ofbuild build.d util/pathex_bn.d 
 util/pathex.d source_bn.d util/str.d build_bn.d util/fdt_bn.d 
 util/str_bn.d source.d util/fdt.d
 gcc build.o util/pathex_bn.o util/pathex.o source_bn.o util/str.o 
 build_bn.o util/fdt_bn.o util/str_bn.o source.o util/fdt.o -o build 
 -lphobos -lpthread -lm
 build.o(.data+0x130): undefined reference to `_ModuleInfo_4util6fileex' 
 build.o(.gnu.linkonce.t_D5build9LoadRulesFZAS5build4Rule+0xef): In 
 function `_D5build9LoadRulesFZAS5build4Rule':
: undefined reference to `_D4util6fileex12GetTextLinesFAaE6GetOptZAAa'
 build.o(.gnu.linkonce.t_D5build5BuildFZi+0xb77): In function 
 `_D5build5BuildFZi':
 
 <snip> 10 or so more
 
 collect2: ld returned 1 exit status
 --- errorlevel 1
 make: *** [build] Error 1
 ------------------------------------------------------------
 
 It may be because I did a Gentoo ebuild for GDC.  But I've since 
 re-emerged GCC 3.3.5 w/o GDC.
 
 I'm using DMD 0.119 located in /opt/dmd/bin and have libphobos.a in 
 /opt/dmd/lib.  I then have symbolic links for /usr/bin/dmd and 
 /usr/lib/libphobos.a, respectively.
 
 Anyone see any bonehead thing I'm doing wrong?
 
 Thanks,
 BA
That's my fault. Because I use build to create Build exes in Windows, I forgot about the makefile for it. Anyhow, here is the unix make file you should be using. Sorry. DMD=dmd DFLAGS=-op -release -inline SOURCES=build.d util/pathex_bn.d util/pathex.d source_bn.d util/str.d build_bn.d util/fdt_bn.d util/str_bn.d source.d util/fdt.d util/fileex.d util/fileex_bn.d util/linetoken.d util/linetoken_bn.d all: build build: $(SOURCES) $(DMD) $(DFLAGS) -of$ $(SOURCES) clean: rm -f *.o build -- Derek Parnell Melbourne, Australia 27/03/2005 5:36:24 PM
Mar 26 2005
parent Brad Anderson <brad dsource.dot.org> writes:
Derek Parnell wrote:
 
 
 That's my fault. Because I use build to create Build exes in Windows, I
 forgot about the makefile for it. Anyhow, here is the unix make file you
 should be using. Sorry.
 
 

 DMD=dmd 
 DFLAGS=-op -release -inline
 SOURCES=build.d util/pathex_bn.d util/pathex.d source_bn.d util/str.d
 build_bn.d util/fdt_bn.d util/str_bn.d source.d util/fdt.d util/fileex.d
 util/fileex_bn.d util/linetoken.d util/linetoken_bn.d
 
 all: build 
 
 build: $(SOURCES) 
 	$(DMD) $(DFLAGS) -of$  $(SOURCES) 
 
 clean: 
 	rm -f *.o build

 
Worked like a charm. Thanks. BA
Mar 27 2005