Код: Выделить всё
#include
int main()
{
std::ifstream("tmp.txt");
return 0;
}
Код: Выделить всё
my_test.cpp should add these lines:
#include // for ifstream
Код: Выделить всё
[ 50%] Building CXX object CMakeFiles/MyTest.dir/my_test.cpp.o
my_test.cpp:1:10: fatal error: '__fwd/fstream.h' file not found
Приложение: информация о конверте/воспроизведении
Я использовал следующий файл CMakeLists.txt:
Код: Выделить всё
cmake_minimum_required(VERSION 3.5)
project(MyTest VERSION 1.0 LANGUAGES CXX)
add_executable(MyTest my_test.cpp)
find_program(iwyu_path NAMES include-what-you-use iwyu OPTIONAL)
set(iwyu_options "-Xiwyu" "--mapping_file=${CMAKE_SOURCE_DIR}/iwyu.imp")
if(iwyu_path)
set_property(TARGET MyTest PROPERTY CXX_INCLUDE_WHAT_YOU_USE "${iwyu_path};;${iwyu_options}")
endif()
Подробнее здесь: https://stackoverflow.com/questions/782 ... esnt-exist
Мобильная версия