I have a function written in c++ and declare it using extern "C" as below. vectors are used inside the test().
test.hpp
#include <vector>
#ifdef __cplusplus
extern "C" {
#endif
void test();
#ifdef __cplusplus
}
#endif
And calling it in C code as below:
#include "test.hpp"
void main(){
test();
}
c++ code compiles fine using g++, while compiling c with GCC, I'm getting No such file or directory error.
fatal error: vector: No such file or directory
16 | #include <vector>
| ^~~~~~~~