1.

Solve : Problem with a long PATH; PATH question :)?

Answer» <html><body><p>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:<br/>gcc: error: CreateProcess: No such file or directory<br/><br/>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"<br/><br/>  Now my questions:<br/><br/>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.<br/>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.)<br/><br/>edit:  Just want you all to <a href="https://interviewquestions.tuteehub.com/tag/know-534065" style="font-weight:bold;" target="_blank" title="Click to know more about KNOW">KNOW</a> 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.<br/>mingw-w64 would install to C:\Program Files, not C:\Program Files (x86).With long path names it is easy to make a mistake.<br/>He can search for:<br/><strong>how to Shorten PATH</strong><br/>And find some tips that might help.<br/><br/>Some programs can be moved to another place if the DLL files come along.<br/>Also, he can create a 'dumb' drive partition is a kind of alias for a specific directory.<br/><br/>Just trying to help.    Quote from: BC_Programmer on January 28, 2019, 06:47:14 PM</p><blockquote>mingw-w64 would install to C:\Program Files, not C:\Program Files (x86).<br/></blockquote> Quote from: unregistered on January 28, 2019, 05:26:12 PM<blockquote>...and the program's file creation works grand when it is run from it's directory.<br/></blockquote> <br/>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. <br/><br/>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 <a href="https://interviewquestions.tuteehub.com/tag/white-248352" style="font-weight:bold;" target="_blank" title="Click to know more about WHITE">WHITE</a> 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 <a href="https://interviewquestions.tuteehub.com/tag/exists-979838" style="font-weight:bold;" target="_blank" title="Click to know more about EXISTS">EXISTS</a>.  I haven't created the 'dumb' drive partition yet.<br/><br/> Quote from: Geek-9pm on January 28, 2019, 08:20:45 PM<blockquote>With long path names it is easy to make a mistake.<br/>He can search for:<br/><strong>how to Shorten PATH</strong><br/>And find some tips that might help.<br/><br/>Some programs can be moved to another place if the DLL files come along.<br/>Also, he can create a 'dumb' drive partition is a kind of alias for a specific directory.<br/><br/>Just trying to help.   <br/></blockquote> Thank you!   Specifically, I'll look into creating a 'dumb' drive partition as an alias for that specific directory... thank you so much!   I've never heard or thought of a 'dumb' drive partition.<br/><br/>edit. Quote from: unregistered on January 28, 2019, 05:26:12 PM<blockquote>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.)</blockquote> <br/>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.<br/><br/>Is that what you meant? Or are you talking about a simple path to a folder?<br/>Most likely the error is with <strong>gcc</strong> and not windows.<br/>Thee are versions of <strong>gcc</strong> for Windows. Here is a video:<br/><a href="https://www.youtube.com/watch?v=sXW2VLrQ3Bs">https://www.youtube.com/watch?v=sXW2VLrQ3Bs</a><br/>Is this the compiler yu are using?<br/>If not, which? Where is the documentation?<br/><br/>You can expect <strong>gcc </strong>has some rules about file names and <a href="https://interviewquestions.tuteehub.com/tag/directories-955082" style="font-weight:bold;" target="_blank" title="Click to know more about DIRECTORIES">DIRECTORIES</a> that vary from what Windows allows.<br/>"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. <br/><br/>Really ? ? Quote from: patio on January 29, 2019, 03:46:30 PM<blockquote>"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. <br/><br/>Really ? ?<br/></blockquote> <br/>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.<br/><br/> Quote from: Salmon Trout on January 29, 2019, 02:04:36 PM<blockquote>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.<br/><br/>Is that what you meant? Or are you talking about a simple path to a folder?<br/></blockquote> 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.<br/><br/> Quote from: Geek-9pm on January 29, 2019, 03:38:22 PM<blockquote>Most likely the error is with <strong>gcc</strong> and not windows.<br/>Thee are versions of <strong>gcc</strong> for Windows. Here is a video:<br/><a href="https://www.youtube.com/watch?v=sXW2VLrQ3Bs">https://www.youtube.com/watch?v=sXW2VLrQ3Bs</a><br/>Is this the compiler yu are using?<br/>If not, which? Where is the documentation?<br/><br/>You can expect <strong>gcc </strong>has some rules about file names and directories that vary from what Windows allows.<br/><br/></blockquote> Yes, I'm using <strong>gcc</strong>.   Thank you for the video too.  It never occurred to me that <strong>gcc</strong> would have its own rules about file names and directories.  hmm...<br/><br/>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. <br/><br/> Quote from: Salmon Trout on January 29, 2019, 03:54:44 PM<blockquote>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.<br/><br/></blockquote> 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. Thank you so much Geek-9pm!  I followed the instructions on the video you linked and everything works now!    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! <br/><br/>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" <br/><br/>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. <br/><br/>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 <a href="https://interviewquestions.tuteehub.com/tag/newer-2866961" style="font-weight:bold;" target="_blank" title="Click to know more about NEWER">NEWER</a>. Glad you got it right!  <br/></body></html>


Discussion

No Comment Found