#103 absolute pathes in unix style invalid under windows

Instruction_given
closed
Other (9)
5
2007-10-23
2007-10-21
murkymark
No

OS version: Windows XP
MinGW GNU make Version: 3.81
build environment: MSYS 1.0
mingw-runtime version: 3.11

"make" and other MinGW programs converts valid absolute pathes in unix style to invalid pathes internally under Windows when it tries to access/open files.
This happens often in cunjunction with "makefile"s which must be corrected by hand in order to solve the problem.
The path that is really used can be seen using "File Monitor" from "Sysinternals" or similar tools.

If the current working directory is "<drive>:\...\somedir"
the path "/<drive>/.../mydir/file.xyz" is used as "<DRIVE>:\&lt;drive>\...\mydir\file.xyz".

example a:
"gcc /c/abc.c"
=> now gcc is looking for "C:\c\abc.c"

example b: a Makefile
<code>
something.o:
/c/mingw/bin/gcc -c -o $@ something.c
</code>
=> tries to access: "C:\c\dir\mingw\bin\gcc.exe"

Discussion

  • Earnie Boyd

    Earnie Boyd - 2007-10-21

    Logged In: YES
    user_id=15438
    Originator: NO

    You installed it incorrectly. Please visit the http://www.mingw.org/MinGWiki and check the FAQ and HOWTO sections.

     
  • Earnie Boyd

    Earnie Boyd - 2007-10-21
    • assigned_to: nobody --> earnie
    • milestone: --> 507904
    • labels: --> Other
    • status: open --> pending
     
  • murkymark

    murkymark - 2007-10-22

    Logged In: YES
    user_id=1771707
    Originator: YES

    As far as I know everything is installed well.
    Pathes like "/c" are returned by "pwd" when using MSYS ("sh") outside the MSYS directory tree to run a configure script in order to create a makefile.
    Using fopen("/c/a.cpp","r"); causes Windows to look for directory "c" on the drive of the current working path.
    If my working path is "F:\foo\" Windows looks just for "F:\c\a.cpp" instead of "C:\a.cpp".

    The only solution I see is running any configure script inside the MSYS directory tree to avoid this problem.

     
  • murkymark

    murkymark - 2007-10-22
    • status: pending --> open
     
  • Earnie Boyd

    Earnie Boyd - 2007-10-22

    Logged In: YES
    user_id=15438
    Originator: NO

    You don't give the proper MSYS version but I can guess it is 1.0.10 based on your issue. You installed both MSYS and the MinGW compiler into the same root path. You cannot do that and that is explained in the Wiki and the README.rtf file that comes with MSYS.

     
  • Earnie Boyd

    Earnie Boyd - 2007-10-22
    • status: open --> pending
     
  • murkymark

    murkymark - 2007-10-23

    Logged In: YES
    user_id=1771707
    Originator: YES

    MSYS Version is 1.0.10
    I have a Windows path variable set to "c:\mingw\bin" so gcc is found using native Windows command line.
    MinGW is installed under "C:\mingw" and MSYS is installed under "c:\msys\" with the fstab entry for "/mingw" pointing to "C:\mingw". Somehow MSYS always used the MinGW version instead of the MSYS version of "make".
    I renamed the MinGW Version and now MSYS uses the right one with proper path conversion.
    It is unlucky that MSYS doesn't try to call "msys/bin/...exe" first.

     
  • murkymark

    murkymark - 2007-10-23
    • status: pending --> open
     
  • Keith Marshall

    Keith Marshall - 2007-10-23
    • milestone: 507904 --> Instruction_given
    • status: open --> closed
     
  • Keith Marshall

    Keith Marshall - 2007-10-23

    Logged In: YES
    user_id=823908
    Originator: NO

    Your MinGW vs. MSYS installation is perfectly ok. However, one is tempted to ask how, with a recent installation, you have a native make.exe in your /mingw/bin directory? If you used our prebuilt packages for everything, then that would have been installed as mingw32-make.exe, and it's named that way for a reason; if you renamed it, contrary to the advice offered when you installed MSYS, then you broke the installation.

    It isn't unlucky that /mingw/bin/make.exe is found, rather than /bin/make.exe (MSYS); it is determined by the $PATH setting in your MSYS shell, which by design places /mingw/bin before /bin. If that doesn't suit you, (and it should, unless you persist with an improperly named mingw32-make.exe), then you are free to reorder the $PATH.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks