I assume you use the header file from https://webrtc.googlesource.com/src/+/refs/heads/main/api/peer_connection_interface.h. If that is the case, that peer_connection_interface.h
file includes vector.h
(https://webrtc.googlesource.com/src/+/refs/heads/main/api/peer_connection_interface.h#78), and probably your local vector.h
is similar to https://github.com/microsoft/STL/blob/main/stl/inc/vector#L8 and needs yvals_core.h
, an internal header file in Microsoft's Standard Library implementation for C++.
Below is where the error message is coming from.
// This does not use `_EMIT_STL_ERROR`, as it needs to be checked before we include anything else.
// However, `_EMIT_STL_ERROR` has a dependency on `_CRT_STRINGIZE`, defined in `<vcruntime.h>`.
// Here, we employ the same technique as `_CRT_STRINGIZE` in order to avoid needing to update the line number.
#ifndef __cplusplus
#define _STL_STRINGIZE_(S) #S
#define _STL_STRINGIZE(S) _STL_STRINGIZE_(S)
#pragma message(__FILE__ "(" _STL_STRINGIZE(__LINE__) "): STL1003: Unexpected compiler, expected C++ compiler.")
#error Error in C++ Standard Library usage
#endif // !defined(__cplusplus)
jextract
uses clang C API to parse the header file and when you try to run jextract
over the peer_connection_interface.h
, the indirect reference to yvals_core.h
signals that processing does not occur according to C++ standards. Moreover, https://webrtc.googlesource.com/src/+/refs/heads/main/api/peer_connection_interface.h is a C++ header file that does not have a C interface that jextract
can further process (please look at https://github.com/openjdk/jextract/blob/master/doc/GUIDE.md#other-languages).
If you would like to generate Java bindings for the webrtc
lib, my colleague Jorn Vernee found another standalone implementation of some of the WebRTC features that has a C interface: https://github.com/paullouisageneau/libdatachannel. He gave it a try on a Windows machine and works with jextract
.