From: Harry Tucker on
I've installed MinGW on a WIn 7 machine. I have GPL GNAT already
installed. But trying to compile a project which compiles ok under the
GPS I get this error from the command line: d:/mingw/bin/../lib/gcc/
mingw32/4.5.0/../../../../mingw32/bin/ld.exe: cannot find -lgnarl-4.5

I looked at the GPL installation, it's copy of gnarl-2009 is in the
bin directory as is the MinGW copy of gnarl-4.5.0 is in the MinGW\bin
directory.

My end goal is to get MSYS running so I can compile and use XMLAda.
From: Yannick Duchêne (Hibou57) on
Le Thu, 20 May 2010 20:23:16 +0200, Harry Tucker
<harry.tucker(a)sbcglobal.net> a écrit:

> I've installed MinGW on a WIn 7 machine. I have GPL GNAT already
> installed. But trying to compile a project which compiles ok under the
> GPS I get this error from the command line: d:/mingw/bin/../lib/gcc/
> mingw32/4.5.0/../../../../mingw32/bin/ld.exe: cannot find -lgnarl-4.5
>
> I looked at the GPL installation, it's copy of gnarl-2009 is in the
> bin directory as is the MinGW copy of gnarl-4.5.0 is in the MinGW\bin
> directory.
>
> My end goal is to get MSYS running so I can compile and use XMLAda.
Hello,

This may not give all the answers you could expect, however, here are some
hints : GNAT+GPS on Windows is already based on MinGW, so with a GNAT+GPS
installed and a MinGW installed, you have two different MinGW installed.

I have both two, and mostly use the “pure” MinGW and less oftenly
GNAT+GPS. To avoid troubles, as both are in the PATH, when I know I will
use one and not the other, I rename the directory containing the one I
will not used (ex. “GNAT” -> “GNAT disabled”, or “MinGW” -> “MinGW
disabled”). This solve some troubles.

Then, MinGW is based on GCC, and GCC on Window may *or may not* use the
Windows registry for its configuration, depending on one dedicated build
option. As much as you can, or if you are not afraid to build your own if
needed, try to use a MinGW with a GCC which does not make use of the
registry, in order to avoid conflicts.

I use MSys too, and the tip of renaming the directory containing the
compiler which is not to be used, works nice here. I can't ensure this
will work for you too, however, can you try and tell about the result ?

--
There is even better than a pragma Assert: a SPARK --# check.
From: Harry Tucker on
On May 20, 1:44 pm, Yannick Duchêne (Hibou57)
<yannick_duch...(a)yahoo.fr> wrote:
> Le Thu, 20 May 2010 20:23:16 +0200, Harry Tucker  
> <harry.tuc...(a)sbcglobal.net> a écrit:
>
> ...
> I use MSys too, and the tip of renaming the directory containing the  
> compiler which is not to be used, works nice here. I can't ensure this  
> will work for you too, however, can you try and tell about the result ?
>
> --
> There is even better than a pragma Assert: a SPARK --# check.

Tried that and it didn't help. In either case I have WinGW\Bin set in
my $PATH before the GNAT\bin entry so it would be searched first. Also
while both libs are in the $PATH they have differing names so there
shouldn't be a conflict. GPS works well either way. Thanks for the
info.

> Then, MinGW is based on GCC, and GCC on Window may *or may not* use the
> Windows registry for its configuration, depending on one dedicated build
> option. As much as you can, or if you are not afraid to build your own if
> needed, try to use a MinGW with a GCC which does not make use of the
> registry, in order to avoid conflicts.

I just downloaded the MinGW manually and installed it one package at a
time. I didn't make any entries into my registry. Do you know how I
can determine if I have the wrong compiler or need to make an entry in
my registry?

PS C:\Users\Harry> gnatmake --version
GNATMAKE 4.5.0
Copyright (C) 1995-2010, 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.

PS C:\Users\Harry> gcc --version
gcc.exe (GCC) 4.5.0
Copyright (C) 2010 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.

Harry
From: Yannick Duchêne (Hibou57) on
Le Fri, 21 May 2010 02:27:43 +0200, Harry Tucker
<harry.tucker(a)sbcglobal.net> a écrit:
> Do you know how I
> can determine if I have the wrong compiler or need to make an entry in
> my registry?
I've just seek for informations at the source.

First, GNAT claims to not make use of the registry
http://gcc.gnu.org/onlinedocs/gnat_ugn_unw/Using-GNAT-on-Windows.html says
> No components of the GNAT toolset use any entries in the Windows
> registry. The only entries that can be created are file associations
> and PATH settings, provided the user has chosen to create them at
> installation time, as well as some minimal book-keeping information
> needed to correctly uninstall or integrate different GNAT products.
While I have a serious doubt about it... (or may be this was with older
versions)

Then, the registry key used by GCC, when it use it, is
HKEY_LOCAL_MACHINE\SOFTWARE\Free Software Foundation\key
where “key” is the GCC version number.

http://gcc.gnu.org/install/configure.html says
> --disable-win32-registry
>
> The --enable-win32-registry option enables Microsoft Windows-hosted
> GCC to look up installations paths in the registry using the
> following key:
>
> HKEY_LOCAL_MACHINE\SOFTWARE\Free Software Foundation\key
>
> key defaults to GCC version number, and can be overridden by the
> --enable-win32-registry=key option. Vendors and distributors who use
> custom installers are encouraged to provide a different key, perhaps
> one comprised of vendor name and GCC version number, to avoid
> conflict with existing installations. This feature is enabled by
> default, and can be disabled by --disable-win32-registry option.
> This option has no effect on the other hosts.

Can you see something meaningful there ?

--enable-win32-registry is the default option, as far as I remember. You
can check if --disable-win32-registry or --enable-win32-registry was given
as a build option, with this command:
gcc -v
with a minus “v”. This displays configuration options used to build GCC.

If this does not help, will seek for other hypotheses ;)


--
There is even better than a pragma Assert: a SPARK --# check.
From: Harry Tucker on
On May 20, 9:07 pm, Yannick Duchêne (Hibou57)
<yannick_duch...(a)yahoo.fr> wrote:
> Le Fri, 21 May 2010 02:27:43 +0200, Harry Tucker  
> Can you see something meaningful there ?
>
> --enable-win32-registry is the default option, as far as I remember. You  
> can check if --disable-win32-registry or --enable-win32-registry was given  
> as a build option, with this command:
> gcc -v
> with a minus “v”. This displays configuration options used to build GCC.
>
> If this does not help, will seek for other hypotheses ;)
>
> --
> There is even better than a pragma Assert: a SPARK --# check.

Thanks again. Here are the -v responses from the two programs. Neither
is using the registry which is good. I think that I will have to just
finish the install of MSYS and disable the WinGW installation for now.

COLLECT_GCC=C:\MinGW\bin\gcc.exe
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/4.5.0/lto-
wrapper.exe
Target: mingw32
Configured with: ../gcc-4.5.0/configure --enable-languages=c,c+
+,ada,fortran,objc,obj-c++ --disable-sjlj-exception
s --with-dwarf2 --enable-shared --enable-libgomp --disable-win32-
registry --enable-libstdcxx-debug --enable-versio
n-specific-runtime-libs --disable-werror --build=mingw32 --prefix=/
mingw
Thread model: win32
gcc version 4.5.0 (GCC)

and then

Target: i686-pc-mingw32
Configured with: /pristina.b/gnatmail/release-gpl/build-pristina/src/
configure --prefix=/gnat-prefix --with-build-
time-tools=/pristina.b/gnatmail/release-gpl/build-pristina/obj --with-
gmp=/pristina.b/gnatmail/release-gpl/build-p
ristina/libmpfr/install --with-mpfr=/pristina.b/gnatmail/release-gpl/
build-pristina/libmpfr/install --build=i686-p
c-mingw32 --enable-languages=c,ada,c++ --disable-nls --without-
libiconv-prefix --disable-libada --enable-checking=
release --enable-threads=win32 --disable-sjlj-exceptions --with-
bugurl=URL:mailto:report(a)adacore.com
Thread model: win32
gcc version 4.3.4 20090511 for GNAT GPL 2009 (20090511) (GCC)