I could compile your program (and the slightly different from the docs, with JULIA_DEFINE_FAST_TLS) with any of these on Linux, and a bit different gcc line from the docs:
I’m not sure if you have a Mac problem or what, but use the latest 1.9.0 (which is out, not yet announced, or on the download page, e.g. rc3), or 1.8 (about to be decorated unsupported) or 1.6 LTS (or the unsupported 1.7, that should still work).
I googled your error and found (I’m not sure it’s relevant):
If you interpret those bytes as ASCII, you get #include <stdio.
It’s probably not relevant, but at least you don’t need #include <stdio.h> or at least it’s not in the example in the docs.
FYI: thee’s also his package for C++ (and another for Rust):
jluna aims to fully wrap the official Julia C-API, replacing it in projects with C++ as the host language […]
multidimensional, iterable array interface
provides a custom thread pool that, unlike the C-API, allows for concurrent interfacing with Julia
Can I ask what you want to do more, why embed, and why from C? The above package is for C++, but C++ is an (almost strict) superset of C, and it might be better to use that package from C++, even for the common C subset?
[I’ve already made a PR that was merged to doc existence of Julina in Julia’s official docs, so I’m unclear why it doesn’t show in 1.9.0 docs. I see it’s there for 1.10-DEV, and I’ve now ask for a backport of the docs.]
Solved! Thanks so much! I downloaded juliaup and replicated your steps and it worked. Note that in my case I had to modify “julia-1.8.0+0.x64.linux.gnu” for example to an existing version in my “.julia/juliaup/” directory