From: SourceForge.net <no...@so...> - 2007-04-28 14:53:12
|
Support Requests item #1708364, was opened at 2007-04-26 16:47 Message generated for change (Comment added) made by earnie You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=202435&aid=1708364&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: None Group: Waiting user response >Status: Pending Priority: 5 Private: No Submitted By: sunseraphic (sunseraphic) Assigned to: Danny Smith (dannysmith) Summary: "Is this Bug relating to Vista or Not?" Initial Comment: I'v installed the latest stable version of MinGW. This is not my first time installing MinGW on a Vista Platform. All runs normally until this time. What I Meet: I just using "gcc" command compile a Hello to test. code: /* This is a Hello Program testing gcc */ #include <iostream> int main() { printf("Hello,world!\n"); return 0; } I save it as Hello.cpp on desktop and then use cmd.exe of Vista like this: C:\Users\$MyUsrNameofVista$\Desktop>gcc Hello.c Below is what it report to me: Hello.c:1:17: no include path in which to search for stdio Then I give the directive with the whole pathname of gcc like this: C:\Users\$MyUsrNameofVista$\Desktop>D:\craft\MinGW\bin\gcc hello.c Then: hello.c:1:17: stdio: No such file or directory I then change the directory both Mingw and the source file as many as possible combinations with no miracle occured. But,When I use Eclipse+CDT,something different came out: Normally,if mingw gcc can work well,you needn't set any enviorment variable in Eclipse settings,but this time,I just try to set the envirorment variable in Eclipse settings,it works! Though the gcc still can't work well under cli model. This Problem came not too early,at least I can run mingw well on vista for nearly 3 month.All problem came out after I reinstalled my vista. I hope who can give me some help to sovle the damned problem. ---------------------------------------------------------------------- >Comment By: Earnie Boyd (earnie) Date: 2007-04-28 10:53 Message: Logged In: YES user_id=15438 Originator: NO What packages did you unzip and install? What does ``gcc -v hello.c'' output to stdout? Looking at the list of search paths, from the above command, can *you* find stdio.h? ---------------------------------------------------------------------- Comment By: sunseraphic (sunseraphic) Date: 2007-04-28 10:33 Message: Logged In: YES user_id=1779508 Originator: YES to earnie: I'd tried 2 ways to install MinGW. first,I use the installer down from SF.net. It dosent work. Then I unistall the MinGW,and unzip all package just as the instructions on the page you refered. It also dosent work. I set the Enviroment Variable in "System Poperty" just as what i set in eclipse. But it dosent work always though it works well under the Eclipse + CDT model. I'll tell you another thing.I try to install MinGW on another PC installed Vista,the same case came out. I'd make MinGW work well on vista before,but now it seems some mysterious things came to me. ---------------------------------------------------------------------- Comment By: Earnie Boyd (earnie) Date: 2007-04-28 08:26 Message: Logged In: YES user_id=15438 Originator: NO No, I wasn't kidding. Often the user who has the issue of not finding the include files hasn't installed correctly. ---------------------------------------------------------------------- Comment By: sunseraphic (sunseraphic) Date: 2007-04-28 06:52 Message: Logged In: YES user_id=1779508 Originator: YES Thanks! danny! I try two version of Mingw with gcc,with both gcc version 3.4.2 and 3.4.5. The Envirorment Variable of Eclipse,I only add the key "PATH" which supposed only need to be set in the "System Poperty::Advanced System Settings::Enviorment DialogBox" of Vista. The Key "PATH" has value {;D:\Craft\MinGW\bin;D:\Craft\MinGW\include;D:\Craft\MinGW\lib;D:\Craft\MinGW\include\c++\3.4.5;D:\Craft\MinGW\include\c++\3.4.5\backward;D:\Craft\MinGW\include\c++\3.4.5\mingw32;} I set it in the Eclispe ,from toolar Window Menu "preference::C++::'new make project'::Enviorment". ---------------------------------------------------------------------- Comment By: Danny Smith (dannysmith) Date: 2007-04-28 05:26 Message: Logged In: YES user_id=11494 Originator: NO "I'v installed the latest stable version of MinGW." Just to to be clear, what does gcc -v report? "Normally,if mingw gcc can work well,you needn't set any enviorment variable in Eclipse settings,but this time,I just try to set the envirorment variable in Eclipse settings,it works!" What environment variables? What is in PATH? Short answer to your question, I think this may be related to Vista. If yop can provide me with above information, I'll be better able to help. Danny ---------------------------------------------------------------------- Comment By: sunseraphic (sunseraphic) Date: 2007-04-28 03:03 Message: Logged In: YES user_id=1779508 Originator: YES earnie,you are kidding me.I had used MinGW for years,on XPSP2 and on vista. Only this time,the question comes out. ---------------------------------------------------------------------- Comment By: Earnie Boyd (earnie) Date: 2007-04-27 09:11 Message: Logged In: YES user_id=15438 Originator: NO Did you follow http://www.mingw.org/MinGWiki/index.php/GettingStarted ---------------------------------------------------------------------- Comment By: sunseraphic (sunseraphic) Date: 2007-04-27 08:17 Message: Logged In: YES user_id=1779508 Originator: YES Thanks you two to point out my fool mistake when i submit the bug report,but it's not the problem that wrong head file was included. I tweak the Hello.c ___________________________________________ #include <stdio.h> int main() { printf("Hello,World!\n"); return 0; } ___________________________________ then I use cli to compile it like this: C:\Users\$Usr$\Desktop\gcc hello.c it reported like this: hello.c:1:19: no include path in which to search for stdio.h File Added: hello.c ---------------------------------------------------------------------- Comment By: Earnie Boyd (earnie) Date: 2007-04-27 07:57 Message: Logged In: YES user_id=15438 Originator: NO You're trying to mix C++ with C. Use g++ to compile C++ code and use gcc to compile C code. Name the file cpp or cxx or C or use the -x c++ switch to ensure that the code is compiled as c++. Secondly you include iostream which is C++ and use printf which is C stdio.h. So the answer to the question is "No this is not a vista issue". Moving to "Support Request"; no bug has been proven. ---------------------------------------------------------------------- Comment By: Ken Jackson (kenjackson) Date: 2007-04-27 01:00 Message: Logged In: YES user_id=512584 Originator: NO Oops. I forgot the dashes to indicate stdin in my last: echo '#include <stdio.h>' | gcc -H -E -xc - | less echo '#include <iostream>' | g++ -H -E -xc++ - | less ---------------------------------------------------------------------- Comment By: Ken Jackson (kenjackson) Date: 2007-04-27 00:50 Message: Logged In: YES user_id=512584 Originator: NO Either replace "<iostream>" with "<stdio.h>" or rename Hello.c to Hello.cpp and compile with the "g++" command. Also, to see where the compiler is looking for header files, try these: echo '#include <stdio.h>' | gcc -H -E -xc | less echo '#include <iostream>' | g++ -H -E -xc++ | less ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=202435&aid=1708364&group_id=2435 |