The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: problems with dll library
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List

Posts: 4
Registered: 11/23/12
problems with dll library
Posted: Jan 11, 2013 10:23 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply


I have proble which I can not solve for a long time...

I use MinGW compiler to generate dll library - I use a following command to compile a code:

gcc -Wall -shared libraryX.c -o libraryX.dll

in the libraryX.c I put a simple function:

double signX( double x ) {
double s = 0.0;

/*Funtion body*/
if( x > 0.0) s = 1.0;
if( x < 0.0) s = -1.0;


When I am trying to use this function in Mathematica with a command:

signX = DefineDLLFunction["signX", "libraryX.dll", "double", {"double"}];

I get a following error:

"A .NET exception occurred: \!\(\"System.BadImageFormatException: Probowano zaladowac program w niepoprawnym formacie.
(Wyj\\:0105tek od HRESULT: 0x8007000B)\\n w
Wolfram.NETLink.DynamicDLLNamespace.DLLWrapper16.signX(Double )

Does anybody know how to load such simple funtion in mathematica?

I would be garteful for some hints.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.