I have an external library written in C++ such as
external.h
#ifndef OUTPUT_FROM_CPP_H
#define OUTPUT_FROM_CPP_H
#include <cstdint>
extern "C" uint8_t myCppFunction(uint8_t n);
#endif
external.cpp
#include "external.h"
uint8_t myCppFunction(uint8_t n)
{
return n;
}
Currently I have no choice but use this C++ library in my current C project. But my compiler is telling me
No such file or director #include <cstdint>
when used in my C project
main.c
#include "external.h"
int main()
{
int a = myCppFunction(2000);
return a;
}
I understand that this is because cstdint is a C++ standard library that I'm trying to use through my C file.
My questions are:
- Is there a way I can manage to use this C++ library in my C project without modifying my libary ?
- If no, what whould I have to do on the library side to make it possible ?