#include <vector>

kurtwerbrouck
Posts: 10
Joined: Tue Feb 16, 2021 2:37 pm

#include <vector>

Postby kurtwerbrouck » Fri Apr 28, 2023 5:25 pm

hello

i want to use the #include <vector>,but i get a fatal error,

fatal error: vector: No such file or directory
11 | #include <vector>

i am using esp-idf,under visual code.

Any solutions?

Thanks

MicroController
Posts: 1709
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: #include <vector>

Postby MicroController » Sat Apr 29, 2023 6:46 pm

Does your source file have a ".cpp" suffix to its name?

kurtwerbrouck
Posts: 10
Joined: Tue Feb 16, 2021 2:37 pm

Re: #include <vector>

Postby kurtwerbrouck » Mon May 01, 2023 8:52 am

Hello

The file has a .c

Kurt

ESP_Sprite
Posts: 9745
Joined: Thu Nov 26, 2015 4:08 am

Re: #include <vector>

Postby ESP_Sprite » Tue May 02, 2023 2:31 am

Then change it to be .cpp. The build system compiles .c files with a C compiler, and <vector> is a c++ thing.

Who is online

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