Код C++ сегодня перестал компилироваться (по всей видимости, связан с iostream)C++

Программы на C++. Форум разработчиков
Anonymous
 Код C++ сегодня перестал компилироваться (по всей видимости, связан с iostream)

Сообщение Anonymous »

У меня есть сторонняя библиотека C++, которая успешно компилируется и компонуется на моем компьютере в течение как минимум года. Ничего не изменилось, кроме разве что версии компилятора, но теперь компилятор выдает ошибки такого типа:
[ 2%] Building CXX object GEMS3K/CMakeFiles/GEMS3K_OBJECT.dir/gdatastream.cpp.o
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/_wchar.h:90,
from /Library/Developer/CommandLineTools/SDKs/MacOSX15.0.sdk/usr/include/wchar.h:67,
from /opt/homebrew/Cellar/gcc/14.2.0/include/c++/14/cwchar:44,
from /opt/homebrew/Cellar/gcc/14.2.0/include/c++/14/bits/postypes.h:40,
from /opt/homebrew/Cellar/gcc/14.2.0/include/c++/14/iosfwd:42,
from /opt/homebrew/Cellar/gcc/14.2.0/include/c++/14/ios:40,
from /opt/homebrew/Cellar/gcc/14.2.0/include/c++/14/ostream:40,
from /opt/homebrew/Cellar/gcc/14.2.0/include/c++/14/iostream:41,
from /Users/jwbullard/Documents/Projects/Modeling/THAMES/src/GEMS3K-standalone/GEMS3K/gdatastream.cpp:29:
/opt/homebrew/Cellar/gcc/14.2.0/lib/gcc/current/gcc/aarch64-apple-darwin23/14/include-fixed/stdio.h:83:8: error: 'FILE' does not name a type
83 | extern FILE *__stdinp;
| ^~~~
/opt/homebrew/Cellar/gcc/14.2.0/lib/gcc/current/gcc/aarch64-apple-darwin23/14/include-fixed/stdio.h:81:1: note: 'FILE' is defined in header ''; this is probably fixable by adding '#include '
80 | #include
+++ |+#include
81 |

Я понимаю, что в сообщении говорится, что FILE не распознан, поскольку отсутствует включаемый файл stdio.h или cstdio. Сообщение об ошибке, похоже, указывает непосредственно на строку 29 в файле gdatastream.cpp, а строка 29 — это просто #include , и я ее не менял. Но я этого не понимаю, потому что (а) в исходном коде ничего не изменилось, и (б) ФАЙЛ нигде не появляется в исходном коде (но, вероятно, присутствует где-то в заголовке iostream или в одном из заголовки, которые он включает.
Это заставляет меня думать, что что-то изменилось в компиляторе во время обновления. Вот что, по моему мнению, имеет отношение к моей настройке:
  • Mac Sonoma 14.7
  • Компилятор Gnu, установленный с помощью homebrew, сейчас версия 14.2.0
  • Я использую система сборки cmake, и вот результат работы cmake, если это имеет значение:
-- The CXX compiler identification is GNU 14.2.0
-- The C compiler identification is GNU 14.2.0
-- Checking whether CXX compiler has -isysroot
-- Checking whether CXX compiler has -isysroot - yes
-- Checking whether CXX compiler supports OSX deployment target flag
-- Checking whether CXX compiler supports OSX deployment target flag - yes
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /opt/homebrew/bin/g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Checking whether C compiler has -isysroot
-- Checking whether C compiler has -isysroot - yes
-- Checking whether C compiler supports OSX deployment target flag
-- Checking whether C compiler supports OSX deployment target flag - yes
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/homebrew/bin/gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Setting build type to 'Release' as none was specified.
-- Building json key-value converter
-- Configuring done (6.4s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/xxx/Documents/Projects/Modeling/THAMES/src/GEMS3K-standalone/build


Подробнее здесь: https://stackoverflow.com/questions/790 ... o-iostream

Вернуться в «C++»