| Author |
Comment/Response |
Martin
|
03/28/12 11:21am
Hi,
I wrote a small dynamic library in C for MacOSX which evaluates Mathematica expression using the C MathLink functions.
It works fine, except for the Export command: I want to export a plot to a file, but no file is created with this code:
MLPutFunction(lp, "EvaluatePacket", 1);
MLPutFunction(lp, "Export", 2);
MLPutString(lp, "/Users/martin/...../file.png");
MLPutFunction(lp, "ToExpression", 1);
MLPutString(lp, "Plot[x,{x,0,1}]");
MLEndPacket(lp);
while((pkt = MLNextPacket(lp), pkt) && pkt != RETURNPKT)
MLNewPacket(lp);
pkt = MLGetString(lp, &res);
The MLGetString correctly returns the path to the file, but no file is created, and the same code works fine when using the LinkRead/LinkWrite functions in Mathematica itself... Also, similar code without using Export works fine, so I have no idea what could be wrong here?
Cheers,
Martin
URL: , |
|