I don't know if this helps, but we have been also learning the basics of 
Cxx. See here @ovainola implementation of a simple library:
https://github.com/JuliaFEM/MiniBall.jl/blob/master/src/MiniBall.jl

On Saturday, August 1, 2015 at 5:00:41 PM UTC+3, Kostas 
Tavlaridis-Gyparakis wrote:
>
> Hello again,
> I am experiencing the following difficulty.
> So I have the above mentioned header and cpp files that define
> the class ArrayMaker  on top of that I wrote a small main connected
> to this class that simply excecute its function:
>
> main.cpp:
>
> #include "ArrayMaker.h"
> #include <iostream>
> using namespace std;
>
> int main(int argc, char ** argv) {
> ArrayMaker* FI_CSP=new ArrayMaker();
> int a = 7;
> float b = 4;
> double z;
> z = FI_CSP->ArrayMak(a,b);
> cout<<endl<<"Test = "<< z;
> return 1;
> }
>
> Now I created for Arraymaker.cpp, Arraymaker.h and main.cpp a shared 
> library
> so that I can link it with a julia file.
> So on this point I do have a very noob question, but I couldn't work it 
> out from 
> the examples of cxx in its webpage. Say I have done the connection with the
> shared library properly inside a julia file to link with the above class 
> and main.
> That looks as the previous one like this:
>
> using Cxx
> # Importing shared library and header file
> const path_to_lib = "/home/kostav/Documents/Project/julia/cle"     
> addHeaderDir(path_to_lib, kind=C_System)
> Libdl.dlopen(path_to_lib * "/test.so", Libdl.RTLD_GLOBAL)
> cxxinclude("ArrayMaker.h")
>
> So my really noob question is how is the proper syntaxis so that in this
> julia file I can call and run the above mentioned main.cpp file?
>

Reply via email to