SourceForge has been redesigned. Learn more.
Close

#944 Install directory for MinGW must be C:\mingw, or linkd

OTHER
closed
None
works-for-me
Unreproducible
2013-01-21
2006-05-23
Ale Vesely
No

Hi,
please amend that page in
http://www.mingw.org/MinGWiki/index.php/Install%20MinGW
where it says
"2. Create a directory to install all the stuff into..."

In facts the directory MUST be the root directory,
or gcc won't work. I everytime got fooled by the
fstab feature of msys. It is important that new
users understand that the fstab mounts are only
seen by the shell: native programs, including gcc,
know nothing about it.

Since Windows 2000 one can soft link a directory,
a JUNCTION in Windows parlance and overcome this
limitation, e.g.

linkd C:\mingw C:\myfancyplace\MinGW
linkd D:\mingw C:\myfancyplace\MinGW

that also solves the problem of compiling from
a different drive.

(Linkd.exe can be downloaded with the resource kit,
othe sysinternals alternatives may exist.)

Discussion

  • Earnie Boyd

    Earnie Boyd - 2006-05-23
    • milestone: 456516 --> 519164
    • assigned_to: natbobc --> earnie
    • status: open --> pending
     
  • Earnie Boyd

    Earnie Boyd - 2006-05-23

    Logged In: YES
    user_id=15438

    Your advice isn't correct and your problem is more likely to
    be spaces in the path name.

    I have my mingw installed in c:/opt/mingw.

    I often build in e:/usr/src.

    Can you please check to see if spaces in the path name is
    your problem?

    Earnie

     
  • Ale Vesely

    Ale Vesely - 2006-05-24

    Logged In: YES
    user_id=262065

    I had no spaces in paths, except for HOME.
    Without links, I've been able to compile
    by specifying -I, but then I couldn't link.

    Perhaps I also got something else wrong
    (e.g. I have both gcc and mingw32 as
    subdirectories of mingw)?

    I attach the output of gcc in all 3 cases:
    -naive,
    -using -I,
    -with a junction

    It contains lines like

    ignoring nonexistent directory "/mingw/include"

    that inspired the soft links.

     
  • Ale Vesely

    Ale Vesely - 2006-05-24
    • status: pending --> open
     
  • Earnie Boyd

    Earnie Boyd - 2006-05-24
    • status: open --> pending
     
  • Earnie Boyd

    Earnie Boyd - 2006-05-24

    Logged In: YES
    user_id=15438

    You mention HOME directory, are you using MSYS-1.0.10? Did
    you install MSYS in the same directories as the MinGW
    binaries? If, yes, that is your problem and the "Install
    MinGW" page isn't discussing MSYS. MSYS-1.0.11 will allow
    you to install MinGW and MSYS together.

     
  • Luke Dunstan

    Luke Dunstan - 2006-05-24

    Logged In: YES
    user_id=30442

    You must install gcc, w32api and mingw-runtime in the same
    tree to allow it to find the headers and libraries, not in
    separate subdirectories.

     
  • Ale Vesely

    Ale Vesely - 2006-05-24
    • status: pending --> open
     
  • Ale Vesely

    Ale Vesely - 2006-05-24

    Logged In: YES
    user_id=262065

    Yes, I have MSYS 1.0.10, it is in a parellel
    directory than MinGW (see tree below.)

    Earnie, I don't dare asking why that would
    affect MinGW binaries execution. If by design
    they can run under cmd.exe as well (as gcc
    does), please say so at point 5 in that page.

    I cannot read gcc specs file, however snippets like

    *md_startfile_prefix:
    /mingw/lib/

    apparently imply that mingw should be in the root
    directory.

    FWIW, my tree is as follows:
    $ find c:/uX -type d -maxdepth 2
    c:/uX
    c:/uX/MinGW
    c:/uX/MinGW/bin
    c:/uX/MinGW/doc
    c:/uX/MinGW/gcc
    c:/uX/MinGW/include
    c:/uX/MinGW/info
    c:/uX/MinGW/lib
    c:/uX/MinGW/man
    c:/uX/MinGW/mingw32
    c:/uX/MinGW/uninstall
    c:/uX/msys
    c:/uX/msys/1.0

     
  • Earnie Boyd

    Earnie Boyd - 2006-05-24

    Logged In: YES
    user_id=15438

    Ok, then I don't know why you needed to do your linkd steps.
    It isn't required by anyone else that I've heard of. I.E.:
    I don't have an issue with gcc -I /include -c a.c where a.c
    merely includes a.h and a.h is an empty file in /include.

     
  • Earnie Boyd

    Earnie Boyd - 2006-05-24
    • milestone: 519164 --> Unreproducible
    • status: open --> pending-works-for-me
     
  • Ale Vesely

    Ale Vesely - 2006-05-25

    Logged In: YES
    user_id=262065

    Awright, I moved all mingw/gcc/* to mingw.
    Then I deleted the two symbolic links.
    Now gcc works when invoked from any drive,
    and, if -v is given, complains that it is
    ignoring nonexistent directory "/mingw/include"
    ignoring nonexistent directory "/mingw/include"
    ignoring nonexistent directory
    "/mingw/lib/gcc/mingw32/3.4.2/include"
    ignoring nonexistent directory "/mingw/mingw32/include"
    ignoring nonexistent directory "/mingw/include"

    Some files overlapped (before moving I got:
    Alessandro Vesely@NUOVO /mingw
    $ find . -type f | sed 's|^[.]/gcc/|./|' | sort | uniq -c |
    sort -n | egrep -v '^ *1 '
    2 ./COPYING
    2 ./COPYING.LIB
    2 ./info/dir
    2 ./lib/libiberty.a
    only info/dir is documented at step 2)

    Thus the correct statement is that gcc must be
    installed in the mingw directory as exemplified,
    or else mingw must be in (or linked from) the
    root directory for gcc to work. Perhaps that's
    more confusing than helpful, so please forget
    this bug, unless you are willing to reword that
    concept in order to document those gcc specs.

    However, don't forget to mention there should be
    no spaces in directory names next time you edit
    that page...

    Ciao
    Ale

     
  • Ale Vesely

    Ale Vesely - 2006-05-25
    • status: pending-works-for-me --> open-works-for-me
     
  • Earnie Boyd

    Earnie Boyd - 2006-05-25
    • status: open-works-for-me --> closed-works-for-me
     
  • Earnie Boyd

    Earnie Boyd - 2006-05-25

    Logged In: YES
    user_id=15438

    Your problem as I understand it is that you install the GCC
    portions in /mingw/gcc and you installed the runtime and
    w32api in /mingw. The win32 version of GCC will look for
    the include directory relative to the directory where the
    executable lives. So if gcc.exe is in /mingw/gcc/bin/ it
    will look for the default include directory to be in
    /mingw/gcc/bin/../include. The install directory doesn't
    need to be /mingw but you must use the same prefix directory
    for the gcc, binutils, mingw-runtime and w32api packages in
    order for it to work.

    BTW, the page you refer to is a WikiPage. You can edit it
    yourself.

     
  • Earnie Boyd

    Earnie Boyd - 2013-01-21
    • labels: website -->
    • status: closed-works-for-me --> closed
    • resolution: --> works-for-me
    • category: --> Unreproducible
    • milestone: Unreproducible --> OTHER
     

Log in to post a comment.