Good afternoon,
I’ve been trying to follow the basic guide for embedding Julia in C++, and I’m running into a problem when my C++ uses certain standard functions.
Here’s a simple bit of test code that causes the problem to occur:
#include <iostream>
#include <uv.h>
#include <windows.h>
#include <julia.h>
#include <cmath>
int main()
{
std::cout << "Hello World!\n";
/* required: setup the Julia context */
jl_init();
/* run Julia commands */
jl_eval_string("print(sqrt(2.0))");
double a = std::acos(2.0);
std::cout << a;
/* strongly recommended: notify Julia that the
program is about to terminate. this allows
Julia time to cleanup pending write requests
and run all finalizers
*/
jl_atexit_hook(0);
return 0;
}
Edit: Note the std::acos call added in the middle. Without this line, the executable runs and works as expected. The problem arises when I use functions from cmath or other things that appear to have the same function definition as those in the julia dlls. (The linker can’t differentiate?)
Would greatly appreciate any help in resolving this issue. Many thanks!
Josh