Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!ux1.cso.uiuc.edu!pequod.cso.uiuc.edu!dorner From: dorner@pequod.cso.uiuc.edu (Steve Dorner) Newsgroups: comp.sys.next Subject: mathlink Message-ID: <1989Dec4.143050.949@ux1.cso.uiuc.edu> Date: 4 Dec 89 14:30:50 GMT Sender: news@ux1.cso.uiuc.edu (News) Reply-To: dorner@pequod.cso.uiuc.edu (Steve Dorner) Organization: University of Illinois at Urbana-Champaign Lines: 42 I'm posting this for a friend. Please reply to him, not me. -------------------------------------------------------------------------- To anyone interested in using mathlink, If you compile mathlink.c (in NextApps/Mathematica.app/Kernel/Utilities) you get a list of warning messages basically of the form "function implicitely declared and later declared static". To get rid of these, for each function that was being declared implicitely, put its prototype in the external functions where it was being called. This gets rid of all warning messages except for "missing _main" which you should still be getting. Incidently, mathlink.h is empty and can stay empty. To test mathlink you can use the sample program given in NextLibrary/Documentation/Mathematica/UnixSummary.wn (on page 28). I copied the code and called it "sample.c". Be sure to replace all occurrences of "\\" by "\". (Check for "\\"'s in mathlink.c. If you find any, replace them by "\"'s.) Then from a shell do: cc -fwritable-strings mathlink.c sample.c to complike and link the programs (the executable will end up in a.out). Thank Bruce Bruce Blumberg for the correct compiler option. Start Mathematica and type: StartProcess["path"] where path is the full pathname of the executable file generated by the cc above. Path will be something like /me/programs/a.out . Mathematica should return a list {BitAnd, CheckSum}, which contains the C functions that were installed and can now be used like any other built- in Mathematica functions. chuck fleming cfcgf@ecncdc.bitnet -------------------------------------------------------------------------- -- Steve Dorner, U of Illinois Computing Services Office Internet: s-dorner@uiuc.edu UUCP: {convex,uunet}!uiucuxc!dorner IfUMust: (217) 244-1765