<p dir="auto">I am using Julia 1.6.0-rc1. As stated at <a href="https://docs.julialang.org/en/v1/manual/embedding/" rel="nofollow">https://docs.julialang.org/en/v1/manual/embedding/</a>, I made the necessary settings in Visual Studio 2019, but when I compile the code, I get the error 'jl_atomic_load_relaxed: identifier not found.'</p>
<p dir="auto">Code:</p>
<div class="highlight highlight-source-c notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#include &lt;uv.h&gt;
#include &lt;Windows.h&gt;
#include &lt;julia.h&gt;

int main(int argc, char* argv[])
{
    jl_init();
    jl_eval_string(&quot;print(sqrt(2.0))&quot;);
    jl_atexit_hook(0);
    return 0;
}"><pre class="notranslate"><span class="pl-k">#include</span> <span class="pl-s">&lt;uv.h&gt;</span>
<span class="pl-k">#include</span> <span class="pl-s">&lt;Windows.h&gt;</span>
<span class="pl-k">#include</span> <span class="pl-s">&lt;julia.h&gt;</span>

<span class="pl-smi">int</span> <span class="pl-en">main</span>(<span class="pl-smi">int</span> <span class="pl-s1">argc</span>, <span class="pl-smi">char</span><span class="pl-c1">*</span> <span class="pl-s1">argv</span>[])
{
    <span class="pl-en">jl_init</span>();
    <span class="pl-en">jl_eval_string</span>(<span class="pl-s">"print(sqrt(2.0))"</span>);
    <span class="pl-en">jl_atexit_hook</span>(<span class="pl-c1">0</span>);
    <span class="pl-k">return</span> <span class="pl-c1">0</span>;
}</pre></div>
<p dir="auto">Error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="'jl_atomic_load_relaxed': identifier not found    julia.h     880
'jl_atomic_load_relaxed': identifier not found    julia.h     924
'jl_atomic_load_relaxed': identifier not found    locks.h   24
'jl_atomic_load_relaxed': identifier not found    locks.h   40"><pre class="notranslate"><code class="notranslate">'jl_atomic_load_relaxed': identifier not found    julia.h     880
'jl_atomic_load_relaxed': identifier not found    julia.h     924
'jl_atomic_load_relaxed': identifier not found    locks.h   24
'jl_atomic_load_relaxed': identifier not found    locks.h   40
</code></pre></div>
<p dir="auto">I get a host of compile errors (about 30) by trying to compile the simple "Embedding Julia in C++" <a href="https://docs.julialang.org/en/v1/manual/embedding/" rel="nofollow">https://docs.julialang.org/en/v1/manual/embedding/</a>.</p>
<p dir="auto">Here are the first 5:</p>
<p dir="auto">1&gt;C:\Users\VitalRoberto\AppData\Local\Programs\Julia-1.7.0-beta4\include\julia\julia_threads.h(321,5): error C2065: ‘__ATOMIC_SEQ_CST’: undeclared identifier<br>
1&gt;C:\Users\VitalRoberto\AppData\Local\Programs\Julia-1.7.0-beta4\include\julia\julia_threads.h(321,5): error C3861: ‘__atomic_signal_fence’: identifier not found<br>
1&gt;C:\Users\VitalRoberto\AppData\Local\Programs\Julia-1.7.0-beta4\include\julia\julia_threads.h(321,5): error C2065: ‘__ATOMIC_RELEASE’: undeclared identifier<br>
1&gt;C:\Users\VitalRoberto\AppData\Local\Programs\Julia-1.7.0-beta4\include\julia\julia_threads.h(321,5): error C3861: ‘__atomic_store_n’: identifier not found<br>
1&gt;C:\Users\VitalRoberto\AppData\Local\Programs\Julia-1.7.0-beta4\include\julia\julia_threads.h(325,9): error C2065: ‘__ATOMIC_SEQ_CST’: undeclared identifier</p>
<p dir="auto">in 1.7, atomics.h doesn’t have good definitions for MSVC.<br>
I copied the atomics.h from Julia 1.6.5 and got it to work (also had to define jl_atomic_cmpswap). Seems like someone overlooked this platform.</p>