Share September 2005: Project of the Month

MinGW - Minimalist GNU for Windows

Tracker: Support Requests

5 "Is this Bug relating to Vista or Not?" - ID: 1708364
Last Update: Comment added ( earnie )

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.



sunseraphic ( sunseraphic ) - 2007-04-26 20:47

5

Open

None

Danny Smith

None

Waiting user response

Public


Comments ( 26 )

Date: 2007-05-03 11:30
Sender: earnieProject Admin


As to your question about your response; I have no further comment about
your environment as yet.

As for downloading the file; go to the attached files area then scroll
horizontally to the right. There should be a column of links that say
``Download''. If that doesn't help, try viewing the source to see if the
download link is on the page.


Date: 2007-05-02 05:29
Sender: sunseraphic


To Danny and earnie:

I attach two pic "login.png" and "attach.jpg" which describ what i met.

I still cant find where any hyperlink or button I can click it to download
these attach file is.

Fw: earnie,can you give some suggestion by consider with my reply
"2007-04-29 17:59" ?
Thank you very much!


Date: 2007-05-02 05:22
Sender: sunseraphic


File Added: attach.jpg


Date: 2007-05-02 05:19
Sender: sunseraphic


File Added: login.png


Date: 2007-04-30 20:09
Sender: earnieProject Admin


It wasn't there this morning. Ok. I'll close the SF Support ticket.



Date: 2007-04-30 18:51
Sender: dannysmith


I am able to download the files when I'm logged in to SF.
(You may need to scroll to right to see 'Download' column)
Danny


Date: 2007-04-30 12:07
Sender: earnieProject Admin


SF Support Ticket 1710036
https://sourceforge.net/tracker/index.php?func=detail&aid=1710036&group_id=1&atid=200001


Date: 2007-04-30 12:01
Sender: earnieProject Admin


Looks like a bug in the SF UI introduced with new rounds of changes. I'll
open an SF bug ticket with that one.


Date: 2007-04-29 17:13
Sender: sunseraphic


To dannysmith:

Sorry,I cant find a place to download the two file you attached with
reply.


Date: 2007-04-29 16:59
Sender: sunseraphic


To earnie:

I unzip these pacakges :

binutils-2.16.91-20060119-1.tar.gz
gcc-core-3.4.2-20040916-1.tar.gz
gcc-g++-3.4.2-20040916-1.tar.gz
mingw-runtime-3.12.tar.gz
mingw32-make-3.81-2.tar.gz
w32api-3.9.tar.gz

when I do as you told me,it perform like this:

D:\Craft\MinGW\bin>dir ..\include\stdio.h
Driver D Volumn Programs
Volumn Serials Number 7C3B-93CE

D:\Craft\MinGW\include

2007/03/26 10:47 15,051 stdio.h
1 file 15,051 bytes
0 个目录 50,263,932,928 aviable bytes


Date: 2007-04-28 22:16
Sender: dannysmith


I've attached two patched drivers -- xgcc.exe for C, xg++.exe for C++.
Please ungzip to your D:\Craft\MinGW\bin directory (or wherever it is that
gcc.exe is located) and try

xgcc -v hello.c or a C test case
and
xg++ -v hello.cpp for a C++ test case

Danny



File Added: xgcc.exe.gz


Date: 2007-04-28 22:11
Sender: dannysmith


File Added: xgcc.exe.gz


Date: 2007-04-28 22:08
Sender: dannysmith


File Added: xg++.exe.gz


Date: 2007-04-28 20:26
Sender: earnieProject Admin


I wanted you to list the packages you installed. I can't read your mind
as to which ones those were.

Based on the gcc -v output, you have not installed correctly.

Now go to the bin directory containing gcc.exe
Then ``dir ..\include\stdio.h''

What is the result?




Date: 2007-04-28 15:20
Sender: sunseraphic


to earnie:

This is the result after "gcc -v hello.c"

C:\Users\$Usr$\Desktop>gcc -v hello.c
Using built-in specs.
Configured with: ../gcc-3.4.5/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 special)
cc1 -quiet -v -iprefix ../lib/gcc/mingw32/3.4.5/ hello.c -quiet -dumpbase
hello.c -auxbase hello -version -o ./ccWmaaaa.s
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/include"
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 special) (mingw32)
compiled by GNU C version 3.4.5 (mingw special).
GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=130936
hello.c:1:19: no include path in which to search for stdio.h

I just unzip those packages which download by the installer when first
installation processed.


Date: 2007-04-28 14:53
Sender: earnieProject Admin


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?


Date: 2007-04-28 14:33
Sender: sunseraphic


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.


Date: 2007-04-28 12:26
Sender: earnieProject Admin


No, I wasn't kidding. Often the user who has the issue of not finding the
include files hasn't installed correctly.


Date: 2007-04-28 10:52
Sender: sunseraphic


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".


Date: 2007-04-28 09:26
Sender: dannysmith


"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




Date: 2007-04-28 07:03
Sender: sunseraphic


earnie,you are kidding me.I had used MinGW for years,on XPSP2 and on
vista.

Only this time,the question comes out.


Date: 2007-04-27 13:11
Sender: earnieProject Admin


Did you follow http://www.mingw.org/MinGWiki/index.php/GettingStarted


Date: 2007-04-27 12:17
Sender: sunseraphic


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


Date: 2007-04-27 11:57
Sender: earnieProject Admin


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.


Date: 2007-04-27 05:00
Sender: kenjacksonSourceForge.net Subscriber and Donor


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


Date: 2007-04-27 04:50
Sender: kenjacksonSourceForge.net Subscriber and Donor


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



Attached Files ( 5 )

Filename Description Download
hello.c Update Hello.c Download
xg++.exe.gz Patch G++ driver Download
xgcc.exe.gz Patched GCC driver Download
login.png I'm Login Download
attach.jpg But I Cant download Download

Changes ( 31 )

Field Old Value Date By
File Added 227446: attach.jpg 2007-05-02 05:22 sunseraphic
File Added 227445: login.png 2007-05-02 05:19 sunseraphic
File Deleted 227050: 2007-04-29 18:28 dannysmith
close_date 2007-04-28 20:26 2007-04-29 16:59 sunseraphic
status_id Pending 2007-04-29 16:59 sunseraphic
File Added 227051: xgcc.exe.gz 2007-04-28 22:16 dannysmith
File Added 227050: xgcc.exe.gz 2007-04-28 22:11 dannysmith
File Added 227049: xg++.exe.gz 2007-04-28 22:08 dannysmith
close_date - 2007-04-28 20:26 earnie
status_id Open 2007-04-28 20:26 earnie
status_id Pending 2007-04-28 15:20 sunseraphic
close_date 2007-04-28 14:53 2007-04-28 15:20 sunseraphic
status_id Open 2007-04-28 14:53 earnie
close_date - 2007-04-28 14:53 earnie
assigned_to nobody 2007-04-28 09:26 dannysmith
close_date 2007-04-27 13:11 2007-04-28 07:03 sunseraphic
status_id Pending 2007-04-28 07:03 sunseraphic
close_date - 2007-04-27 13:11 earnie
artifact_group_id None 2007-04-27 13:11 earnie
status_id Open 2007-04-27 13:11 earnie
File Added 226862: hello.c 2007-04-27 12:17 sunseraphic
status_id Pending 2007-04-27 12:11 sunseraphic
File Deleted 226779: 2007-04-27 12:11 sunseraphic
close_date 2007-04-27 11:57 2007-04-27 12:11 sunseraphic
category_id gcc 2007-04-27 11:57 earnie
close_date - 2007-04-27 11:57 earnie
assigned_to dannysmith 2007-04-27 11:57 earnie
artifact_group_id Vista Issue 2007-04-27 11:57 earnie
status_id Open 2007-04-27 11:57 earnie
data_type 202435 2007-04-27 11:57 earnie
File Added 226779: Hello.c 2007-04-26 20:47 sunseraphic