Stdio h no such file or directory windows

I am trying to use MinGW to compile a C program under Windows XP. The gcc.exe gives the following error: stdio.h : No such file or directory The code (hello.c) looks like this: #include < std...

I am trying to use MinGW to compile a C program under Windows XP. The gcc.exe gives the following error:

stdio.h : No such file or directory

The code (hello.c) looks like this:

#include < stdio.h >

void main()
{
    printf("nHello Worldn");
}

I use a batch file to call gcc. The batch file looks like this:

@echo off
set OLDPATH=%PATH%
set path=C:devtoolsMinGWbin;%PATH%
set LIBRARY_PATH=C:devtoolsMinGWlib
set C_INCLUDE_PATH=C:devtoolsMinGWinclude

gcc.exe hello.c 

set path=%OLDPATH%

I have tried the option -I without effect. What do I do wrong?

asked Sep 17, 2008 at 10:13

Benno Richters's user avatar

Benno RichtersBenno Richters

15.2k14 gold badges40 silver badges45 bronze badges

Try changing the first line to:

#include <stdio.h>

without the spaces. It is trying to look for a file called » stdio.h » with a space at the beginning and end.

answered Sep 17, 2008 at 10:15

Leigh Caldwell's user avatar

Leigh CaldwellLeigh Caldwell

10.2k4 gold badges24 silver badges31 bronze badges

1

You should try to install MinGW in the default install directory (i.e. C:MinGW) I read many times it was recommended to avoid problems. There may be a (wrongly) hardcoded path in gcc.

answered Sep 17, 2008 at 10:16

PierreBdR's user avatar

Also note that main() should return an int:

int main(void)

answered Sep 18, 2008 at 0:52

aib's user avatar

aibaib

44.5k10 gold badges71 silver badges78 bronze badges

You can use

$ sudo apt-get install build-essential

to solve this problem

answered Feb 23, 2014 at 12:10

kaka's user avatar

0

При компиляции выдает ошибку:
helloworld.c:1:19: fatal error: stdio.h: No such file or directory
#include

#include <stdio.h>

int main()
{
    printf("This is a native C program.n");
    return 0;
}


  • Вопрос задан

    более трёх лет назад

  • 7770 просмотров

Пригласить эксперта

Как исправить ошибку «stdio.h: No such file or directory »?

Понять почему она возникает:
— запустить компиляцию с опцией -v: gcc -v helloworld.c -o helloworld
— найти в выводе строки

#include "..." search starts here:
#include <...> search starts here:

— посмотреть что за каталоги идут после них, есть ли эти каталоги в твоей системе
— посмотреть, есть ли в твоей системе stdio.h, и если есть, то где
— написать сюда результаты выполнения предыдущих шагов.


  • Показать ещё
    Загружается…

04 февр. 2023, в 20:45

1000 руб./за проект

04 февр. 2023, в 20:04

35000 руб./за проект

04 февр. 2023, в 19:43

800 руб./за проект

Минуточку внимания

  • Remove From My Forums
  • Question

  • Hey,

    I’m using VSCode for a small C project. 

    Been trying to compile with gcc.exe from Mingw but it doesn’t have <winternl.h> whice I need for my code (although it has <windows.h> and other headers… but these things are beyond my understanding).

    So, I tried compiling with cl.exe but apparently it has it’s own problems.

    I get the error message:

        fatal error C1034: stdio.h: no include path set

    Any Ideas where <stdio.h> has gone? Can’t people code in C with peace?

    Thanks

    • Moved by

      Monday, January 20, 2020 6:56 AM

@hepaad

Hi
I finished to install the riscv-tool and run everything fine. but
when I try to run the command.
riscv64-unknown-elf-gcc -o hello hello.c
I have the follow error.

root@hepaad-Vostro-5470:~/Documentos/old/ARCH# riscv64-unknown-elf-gcc -o hello hello.c
hello.c:1:10: fatal error: stdio.h: No such file or directory
#include <stdio.h>
^~~~~~~~~
compilation terminated.

I hope you can help me. and thanks.

@hepaad

/home/hepaad/Documentos/ARCH/riscv-tools/riscv-tests/build/../benchmarks/dhrystone/dhrystone_main.c:326:1: warning: return type defaults to ‘int’ [-Wimplicit-int]
Proc_5 () /* without parameters */
^~~~~~
Installing project riscv-tests

RISC-V Toolchain installation completed!
root@hepaad-Vostro-5470:/Documentos/ARCH/riscv-tools# echo $RISCV
/home/hepaad/Documentos/ARCH/riscv
root@hepaad-Vostro-5470:/Documentos/ARCH/riscv-tools# riscv64-unknown-elf-gcc -o hello hello.c
riscv64-unknown-elf-gcc: error: hello.c: No such file or directory
riscv64-unknown-elf-gcc: fatal error: no input files
compilation terminated.
root@hepaad-Vostro-5470:/Documentos/ARCH/riscv-tools# cd ..
root@hepaad-Vostro-5470:/Documentos/ARCH# riscv64-unknown-elf-gcc -o hello hello.c
hello.c:1:10: fatal error: stdio.h: No such file or directory
#include <stdio.h>
^~~~~~~~~
compilation terminated.
root@hepaad-Vostro-5470:~/Documentos/ARCH#
Details when finished the installation..

@jim-wilson

riscv-tools has an old obsolete unmtainined and known broken copy of the toolchain. You shouldn’t use it. You should use riscv-gnu-toolchain directly instead. But that isn’t directly related to your problem.

Something went wrong with your toolchain build and install. You will have to try to debug the build problem. Do you have header files in your toolchain install tree? Is gcc searching the right directories? You can see the directories gcc is searching by adding a -v option to the compile command. In your install tree, you should see a riscv64-unknown-elf/include/stdio.h file.

@hepaad

Thank for you answer, Ok I will change the reference in future only riscv-gnu-toolchain. (Do you have a reference manual of installation for this?.

Well, I send you the information that my computer show wiht -v.

hepaad@hepaad-Vostro-5470:~/Documentos/ARCH$ riscv64-unknown-elf-gcc -v
Using built-in specs.
COLLECT_GCC=riscv64-unknown-elf-gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/riscv64-unknown-elf/8.2.0/lto-wrapper
Target: riscv64-unknown-elf
Configured with: /home/hepaad/Documentos/ARCH3/riscv-gnu-toolchain/riscv-gcc/configure —target=riscv64-unknown-elf —prefix=/usr/local —disable-shared —disable-threads —disable-tls —enable-languages=c,c++ —with-system-zlib —with-newlib —with-sysroot=/usr/local/riscv64-unknown-elf —disable-libmudflap —disable-libssp —disable-libquadmath —disable-libgomp —disable-nls —src=.././riscv-gcc —enable-checking=yes —disable-multilib —with-abi=lp64d —with-arch=rv64imafdc ‘CFLAGS_FOR_TARGET=-Os -mcmodel=medlow’ ‘CXXFLAGS_FOR_TARGET=-Os -mcmodel=medlow’
Thread model: single
gcc version 8.2.0 (GCC)

I saw that folder ARCH3, I deleted myabe it is problem.

How I can re-install this program?

Regards
Adolfo Hernandez.

@jim-wilson

riscv-gnu-toolchain has a README.md file.

You need to use -v when compiling, e.g. riscv64-unknown-elf-gcc -v hello.c, and then look at the header file include paths in the output.

The directory where you built gcc is not required to run gcc after installing, as long as you did not install into the build tree. This does make it harder to debug build problems if you don’t have the build tree anymore though.

@hepaad

Hi Jim:
Check my log file.
hepaad@hepaad-Vostro-5470:~/programas$ riscv64-unknown-elf-gcc -v hello.c
Using built-in specs.
COLLECT_GCC=riscv64-unknown-elf-gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/riscv64-unknown-elf/8.2.0/lto-wrapper
Target: riscv64-unknown-elf
Configured with: /home/hepaad/Documentos/ARCH3/riscv-gnu-toolchain/riscv-gcc/configure —target=riscv64-unknown-elf —prefix=/usr/local —disable-shared —disable-threads —disable-tls —enable-languages=c,c++ —with-system-zlib —with-newlib —with-sysroot=/usr/local/riscv64-unknown-elf —disable-libmudflap —disable-libssp —disable-libquadmath —disable-libgomp —disable-nls —src=.././riscv-gcc —enable-checking=yes —disable-multilib —with-abi=lp64d —with-arch=rv64imafdc ‘CFLAGS_FOR_TARGET=-Os -mcmodel=medlow’ ‘CXXFLAGS_FOR_TARGET=-Os -mcmodel=medlow’
Thread model: single
gcc version 8.2.0 (GCC)
COLLECT_GCC_OPTIONS=’-v’ ‘-march=rv64imafdc’ ‘-mabi=lp64d’
/usr/local/libexec/gcc/riscv64-unknown-elf/8.2.0/cc1 -quiet -v hello.c -quiet -dumpbase hello.c -march=rv64imafdc -mabi=lp64d -auxbase hello -version -o /tmp/ccWJd5bg.s
GNU C17 (GCC) version 8.2.0 (riscv64-unknown-elf)
compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version none
GGC heuristics: —param ggc-min-expand=30 —param ggc-min-heapsize=4096
ignoring nonexistent directory «/usr/local/riscv64-unknown-elf/usr/local/include»
ignoring nonexistent directory «/usr/local/lib/gcc/riscv64-unknown-elf/8.2.0/../../../../riscv64-unknown-elf/include»
ignoring nonexistent directory «/usr/local/riscv64-unknown-elf/usr/include»
#include «…» search starts here:
#include <…> search starts here:
/usr/local/lib/gcc/riscv64-unknown-elf/8.2.0/include
/usr/local/lib/gcc/riscv64-unknown-elf/8.2.0/include-fixed
End of search list.
GNU C17 (GCC) version 8.2.0 (riscv64-unknown-elf)
compiled by GNU C version 7.3.0, GMP version 6.1.2, MPFR version 4.0.1, MPC version 1.1.0, isl version none
GGC heuristics: —param ggc-min-expand=30 —param ggc-min-heapsize=4096
Compiler executable checksum: a876a06a95b9c0558b0c192b502929a7
hello.c:1:10: fatal error: stdio.h: No such file or directory
#include <stdio.h>
^~~~~~~~~
compilation terminated.

Regards
Adolfo Hernandez.

@hepaad

H jim:

I copied the folder that misising in the official route and working fine.

Thank you for your help.

Only one question. do you know a recipe to create a new isntruction? like mac,
a=+ b*c;

@jim-wilson

@Ray-Lei-93

H jim:

I copied the folder that misising in the official route and working fine.

Thank you for your help.

Only one question. do you know a recipe to create a new isntruction? like mac,
a=+ b*c;

Hi hepaad,

Can you tell me where I can copied those files form? I don’t know where to find it.

@hepaad

Hi Lei:

I don’t remember where is it. sorry.

Regards
Hepaad.

El dom., 15 dic. 2019 a las 7:38, Ray-Lei (<notifications@github.com>)
escribió:

H jim:

I copied the folder that misising in the official route and working fine.

Thank you for your help.

Only one question. do you know a recipe to create a new isntruction? like
mac,
a=+ b*c;

Hi hepaad,

Can you tell me where I can copied those files form? I don’t know where to
find it.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#247>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACLUQFCCRCPPGWMXBFKL2ITQYYXOVANCNFSM4FWUP32A>
.


Adolfo Hernández Padilla
Ing. de Pruebas

@jim-wilson

In the source tree, for an embedded elf build, the header files should be in riscv-newlib/newlib/libc/include. But these files should automatically be installed as part of the build.

@Ray-Lei-93

Hi Hepaad,

Thanks for your reply! I find it :)

@Ray-Lei-93

Hi Jim,

Thanks a lot! I find the header files are in the right directory.
The only problem is that I try to run the following command,
riscv64-unknown-linux-gnu-gcc -o hello hello.c.
Seems like I misunderstand the meaning of Linux cross-compiler as the cross-compiler run under linux.

@jim-wilson

I pointed at the newlib header files used by the embedded elf compiler. If you are using a linux target compiler then you need the glibc header files instead of the newlib header files. But yes, there are two possible cross compilers here, one that produces code for embedded elf targets, and one that produces code for linux targets.

@ali-tah

I have the same problem on Windows.
(gcc -c main.cpp -o main.o
main.cpp:1:19: fatal error: stdio.h: No such file or directory
#include <stdio.h>
^
compilation terminated.
Makefile:17: recipe for target ‘main.o’ failed
mingw32-make: *** [main.o] Error 1 )

0 / 0 / 0

Регистрация: 04.04.2022

Сообщений: 2

1

04.04.2022, 17:51. Показов 2768. Ответов 28


Установил Visual Studio. Добавил новый элемент, изменив расширение файла под .c.
При запуске кода выдает ошибку:
Не удается открыть файл включение: stdio.h: No such file or directory,
Как исправить?

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



0



Programming

Эксперт

94731 / 64177 / 26122

Регистрация: 12.04.2006

Сообщений: 116,782

04.04.2022, 17:51

28

1131 / 812 / 248

Регистрация: 30.06.2015

Сообщений: 4,234

Записей в блоге: 44

04.04.2022, 18:28

2

Не занимайся мазохизмом — программировать на си из под студии это оно и есть..



0



0 / 0 / 0

Регистрация: 04.04.2022

Сообщений: 2

04.04.2022, 19:00

 [ТС]

3

Это, конечно, хороший совет. Но я пока учусь в универе на этом языке)



0



Вездепух

Эксперт CЭксперт С++

10426 / 5696 / 1552

Регистрация: 18.10.2014

Сообщений: 14,052

05.04.2022, 01:46

4

Цитата
Сообщение от CoderHuligan
Посмотреть сообщение

Не занимайся мазохизмом — программировать на си из под студии это оно и есть..

Что за невероятный бред? Откуда это берется, интересно?

Цитата
Сообщение от Zubov Dmitriy
Посмотреть сообщение

При запуске кода выдает ошибку:
Не удается открыть файл включение: stdio.h: No such file or directory,
Как исправить?

Во-первых, показать реальный код, а не рассказывать тут прохладные истории о коде.

Во-вторых, проверить, установлена ли Windows SDK.



0



1131 / 812 / 248

Регистрация: 30.06.2015

Сообщений: 4,234

Записей в блоге: 44

05.04.2022, 12:14

5

Цитата
Сообщение от TheCalligrapher
Посмотреть сообщение

Что за невероятный бред?

Потому что студия заточена на плюсы. А для си есть другие вменяемые инструменты.



0



Вездепух

Эксперт CЭксперт С++

10426 / 5696 / 1552

Регистрация: 18.10.2014

Сообщений: 14,052

05.04.2022, 12:24

6

Цитата
Сообщение от CoderHuligan
Посмотреть сообщение

Потому что студия заточена на плюсы. А для си есть другие вменяемые инструменты.

Нет, не заточена. И нет, «более вменяемых» инструментов для С нет.



0



1131 / 812 / 248

Регистрация: 30.06.2015

Сообщений: 4,234

Записей в блоге: 44

05.04.2022, 13:20

7

Цитата
Сообщение от TheCalligrapher
Посмотреть сообщение

«более вменяемых» инструментов для С нет.

gcc — не?



0



фрилансер

4470 / 3972 / 868

Регистрация: 11.10.2019

Сообщений: 10,484

05.04.2022, 14:51

8

CoderHuligan, программировать на Си — это само по себе мазохизм

а студия прекрасно с ним работает для всех желающих



0



Вездепух

Эксперт CЭксперт С++

10426 / 5696 / 1552

Регистрация: 18.10.2014

Сообщений: 14,052

05.04.2022, 17:20

9

Цитата
Сообщение от CoderHuligan
Посмотреть сообщение

gcc — не?

Не совсем понятно сравнение это компилятора (gcc), с IDE (Visual Studio), но тем не менее: а в чем же заключается «более вменяемость» gcc?



0



JmpShort

05.04.2022, 17:49

Не по теме:

Кликните здесь для просмотра всего текста

Программисты всегда спорят о том, какой язык программирования лучше.
Попробуйте склонить программистов, привыкших работать на С, к работе
с Pascal, и они пошлют вас подальше. Попробуйте заставить специалистов
по Pascal обратить хоть какое-то внимание на Basic, и они обязательно
объяснят, куда вам пойти. И даже не думайте доказывать фанам FORTH,
что это — совершенно непонятный язык и не приспособлен для какой-
либо серьёзной работы: в лучшем случае вас просто прогонят.

Я стараюсь избегать всех подобных аргументов в спорах. Они кажутся
мне просто смешными. Представьте, что это не программист, а шеф-повар
доказывает, что вкуснее суфле, рецепт которого написан на английском,
а не на французском или на испанском. Конечно же, это — глупость: мы
получаем одно и то же блюдо, независимо от того, на каком языке
обозначены его ингредиенты. Цветок есть цветок, не правда ли?



0



1131 / 812 / 248

Регистрация: 30.06.2015

Сообщений: 4,234

Записей в блоге: 44

05.04.2022, 19:06

11

Цитата
Сообщение от TheCalligrapher
Посмотреть сообщение

Не совсем понятно сравнение это компилятора (gcc), с IDE (Visual Studio)

Ну понятно же, что я имел ввиду не саму ide, а майкрософтовский компилятор, который идет в неразрывном комплекте. А этот компилятор есть компилятор языка с++, а не с. Усё.

Не по теме:

Цитата
Сообщение от JmpShort
Посмотреть сообщение

Программисты всегда спорят о том, какой язык программирования лучше.

А мы и не спорим о языках.



0



Вездепух

Эксперт CЭксперт С++

10426 / 5696 / 1552

Регистрация: 18.10.2014

Сообщений: 14,052

05.04.2022, 19:11

12

Цитата
Сообщение от CoderHuligan
Посмотреть сообщение

Ну понятно же, что я имел ввиду не саму ide, а майкрософтовский компилятор, который идет в неразрывном комплекте. А этот компилятор есть компилятор языка с++, а не с. Усё.

Вот про это я и спрашивал: откуда лезет этот бред? Где у него гнездо?

В комплекте с Visual Studio идут совершенно самостоятельные специализированные компиляторы С и С++. В точности точно так же, как в GCC.

Но кто-то время от времени вбрасывает этот странный миф, что программирование на С в Visual Studio делается в компиляторе С++… Откуда это лезет?



0



фрилансер

4470 / 3972 / 868

Регистрация: 11.10.2019

Сообщений: 10,484

05.04.2022, 21:07

13

Цитата
Сообщение от JmpShort
Посмотреть сообщение

Конечно же, это — глупость: мы
получаем одно и то же блюдо, независимо от того, на каком языке
обозначены его ингредиенты

только на одном языке повар получает удовольствие от процесса, а на другом — от боли



0



ALEX5791

10 / 9 / 1

Регистрация: 25.02.2020

Сообщений: 31

05.04.2022, 21:27

14

vc 2010 и др. работают с файлами .срр (с++). Язык с++ поддерживает основные конструкции языка Си , но все же это другой язык. Вот пример программы работающей в VC 2010:

C
1
2
3
4
5
6
7
8
9
10
// az1.cpp: определяет точку входа для консольного приложения.
//
#include "StdAfx.h"
#include <stdio.h>  // Подключение библиотеки ввода-вывода
int main()         // Главная функция
{
  printf("Hello, world!"); // Вывод сообщения
  getchar();               // Задержка окна консоли
  return 0;
}

А вообще для СИ лучше либо DEV-C (там при запуске из С и С++ выбрать С), либо компилятор GCC.
Читаите книгу МАЙК МАКГРАТ С (ПРОГРАММИРОВАНИЕ ДЛЯ НАЧИНАЮЩИХ). ТАМ И ПРО КОМПИЛЯТОР GCC ПОДРОБНО НАПИСАНО.



0



Вездепух

Эксперт CЭксперт С++

10426 / 5696 / 1552

Регистрация: 18.10.2014

Сообщений: 14,052

05.04.2022, 21:51

15

Цитата
Сообщение от ALEX5791
Посмотреть сообщение

vc 2010 и др. работают с файлами .срр (с++)

Опять пошла бредятина. «vc 2010 и др. работают с файлами .срр»- что это за чушь?

Во-первых, имена файлов назначаете вы сами.

Во-вторых, точно так же как и в других компиляторах, настройки компилятора позволяют вам выбрать язык программирования явно, независимо от имени файла.

То есть «файлы .срр» никакого значения не имеют. К чему это здесь?

Цитата
Сообщение от ALEX5791
Посмотреть сообщение

Язык с++ поддерживает основные конструкции языка Си , но все же это другой язык.

При чем здесь вообще язык С++, если речь шла о программировании на С? Почему речь зашла о С++?

Цитата
Сообщение от ALEX5791
Посмотреть сообщение

Вот пример программы работающей в VC 2010:

При чем здесь это?

Цитата
Сообщение от ALEX5791
Посмотреть сообщение

А вообще для СИ лучше либо DEV-C (там при запуске из С и С++ выбрать С), либо компилятор GCC.

Чем лучше?

Нет, конечно. И для С, и для С++ сейчас безраздельно доминирует Visual Studio.



0



Атлетичный программист

37 / 40 / 15

Регистрация: 12.01.2022

Сообщений: 558

05.04.2022, 23:03

16

TheCalligrapher, то-то тут постоянно появляются студенты, которые не знают на каком языке они пишут на С или на С++ и подключают все возможные заголовочные файлы которые знают.
Получается смесь Си и C++ с stdio и iostream в одном флаконе



0



Вездепух

Эксперт CЭксперт С++

10426 / 5696 / 1552

Регистрация: 18.10.2014

Сообщений: 14,052

06.04.2022, 00:39

17

Цитата
Сообщение от Гай
Посмотреть сообщение

то-то тут постоянно появляются студенты, которые не знают на каком языке они пишут на С или на С++ и подключают все возможные заголовочные файлы которые знают.
Получается смесь Си и C++ с stdio и iostream в одном флаконе

Это верно.

Но вопрос-то не об этом, а о каких-то феерически загадочных дичайших заявлениях вроде «vc 2010 и др. работают с файлами .срр (с++)» и «майкрософтовский компилятор, который идет в неразрывном комплекте, есть компилятор языка с++, а не с.»

Откуда такое берется?



0



easybudda

Модератор

Эксперт PythonЭксперт JavaЭксперт CЭксперт С++

11655 / 7167 / 1702

Регистрация: 25.07.2009

Сообщений: 13,132

06.04.2022, 00:58

18

Цитата
Сообщение от TheCalligrapher
Посмотреть сообщение

Откуда такое берется?

Да оттуда, откуда и подобные заявления:

Цитата
Сообщение от TheCalligrapher
Посмотреть сообщение

И для С, и для С++ сейчас безраздельно доминирует Visual Studio.

Zubov Dmitriy, сделайте дословно следующее: создайте новый пустой проект, не «консольное приложение» или что-то подобное, а именно пустой. Добавьте в него файл main.c, в котором напишите

C
1
2
3
4
5
6
7
8
#include <stdio.h>
#include <stdlib.h>
 
int main(void) {
    printf("Hello world!n");
    system("pause");
    return 0;
}

и попробуйте скомпилировать. Если снова не выйдет, смотрите в настройках компилятора путь к заголовочным файлам (include dir), проверяйте, действительно ли они там находятся…



0



Вездепух

Эксперт CЭксперт С++

10426 / 5696 / 1552

Регистрация: 18.10.2014

Сообщений: 14,052

06.04.2022, 01:17

19

Цитата
Сообщение от easybudda
Посмотреть сообщение

Да оттуда, откуда и подобные заявления:

Нет, конечно. Компиляторы каких языков идут в составе Visual Studio — проверяется мгновенно, в том числе самостоятельно. То есть для этого не требуется полагаться на чьи-то посторонние утверждения. В отличие от заявлений о «доминировании»…

То есть это — мгновенно доступная фактографическая информация. Как количество миллиметров в сантиметре. Можно посмотреть в инете, можно посмотреть в справочнике, а можно тут же посчитать на линейке.

Поэтому возникает вот это вот волна изумления: откуда лезет подобная чушь?



0



1131 / 812 / 248

Регистрация: 30.06.2015

Сообщений: 4,234

Записей в блоге: 44

06.04.2022, 13:34

20

Цитата
Сообщение от TheCalligrapher
Посмотреть сообщение

Откуда такое берется?

Я тоже задал бы вам вопрос: откуда вы взяли, что студия имеет под своим капотом два разных независимых друг от друга компилятора для с и с++? Например я лично имел дело с бесплатной студией express edition. Ставил на xp. Эта студия имеет название Visual Studio 2012 VC++ Redistributable. Компиляция там определялась по расширению файла с кодом. Никакого отдельного компилятора c там подключить было нельзя. Возможно вы пользуетесь платной версией для профи, возможно там по другому. Но программировать на си в этом продукте невозможно из-за постоянных непоняток.



0



  • Remove From My Forums
  • Question

  • I am new to C++ programming in Visual Studio, When I run any c++ program it shows too many build errors. I am using Visual Studio Community 2015. It shows — fatal error C1083: Cannot open include file: ‘stdio.h’: No
    such file or directory

Answers

  • I am new to C++ programming in Visual Studio, When I run any c++ program it shows too many build errors. I am using Visual Studio Community 2015. It shows — fatal error C1083: Cannot open include file: ‘stdio.h’:
    No such file or directory

    Hi,

    According to your description. The compiler generates the c1083 error when it can’t find file. There are some reasons why the compiler generates this
    error. You can see the article. Hope the article can help you to resolve the problem.

    https://msdn.microsoft.com/en-us/library/et4zwx34.aspx?f=255&MSPPError=-2147217396

    If your original problem has been resolved, please mark the thread.

    Best Regards,

    Hart

    • Marked as answer by

      Wednesday, July 12, 2017 2:01 AM

    • Unmarked as answer by
      Rajat Maurya
      Wednesday, July 12, 2017 2:02 AM
    • Marked as answer by
      Rajat Maurya
      Wednesday, July 12, 2017 2:03 AM

  • Forum
  • Beginners
  • stdio.h: no such file or directory

stdio.h: no such file or directory

so ive searched the web on this for a while and most of the feedback says to make sure it is a c++ file and not a c file. I am using a cpp file, as the file is called «main.cpp» I am still getting the «fatal error: stdio.h: No such file or directory» message when trying to compile.

I’ve narrowed it down to the #include <fstream> line

1
2
3
4
5
6
7
8
9
10
11
#include <iostream>
#include <fstream>

using namespace std;

int main()
{
    cout << "Hellon";
    return 0;
}

I get the same error when running a simple program like this. I am using codeblocks 13.12 btw

Last edited on

Have you tried uninstalling and reinstalling? You may have a misconfigured compiler/IDE.

check settings->compiler(select your compiler from the drop down)->toolchain executables tab->autodetect.

most likely, if it does not find any compiler at all, you downloaded the version with no compiler. Btw, the third one is the one with compiler(MingW).

it worked by reinstalling it thanks!! Glad i could use VS in its place in the meantime

Topic archived. No new replies allowed.

Я пытаюсь создать решение для Visual Studio Community 2017, но я продолжаю получать сообщение об ошибке » Не могу открыть файл include:» stdio.h «. Я прочитал несколько подобных вопросов, но по-прежнему не могу решить эту проблему. Похоже, файл stdio.h вызывается в файле stdafx.h. Ниже приведены более подробные сведения. Какие-либо предложения? (Я не могу вставлять изображения, поэтому, пожалуйста, нажмите на ссылки для скриншотов.)

Сведения о системе: Windows 10
Сообщество Visual Studio 2017 v.15.2 (26430.6)
— Установленная разработка рабочего стола с помощью C++ (Снимок экрана: список установки)


Шаг 1: Я написал знаменитую программу Hello World в C++.

#include "stdafx.h"
#include <iostream>
using namespace std;

int main()
{
    cout << "Hello World!" << endl;
    return 0;
}

Шаг 2: Я нажал на Build> Build Solution.

Проблема: «stdio.h»: нет такого файла или каталога. Полная ошибка:

1>------ Build started: Project: HelloWorld, Configuration: Debug Win32 ------
1>stdafx.cpp
1>c:usersdahiana minidesktoplearncpphelloworldhelloworldstdafx.h(10): 
    fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory
1>Done building project "HelloWorld.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Устранение неисправностей/Вещи, которые я пробовал:

  1. Свойства конфигурации> V C++ Каталоги
    Include Directories $(VC_IncludePath);$(WindowsSDK_IncludePath);
  2. Скриншот: Solution Explorer (файлы в проекте)
  3. Код в файле stdafx.cpp:

    // stdafx.cpp : source file that includes just the standard includes  
    // HelloWorld.pch will be the pre-compiled header
    // stdafx.obj will contain the pre-compiled type information
    
    #include "stdafx.h"
    
    // TODO: reference any additional headers you need in STDAFX.H
    // and not in this file
    
  4. Код в файле stdafx.h:

    // stdafx.h : include file for standard system include files,
    // or project specific include files that are used frequently, but
    // are changed infrequently
    
    #pragma once
    
    #include "targetver.h"
    #include <stdio.h>
    #include <tchar.h>
    

    ПРИМЕЧАНИЕ. #include для <stdio.h> и <tchar.h> обе имеют красную линию <tchar.h> внизу и говорят, что «невозможно открыть исходный файл».
    TRIED: Я попытался удалить последние две строки, но потом у меня появилось больше ошибок.

  5. TRIED: Поскольку многие предположили, что stdafx.h не требуется, я попытался удалить только первую строку, #include "stdafx.h". Но для этого я должен был сделать немного больше. ПОСМОТРЕТЬ ОТВЕТ.

Понравилась статья? Поделить с друзьями:
  • Steinberg cubase для windows 7 скачать
  • Steep не устанавливается на windows 10
  • Steelseries siberia v2 драйвера windows 10
  • Stddef h file not found windows
  • Steelseries sensei raw драйвера windows 10