Passing a Julia struct to a already compiled cpp program

I am writing a program in Julia that reads data from a file into memory. I’d like to take that data and somehow pass it to a c++ program which will make use of OpenGL to draw that data to the screen.

I am making use of Visual Studio 22 for writing my C++ program. For OpenGL I am using GLFW and GLEW libraries.

Does anyone have any recommendations on how to accomplish this?

I am happy to answer any clarifying questions!

If it’s your own C++ code (or building it from source) the best solution (that I know) is to create C wrapper functions with

extern "C" {
   int foo(...);
}

that you can latter call with the ccall mechanism.