[已解决] IDF.PY编译时提示找不到iostream

beyound
Posts: 20
Joined: Sat Jan 01, 2022 9:55 am

[已解决] IDF.PY编译时提示找不到iostream

Postby beyound » Mon Jan 03, 2022 8:29 am

Code: Select all

In file included from ../main/rt/RTNeural/RTNeural.h:5,
                 from ../main/rt/RTNeuralLSTM.h:3,
                 from ../main/main.c:29:
../main/rt/RTNeural/Model.h:6:10: fatal error: iostream: No such file or directory
 #include <iostream>
          ^~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
我在工程里引用了一个C++的库,里面用了iostream, 在一个C++的.h头文件开头。c++类库我确认都在idf的对应目录下,包括iostream等文件都是正常存在的,在VS Code里可以直接找到定义。
是因为我的工程主文件叫main.c, 编译工具认为我是C语言,不是C++语言吗? 怎么才能正常引用iostream这些c++的标准库啊?

beyound
Posts: 20
Joined: Sat Jan 01, 2022 9:55 am

Re: IDF.PY编译时提示找不到iostream

Postby beyound » Mon Jan 03, 2022 8:33 am

抱歉,把Cmakelist和main.c都改为main.CPP就解决了!

Who is online

Users browsing this forum: Baidu [Spider] and 56 guests