Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the example for MSVC in the Embedding Julia documentation #44587

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions doc/src/manual/embedding.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,16 +141,21 @@ Now the build command is simply `make`.
If the `JULIA_DIR` environment variable hasn't been setup, add it using the System panel before
starting Visual Studio. The `bin` folder under JULIA_DIR should be on the system PATH.

We start by opening Visual Studio and creating a new Console Application project. To the 'stdafx.h'
header file, add the following lines at the end:
We start by opening Visual Studio and creating a new Console Application project. Replace the
generated C++ code with the following:

```c
#include <julia.h>
```
```c++
#include <uv.h>
#include <windows.h>

template <typename T>
static inline T jl_atomic_load_relaxed(volatile T *obj)
{
return jl_atomic_load_acquire(obj);
}

Then, replace the main() function in the project with this code:
#include <julia.h>

```c
int main(int argc, char *argv[])
{
/* required: setup the Julia context */
Expand Down