inttypes.h file not found compiling Duktape with C++ Builder and Clang

1.1k Views Asked by At

I have created a simple Duktape example using C++ Builder Seattle and follow the code in "Initialize a context" from Duktape. It compiles fine when using classic mode. If I switch to clang via unchecking Project->Options->C++ Compiler->Use 'classic' Borland compiler, I get the following error.

inttypes.h file not found on line 780 of duktape.h

If I comment out the include I get the following errors:

Unresolved external _va_copy
Unresolved external _fmin
Unresolved external _fmax
1

There are 1 best solutions below

0
Sami Vaarala On

The normal way would to ensure clang has -std=c99 so that no legacy type detection is necessary. Legacy type detection isn't always reliable.

However, if you can't use C99/C++11 for some reason, you can always edit the duk_config.h header directly (duk_config.h is present since Duktape 1.3.0), which contains all the detection logic.