Call C++ dll used Cxx.jl on windows

Refer to official documents Example 8: Using C++ with shared libraries,the example is on linux,but I want to test on windows.



class __declspec(dllexport) ArrayMaker
int iNumber;
float fNumber;
float* fArr;
ArrayMaker(int, float);
float* fillArr();

extern “C” __declspec(dllexport) double GetSum(double x, double y);



#include “JuliaDll.h”

using namespace std;

ArrayMaker::ArrayMaker(int iNum, float fNum) {
cout << "Got arguments: " << iNum << ", and " << fNum << endl;
iNumber = iNum;
fNumber = fNum;
fArr = new float[iNumber];

float* ArrayMaker::fillArr() {
cout << “Filling the array” << endl;
for (int i=0; i < iNumber; i++) {
fArr[i] = fNumber;
fNumber *= 2;
return fArr;

double GetSum(double x, double y)
return x + y;

Refer to that example

julia> const path_to_lib = pwd()
addHeaderDir(path_to_lib, kind=C_System)
Libdl.dlopen(joinpath(path_to_lib, “JuliaDll.dll”), Libdl.RTLD_GLOBAL)
cxxinclude(joinpath(path_to_lib, “JuliaDll.h”))

This function is right

julia> a = @cxx GetSum(1,2)

Copy the example’s code report an error

julia> maker = @cxxnew ArrayMaker(5, 2.0)
LLVM ERROR: Program used external function ‘_ZN10ArrayMakerC1Eif’ which could not be resolved!