From: SourceForge.net <no...@so...> - 2008-07-10 03:22:46
|
Bugs item #1995701, was opened at 2008-06-17 14:46 Message generated for change (Comment added) made by salvetore You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1995701&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: MinGW Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Michael de Raadt (salvetore) Assigned to: Nobody/Anonymous (nobody) Summary: Can't find libaries when compiling from other drive Initial Comment: When I'm compiling an application from a drive other than the one MinGW is installed on, the compiler says it can't find the standard library files. I've installed the compiler files to C:\MinGW and have set the path variables to include C:\MinGW\bin and C:\MinGW\libexec\gcc\mingw32\3.4.5. When I compile a file in C:\MinGW\myFiles it works fine. When I compile from the D drive (eg D:\) it gives errors such as... no include path in which to search for stdio.h Here are my details: OS: Windows XP Reading specs from ../lib/gcc/mingw32/3.4.5/specs Configured with: ../gcc-3.4.5-20060117-3/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry --disable-shared --enable-sjlj-exceptions --enable-libgcj --disable-java-awt --without-x --enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter --enable-hash-synchronization --enable-libstdcxx-debug Thread model: win32 gcc version 3.4.5 (mingw-vista special r3) Loader: GNU ld version 2.17.50 20060824 Installer: MinGW-5.1.4.exe Build environment: none ---------------------------------------------------------------------- >Comment By: Michael de Raadt (salvetore) Date: 2008-07-10 13:22 Message: Logged In: YES user_id=1717958 Originator: YES Yes, removing the quotes did make it work. I had those quotes in there for people using Windows98, but I guess that's not so much an issue any more. ---------------------------------------------------------------------- Comment By: John E. (tdragon) Date: 2008-07-10 12:20 Message: Logged In: YES user_id=960627 Originator: NO I doubt make_relative_prefix likes the quotes, nor should they be necessary. ---------------------------------------------------------------------- Comment By: Michael de Raadt (salvetore) Date: 2008-07-10 09:46 Message: Logged In: YES user_id=1717958 Originator: YES I don't think your CWD theory is correct. I have nothing related to MinGW at the root of D:. My path is... PATH="C:\MinGW\bin";"C:\MinGW\libexec\gcc\mingw32\3.4.5";C:\WINDOWS\system32;C:\ WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\ZipGenius 6\;C:\Program Files\ Microsoft SQL Server\90\Tools\binn\;C:\WINDOWS\Microsoft.NET\Framework\v2.0.5072 7 ---------------------------------------------------------------------- Comment By: John E. (tdragon) Date: 2008-06-28 01:18 Message: Logged In: YES user_id=960627 Originator: NO In GCC, a function called "make_relative_prefix" examines the entries in the PATH environment variable to determine which one GCC is installed in. If your PATH contains a leading or trailing semicolon (';') or two consecutive semicolons, one of the directories checked will be the CWD -- in the case of your example, D:\. Here there is a small bug: if in the CWD it finds an appropriately named *file* OR *directory*, it assumes that this is where GCC is installed, when it should only choose the CWD if it contains an appropriately named *executable*. At first blush, this appears to be the problem you're encountering. Check the directory that you're running the compiler from for files or folders with the same name as a GCC program ("gcc" is the most common miscreant). Then, your choice is to either rename the offending folder or remove the reference to the CWD from PATH (leading, trailing, or consecutive semicolons). ---------------------------------------------------------------------- Comment By: Michael de Raadt (salvetore) Date: 2008-06-27 14:08 Message: Logged In: YES user_id=1717958 Originator: YES Here is a running demonstrating the problem I am having... C:\MinGW\myFiles>dir *.cpp Volume in drive C is OS Volume Serial Number is 2C1B-A503 Directory of C:\MinGW\myFiles 12/06/2008 05:12 PM 76 hello.cpp 1 File(s) 76 bytes 0 Dir(s) 8,417,955,840 bytes free C:\MinGW\myFiles>type hello.cpp #include <stdio.h> int main() { printf("Hello World!\n"); } C:\MinGW\myFiles>g++ hello.cpp C:\MinGW\myFiles>a Hello World! C:\MinGW\myFiles>copy hello.cpp d: 1 file(s) copied. C:\MinGW\myFiles>d: D:\>dir *.cpp Volume in drive D is DATA Volume Serial Number is 477E-5ABD Directory of D:\ 03/04/2008 10:39 AM 7,226 FileStorageAndTransfer.cpp 12/06/2008 05:12 PM 76 hello.cpp 17/06/2008 09:35 AM 8,623 assignment3.cpp 3 File(s) 15,925 bytes 0 Dir(s) 3,499,556,864 bytes free D:\>g++ hello.cpp -v Using built-in specs. Configured with: ../gcc-3.4.5-20060117-3/configure --with-gcc --with-gnu-ld --wi th-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --dis able-nls --enable-languages=c,c++,f77,ada,objc,java --disable-win32-registry --d isable-shared --enable-sjlj-exceptions --enable-libgcj --disable-java-awt --with out-x --enable-java-gc=boehm --disable-libgcj-debug --enable-interpreter --enabl e-hash-synchronization --enable-libstdcxx-debug Thread model: win32 gcc version 3.4.5 (mingw-vista special r3) cc1plus -quiet -v -iprefix ../lib/gcc/mingw32/3.4.5/ hello.cpp -quiet -dumpbase hello.cpp -auxbase hello -version -o C:\DOCUME~1\deraadt\LOCALS~1\Temp/ccDgfNfz .s ignoring nonexistent directory "../lib/gcc/mingw32/3.4.5/../../../../include/c++ /3.4.5" ignoring nonexistent directory "../lib/gcc/mingw32/3.4.5/../../../../include/c++ /3.4.5/mingw32" ignoring nonexistent directory "../lib/gcc/mingw32/3.4.5/../../../../include/c++ /3.4.5/backward" ignoring nonexistent directory "../lib/gcc/mingw32/3.4.5/../../../../include" ignoring nonexistent directory "../lib/gcc/mingw32/3.4.5/include" ignoring nonexistent directory "../lib/gcc/mingw32/3.4.5/../../../../mingw32/inc lude" ignoring nonexistent directory "/mingw/include/c++/3.4.5" ignoring nonexistent directory "/mingw/include/c++/3.4.5/mingw32" ignoring nonexistent directory "/mingw/include/c++/3.4.5/backward" ignoring nonexistent directory "/mingw/include" ignoring nonexistent directory "/mingw/include" ignoring nonexistent directory "/mingw/lib/gcc/mingw32/3.4.5/include" ignoring nonexistent directory "/mingw/mingw32/include" ignoring nonexistent directory "/mingw/include" #include "..." search starts here: #include <...> search starts here: End of search list. GNU C++ version 3.4.5 (mingw-vista special r3) (mingw32) compiled by GNU C version 3.4.5 (mingw-vista special r3). GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 hello.cpp:1:19: no include path in which to search for stdio.h hello.cpp: In function `int main()': hello.cpp:4: error: `printf' was not declared in this scope ...Seems like there are some relative paths that aren't being resolved properly there. ---------------------------------------------------------------------- Comment By: John E. (tdragon) Date: 2008-06-27 04:54 Message: Logged In: YES user_id=960627 Originator: NO Can you supply the results of running the command that causes this error, with "-v" added? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1995701&group_id=2435 |