I had some correspondence with Beau from Harmonic about compiling user
functions in C/C++ with the free compiler command line gcc in cygwin.
Below is the summary of the problem/solution.
Cheers,
Kurt
-----------------------------------
I initially tried to compile the code in cygwin with gcc (3.4.4) and
the dll that was created just froze O-Matrix when it was called (no
errors just freeze).
I later read that linking from VC/VC++ compiled programs can be
difficult from gcc (sometime it works sometimes it does not). A work
around is to use mingw from within cygwin. Below are the commands that
I used to generate the dll that worked.
In cygwin I moved to the directory containing the c++ files that I
wanted to put into the dll(note that mno-cygwin is the mingw flag).
$ gcc -mno-cygwin -c MYCOLMAX.CPP
this creates an object file MYCOLMAX.o
$ gcc -mno-cygwin -shared MYCOLMAX.o -o SAMPLE.dll
this produces the dll (SAMPLE.dll)
Calling this dll from O-Matrix produces the same response as the
SAMPLE.dll supplied.
You could additionally add maths optimisation/optimization flags to
the compiling and linking commands to make the dll to run faster.
Hope this helps others working in this area.