Mathlink and MPW v3.5 problems
- To: mathgroup at smc.vnet.net
- Subject: [mg30043] Mathlink and MPW v3.5 problems
- From: Sseziwa Mukasa <mukasa at jeol.com>
- Date: Wed, 25 Jul 2001 01:00:25 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
I am attempting to write a Mathlink program using MPW v3.5. I used mprep to generate the glue code and so far the program seems to launch correctly. However the MLEvaluate and MLEvaluateString functions are behaving strangely. Calling MLEvaluateString causes my program to immediately terminate and returns $Failed to the notebook. MLEvaluate seems to work. however any calls to MLNewPacket cause the same behavior as MLEvaluateString. This of course is expected as MLEvaluateString is simply MLEvaluate followed by a loop to eliminate all packets that are returned, The behavior of MLEvaluate is unexpected though. Can anyone give me any clues as to why it's behaving this way? Furthermore, I am not primarily a C programmer so some of my C skills are lacking however looking at the code generated by mprep it seems that the link used to communicate with Mathematica: stdlink is global to the routine being linked to Mathematica only. Therefore this link needs to be passed to any auxillary routines that wish to communicate with Mathematica. Is this correct? Since my routine takes two arrays as arguments I se teh argument type to {Manual} in the template and wrote an auxillary routine to read in an array off stdlink. I haven't been able to conclusively demonstrate this, but it seems any attempt to reference stdlink in this auxillary function causes the Mathlink to crash and returns a $Failed message. The code is a little long, but if anyone is willing to help me I will gladly send it to you for clarification. Thanks in advance, Sseziwa Mukasa