Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Problem with a long PATH; PATH question :)  (Read 11538 times)

0 Members and 1 Guest are viewing this topic.

unregistered

    Topic Starter


    Rookie

    • Experience: Familiar
    • OS: Unknown
    Problem with a long PATH; PATH question :)
    « on: January 28, 2019, 05:26:12 PM »
    hi, I'm trying to create a file via Command Prompt and the program's file creation works grand when it is run from it's directory.  However, when running from any directory... using PATH... it prints:
    gcc: error: CreateProcess: No such file or directory

    The problem, I believe, has to do with it trying to use the PATH to locate cc1.exe.  The PATH folder containing cc1.exe is: "C:\Program Files (x86)\mingw-w64\i686-8.1.0-win32-sjlj-rt_v6-rev0\mingw32\libexec\gcc\i686-w64-mingw32\8.1.0"

      Now my questions:

    1.) Is there a limit on the number of files that windows will search through to find the exe?  Some of the PATHS' folders contain many files.
    2.) Is that PATH folder correctly set up?  There must be something wrong... it's the correct folder... just checked it again. (I learned from windows.com that \\?\ allows a directory path to be longer than 256 characters... and I had "\\?\C:\Program Files (x86)\mingw-w64\i686-8.1.0-win32-sjlj-rt_v6-rev0\mingw32\libexec\gcc\i686-w64-mingw32\8.1.0" but removed the \\?\ just now because that directory path is less than 256 characters.)

    edit:  Just want you all to know that I have enabled long paths and file names via edits to the registry.  It should work. :)  But, it doesn't; I don't understand why.
    « Last Edit: January 28, 2019, 05:36:22 PM by unregistered »

    BC_Programmer


      Mastermind
    • Typing is no substitute for thinking.
    • Thanked: 1140
      • Yes
      • Yes
      • BC-Programming.com
    • Certifications: List
    • Computer: Specs
    • Experience: Beginner
    • OS: Windows 11
    Re: Problem with a long PATH; PATH question :)
    « Reply #1 on: January 28, 2019, 06:47:14 PM »
    mingw-w64 would install to C:\Program Files, not C:\Program Files (x86).
    I was trying to dereference Null Pointers before it was cool.

    Geek-9pm


      Mastermind
    • Geek After Dark
    • Thanked: 1026
      • Gekk9pm bnlog
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: Problem with a long PATH; PATH question :)
    « Reply #2 on: January 28, 2019, 08:20:45 PM »
    With long path names it is easy to make a mistake.
    He can search for:
    how to Shorten PATH
    And find some tips that might help.

    Some programs can be moved to another place if the DLL files come along.
    Also, he can create a 'dumb' drive partition is a kind of alias for a specific directory.

    Just trying to help.   :)

    unregistered

      Topic Starter


      Rookie

      • Experience: Familiar
      • OS: Unknown
      Re: Problem with a long PATH; PATH question :)
      « Reply #3 on: January 29, 2019, 09:12:01 AM »
      mingw-w64 would install to C:\Program Files, not C:\Program Files (x86).
      ...and the program's file creation works grand when it is run from it's directory.

      mingw-w64 is running from c:\Program Files (x86) because I installed the 32bit version. :)  I want the exe to run on both 32bit and 64bit machines. :)

      And the directory is correctly written... have checked it many times. :)  Note: I just opened "This PC" and entered the directory mentioned above and then clicked in the white part in the right of the directory box and its path appeared... then after copying it (ctrl+c) and pasting it over the version I had typed out in the PATH, the same problem still exists.  I haven't created the 'dumb' drive partition yet.

      With long path names it is easy to make a mistake.
      He can search for:
      how to Shorten PATH
      And find some tips that might help.

      Some programs can be moved to another place if the DLL files come along.
      Also, he can create a 'dumb' drive partition is a kind of alias for a specific directory.

      Just trying to help.   :)
      Thank you! :)  Specifically, I'll look into creating a 'dumb' drive partition as an alias for that specific directory... thank you so much! :D  I've never heard or thought of a 'dumb' drive partition.

      edit.
      « Last Edit: January 29, 2019, 09:57:15 AM by unregistered »

      Salmon Trout

      • Guest
      Re: Problem with a long PATH; PATH question :)
      « Reply #4 on: January 29, 2019, 02:04:36 PM »
      Is that PATH folder correctly set up? [...] "\\?\C:\Program Files (x86)\mingw-w64\i686-8.1.0-win32-sjlj-rt_v6-rev0\mingw32\libexec\gcc\i686-w64-mingw32\8.1.0" but removed the \\?\ just now because that directory path is less than 256 characters.)

      The convention is to write PATH in capital letters when you are discussing your system's PATH environment variable. That is, the variable which is a string, a list of folders where the system will look for executables, by default starting C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem; (there are more folders, usually.) if you have totally replaced everything else, and just have that long folder path on your PATH, all kinds of trouble will happen.

      Is that what you meant? Or are you talking about a simple path to a folder?

      Geek-9pm


        Mastermind
      • Geek After Dark
      • Thanked: 1026
        • Gekk9pm bnlog
      • Certifications: List
      • Computer: Specs
      • Experience: Expert
      • OS: Windows 10
      Re: Problem with a long PATH; PATH question :)
      « Reply #5 on: January 29, 2019, 03:38:22 PM »
      Most likely the error is with gcc and not windows.
      Thee are versions of gcc for Windows. Here is a video:
      https://www.youtube.com/watch?v=sXW2VLrQ3Bs
      Is this the compiler yu are using?
      If not, which? Where is the documentation?

      You can expect gcc has some rules about file names and directories that vary from what Windows allows.

      patio

      • Moderator


      • Genius
      • Maud' Dib
      • Thanked: 1769
        • Yes
      • Experience: Beginner
      • OS: Windows 7
      Re: Problem with a long PATH; PATH question :)
      « Reply #6 on: January 29, 2019, 03:46:30 PM »
      "mingw-w64 is running from c:\Program Files (x86) because I installed the 32bit version. :)  I want the exe to run on both 32bit and 64bit machines. :)

      Really ? ?
      " Anyone who goes to a psychiatrist should have his head examined. "

      Salmon Trout

      • Guest
      Re: Problem with a long PATH; PATH question :)
      « Reply #7 on: January 29, 2019, 03:54:44 PM »
      "mingw-w64 is running from c:\Program Files (x86) because I installed the 32bit version. :)  I want the exe to run on both 32bit and 64bit machines. :)

      Really ? ?

      It's a name. The mingw-w64 project is a complete runtime environment for gcc to support binaries native to Windows 64-bit and 32-bit operating systems. The -w64 doesn't mean it's 64-bit only.


      unregistered

        Topic Starter


        Rookie

        • Experience: Familiar
        • OS: Unknown
        Re: Problem with a long PATH; PATH question :)
        « Reply #8 on: January 29, 2019, 05:31:41 PM »
        The convention is to write PATH in capital letters when you are discussing your system's PATH environment variable. That is, the variable which is a string, a list of folders where the system will look for executables, by default starting C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem; (there are more folders, usually.) if you have totally replaced everything else, and just have that long folder path on your PATH, all kinds of trouble will happen.

        Is that what you meant? Or are you talking about a simple path to a folder?
        When I wrote "PATH folder" I was trying to refer to the folder path, that I had posted, that was part of my PATH (it's much longer). :)  Sorry, I'll try to be more careful next time.

        Most likely the error is with gcc and not windows.
        Thee are versions of gcc for Windows. Here is a video:
        https://www.youtube.com/watch?v=sXW2VLrQ3Bs
        Is this the compiler yu are using?
        If not, which? Where is the documentation?

        You can expect gcc has some rules about file names and directories that vary from what Windows allows.

        Yes, I'm using gcc. :)  Thank you for the video too.  It never occurred to me that gcc would have its own rules about file names and directories.  hmm...

        ooh: Their installer created the directory and I would imagine the mingw-w64 installer wouldn't commit suicide... but, I'm definitely not an expert; just trying to install this correctly. :)

        It's a name. The mingw-w64 project is a complete runtime environment for gcc to support binaries native to Windows 64-bit and 32-bit operating systems. The -w64 doesn't mean it's 64-bit only.

        Yes, I chose to install the latest/newest version of mingw, the mingw-w64 version they recommended on mingw's site, because it's probably the most up-to-date.  That and 64bit processors are comfortable with running 32bit applications... and after learning that I could install a 32bit version, I was sold. :)

        unregistered

          Topic Starter


          Rookie

          • Experience: Familiar
          • OS: Unknown
          Re: Problem with a long PATH; PATH question :)
          « Reply #9 on: January 29, 2019, 07:25:41 PM »
          Thank you so much Geek-9pm!  I followed the instructions on the video you linked and everything works now! :D   After downloading and installing the mingw-get-setup.exe, I removed the two directory paths I had added to my PATH before adding the simple path the video told me to add... and it works excellently now !in any directory! :||

          note: in case anyone's windows 10's right click on start menu and then clicking System-doesn't bring up the correct window... click start and begin typing "Control Panel"... run that app and click "System" :)

          edit: Yes, I realize that this is the mingw last updated in 2013, but it works extremely grand so far... so I'm happy. :)  I'm keeping mingw-w64, for right now at least. :)

          And... above I said that I had downloaded mingw-w64 from mingw's site... but, sorry for my mistake, I think I actually chose the mingw-w64 site when both were shown in duckduckgo since mingw-w64 is newer. :)
          « Last Edit: January 29, 2019, 07:46:52 PM by unregistered »

          Geek-9pm


            Mastermind
          • Geek After Dark
          • Thanked: 1026
            • Gekk9pm bnlog
          • Certifications: List
          • Computer: Specs
          • Experience: Expert
          • OS: Windows 10
          Re: Problem with a long PATH; PATH question :)
          « Reply #10 on: January 29, 2019, 07:44:10 PM »
          Glad you got it right!  :)