www.digitalmars.com         C & C++   DMDScript  

D.gnu - r50 mingw32 doesn't work

reply "Tomas Lindquist Olsen" <tomas famolsen.dk> writes:
Hi folks.

I've been trying to compile GDC in mingw32, and while I managed to
compile it I can't get it to work properly.

I'm using 0.20-dev revision 50.

./configure --prefix=c:/gdc --enable-threads=win32
--enable-languages=c,d --disable-nls --disable-win32-registry
--disable-shared --disable-bootstrap
&&
make all
&&
make install

I also tried --prefix=/gdc same problem. And the problem is:

object.d: module object cannot read file 'object.d'

I then try adding /c/gdc/include/d/3.4.2 as include path but then I get:

C:\MinGW\bin\ld.exe: crt2.o: No such file: No such file or directory

The crt2.o file is not anywhere to be found. neither in my build or
install dirs.

I'm not really sure where to go from here... any help will be much
appreciated!

-- 
Dec 06 2006
next sibling parent David Friedman <dvdfrdmn users.ess-eff.net> writes:
Tomas Lindquist Olsen wrote:
 Hi folks.
 
 I've been trying to compile GDC in mingw32, and while I managed to
 compile it I can't get it to work properly.
 
 I'm using 0.20-dev revision 50.
 
 ./configure --prefix=c:/gdc --enable-threads=win32
 --enable-languages=c,d --disable-nls --disable-win32-registry
 --disable-shared --disable-bootstrap
 &&
 make all
 &&
 make install
 
 I also tried --prefix=/gdc same problem. And the problem is:
 
 object.d: module object cannot read file 'object.d'
 
 I then try adding /c/gdc/include/d/3.4.2 as include path but then I get:
 
 C:\MinGW\bin\ld.exe: crt2.o: No such file: No such file or directory
 
 The crt2.o file is not anywhere to be found. neither in my build or
 install dirs.
 
 I'm not really sure where to go from here... any help will be much
 appreciated!
 
Currently, using a path starting with "/" will cause the problems you described. Using c:/gdc and the like is the right thing to do for now, so I'm not sure why you are seeing this problem. Also, crt2.o should be in C:\MinGW\lib (assuming C:\MinGW is your MinGW install path). I don't think you could have build GDC without it! David
Dec 06 2006
prev sibling parent reply David Friedman <dvdfrdmn users.ess-eff.net> writes:
I think I finally figured out this whole MinGW relocation thing...

If you want gdc (or g++) to work correctly, you have to configure with a 
prefix that does not get translated by MSYS.  One way to do this is to 
use a real Win32 path.  For example, "configure --prefix=c:/gdc"

This builds a working compiler that can also be relocated to another 
directory.  However, it is inconvenient for making packages (via "make 
install DESTDIR=...").  To build with a prefix that starts with '/', do 
the following:

Assuming the prefix you want is "/gdc"...

1. Add the following line to C:/msys/1.0/etc/fstab:

	/gdc		/gdc

    Note that a real /gdc directory need not exist.  If it does exist, it
    will not be directly accessible after making this change.

2. Quit all MSYS shells.

3. Start a new MSYS shell.  Verify that the fstab change as taken affect 
by running "cmd //c echo /gdc".  The output should be "/gdc".

4. You can now configure and build GCC with --prefix=/gdc.  Note that 
you cannot simply install with "make install" now (unless you revert the 
fstab change.)  You have to use "make DESTDIR=/some/other/place install"

David

Tomas Lindquist Olsen wrote:
 Hi folks.
 
 I've been trying to compile GDC in mingw32, and while I managed to
 compile it I can't get it to work properly.
 
 I'm using 0.20-dev revision 50.
 
 ./configure --prefix=c:/gdc --enable-threads=win32
 --enable-languages=c,d --disable-nls --disable-win32-registry
 --disable-shared --disable-bootstrap
 &&
 make all
 &&
 make install
 
 I also tried --prefix=/gdc same problem. And the problem is:
 
 object.d: module object cannot read file 'object.d'
 
 I then try adding /c/gdc/include/d/3.4.2 as include path but then I get:
 
 C:\MinGW\bin\ld.exe: crt2.o: No such file: No such file or directory
 
 The crt2.o file is not anywhere to be found. neither in my build or
 install dirs.
 
 I'm not really sure where to go from here... any help will be much
 appreciated!
 
Dec 11 2006
next sibling parent reply =?UTF-8?B?QW5kZXJzIEYgQmrDtnJrbHVuZA==?= <afb algonet.se> writes:
David Friedman wrote:

 I think I finally figured out this whole MinGW relocation thing...
 
 If you want gdc (or g++) to work correctly, you have to configure with a 
 prefix that does not get translated by MSYS.  One way to do this is to 
 use a real Win32 path.  For example, "configure --prefix=c:/gdc"
 
 This builds a working compiler that can also be relocated to another 
 directory.  However, it is inconvenient for making packages (via "make 
 install DESTDIR=...").  To build with a prefix that starts with '/', do 
Thanks for the info, I will try this with the gdcwin 3.4.5 build later. (will do the fake /gdc mount, instead of installing in /mingw like now) My configure options: http://gdcwin.sourceforge.net/gcc-3.4.5-build.sh (should be the same as what MinGW is using, plus the D language enabled) --anders PS. Is it possible to get the pl2bat included for the MinGW/Windows build ? (i.e. to build gdmd.bat, for Windows users not using MSYS/a real shell) http://www.perl.com/doc/manual/html/win32/bin/pl2bat.pl.html
Dec 11 2006
parent =?UTF-8?B?QW5kZXJzIEYgQmrDtnJrbHVuZA==?= <afb algonet.se> writes:
 Thanks for the info, I will try this with the gdcwin 3.4.5 build later.
 (will do the fake /gdc mount, instead of installing in /mingw like now)
Worked like a charm, built with --prefix=/gdc and later the EXE installed into /mingw (C:\MinGW) without any problems... I built GDC trunk SVN r20 for mac/win as a dress rehearsal for the 0.20 release, that hopefully should be relocatable. Thanks! --anders PS. This time I included both "gdc.exe" and "mingw32-gdc.exe", similar to "gdc" and "gdc-4.0" for the Mac OS X version.
Dec 11 2006
prev sibling parent "Tomas Lindquist Olsen" <tomas famolsen.dk> writes:
David Friedman wrote:

 I think I finally figured out this whole MinGW relocation thing...
 
 If you want gdc (or g++) to work correctly, you have to configure
 with a prefix that does not get translated by MSYS.  One way to do
 this is to use a real Win32 path.  For example, "configure
 --prefix=c:/gdc"
 
 This builds a working compiler that can also be relocated to another
 directory.  However, it is inconvenient for making packages (via
 "make install DESTDIR=...").  To build with a prefix that starts with
 '/', do the following:
 
 Assuming the prefix you want is "/gdc"...
 
 1. Add the following line to C:/msys/1.0/etc/fstab:
 
 	/gdc		/gdc
 
    Note that a real /gdc directory need not exist.  If it does exist,
 it    will not be directly accessible after making this change.
 
 2. Quit all MSYS shells.
 
 3. Start a new MSYS shell.  Verify that the fstab change as taken
 affect by running "cmd //c echo /gdc".  The output should be "/gdc".
 
 4. You can now configure and build GCC with --prefix=/gdc.  Note that
 you cannot simply install with "make install" now (unless you revert
 the fstab change.)  You have to use "make DESTDIR=/some/other/place
 install"
 
 David
 
 Tomas Lindquist Olsen wrote:
 Hi folks.
 
 I've been trying to compile GDC in mingw32, and while I managed to
 compile it I can't get it to work properly.
 
 I'm using 0.20-dev revision 50.
 
 ./configure --prefix=c:/gdc --enable-threads=win32
 --enable-languages=c,d --disable-nls --disable-win32-registry
 --disable-shared --disable-bootstrap
 &&
 make all
 &&
 make install
 
 I also tried --prefix=/gdc same problem. And the problem is:
 
 object.d: module object cannot read file 'object.d'
 
 I then try adding /c/gdc/include/d/3.4.2 as include path but then I
 get:
 
 C:\MinGW\bin\ld.exe: crt2.o: No such file: No such file or directory
 
 The crt2.o file is not anywhere to be found. neither in my build or
 install dirs.
 
 I'm not really sure where to go from here... any help will be much
 appreciated!
 
Yup this does the trick, thanx a lot! gdc-0.20-dev r55 works properly in mingw :D --
Dec 13 2006