MathGroup Archive 2001

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Mathlink problem

  • To: mathgroup at smc.vnet.net
  • Subject: [mg28173] Re: Mathlink problem
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Tue, 3 Apr 2001 02:37:50 -0400 (EDT)
  • Organization: Universitaet Leipzig
  • References: <9a6dno$enq@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

a) mprep need the *.tm file *and* the *.c file
   and 

   mprep addtwo.tm addtwo.c -o addtwotm.c

   should work
b) it is good practice to have a single file with the
   C-code *and* the template merged. In such case you can
   instruct VC to use a user defined build  step to create
   the C-source for you by calling mprep
c) it is absolute your problem to specify *where*
   Visual C generate the output and the temporary files
   That is one of the settings of you project and you 
   should consult the manual to set up a custom workspace.
   You will become more nervous, if you find out hat
   Visual C generate the output in a .\addtwo\Release
   directory if you choose the release configuration
d) you link a program always with a kernel and *never* with
   a notebook

Regards
  Jens

Larry Gorski wrote:
> 
> Hello.  I'm trying to link a C language program to a Mathematica
> notebook.  I'm using Mathematica 4.1 and Microsoft Visual C++ V 6.0.
> I'm practicing with the "ADDTWO" example from Mathematica/Mathlnk.
> First, I had a problem prepoecessing the .tm file.  Visuall C++ couldn't
> seem to find the file.  I finally just ran "mprep addtwo.tm -o
> addtwotm.c" and copied the output file "addtwotm.c" to the correct
> subdirectory (workspace in Visuall C++).  I went back to Visual C++ and
> openen the correct workspace.  Addtwotm.c was identified as a source
> file along with addtwo.c.  So I tried to build "addtwo.exe"  It seemed
> to work i.e. 0 Errors, 0 Warnings.  I went backed to Matematica and
> tried to install "addtwo.exe".  First, it couldn't find the file.  The
> file was created by Visual C++ but it was in the .\addtwo\debug
> subdirectory.  That made me a bit nervous.  In any event, after
> providing the path to \addtwo.exe, the expected function calls did not
> work.  Mathematica seemed to act as if addtwo was not a function
> recognizable to it.
> 
> I very inexperienced in these things.  If you can help me understand
> where I went wrong and how to correct my problems, I would appreciate it
> but please keep the explanations simple.
> 
> Thanks.
> 
> Larry


  • Prev by Date: Re: 2D Fourier and Plot3D???
  • Next by Date: Re: Novice question regarding variable naming and subscripts
  • Previous by thread: Re: 2D Fourier and Plot3D???
  • Next by thread: Re: Mathlink problem