-3

I just finished installing GCC on my windows laptop with MinGW, stdio.h library is there somewhere inside the file but Git Bash and windows CMD do not recognize it. I tried to run a simple Hello World program and it compiles but cannot find stdio.h lib. Can you please help? Thanks

PS. I've tried #include<stdio.h> and #include <stdio.h> (space or no space after include seems to not make a difference).info img

Isa Neves
  • 1
  • 1
  • Sounds like your gcc installation is broken. How did you install it? – Eugene Sh. Jan 25 '21 at 16:28
  • Don't post pictures of text, post text as text. – Jabberwocky Jan 25 '21 at 16:28
  • @EugeneSh. the regular way. with installation manager and then checked all the boxes of the basic setup etc. when i put gcc -v on cmd everything is okay – Isa Neves Jan 25 '21 at 16:33
  • Use the methods listed here: https://stackoverflow.com/questions/17939930/finding-out-what-the-gcc-include-path-is to find out what the include paths are. Then check if they contain `stdio.h` – Eugene Sh. Jan 25 '21 at 16:37
  • @EugeneSh.paths inside mingw include stdio.h. used this command echo | gcc -E -Wp,-v - and basically its telling me "ignoring nonexistent directory "c:\mingw\bin\../lib/gcc/mingw32/9.2.0/../../../../mingw32/include" " and this is where stdio.h is. why is that? thanks – Isa Neves Jan 25 '21 at 16:42
  • Looks like some windows/linux style path issues. MinGw expects paths like `/c/mingw.....`. Can't help much on this. – Eugene Sh. Jan 25 '21 at 16:47
  • `it compiles but cannot find stdio.h` So it compiles OR it cannot find the header? – qrdl Jan 25 '21 at 18:51
  • @qrdl it compiles AND cannot find the lib stdio.h. im going to follow the link given under. – Isa Neves Jan 29 '21 at 19:27

1 Answers1

0

Use the newer MinGW-w64. There is a standalone build available on http://winlibs.com/ and there are some instructions on that site on how to use, including from the Command Prompt.

Brecht Sanders
  • 6,215
  • 1
  • 16
  • 40