Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2000

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

Search the Archive


  • To: mathgroup at
  • Subject: [mg25229] mathlink
  • From: Richard S Hsu <rhsu at U.Arizona.EDU>
  • Date: Fri, 15 Sep 2000 02:22:00 -0400 (EDT)
  • Sender: owner-wri-mathgroup at


I am learning MathLink. I copied the .tm and .c files from the Mathmatica
book(version 3).

file f.c :
#include "mathlink.h"

int f(int x, int, y) {
    return x+y ;

int main(int argc, char *argv[]) {
    return MLMain(argc, argv);

file :
:Function:       f
:Pattern:        f[x_Integer, y_Integer]
:Arguments:      {x, y}
:ArgumentTypes:  {Integer, Integer}
:ReturnType:     Integer

When I run  ' mcc f.em ', I got the error messages:

/usr/lib/crt1.o: In function `_start':
/usr/lib/crt1.o(.text+0x57): undefined reference to `main'
/tmp/cca105961.o: In function `_tr0':
/tmp/cca105961.o(.text+0x5d): undefined reference to `f'

I use a Linux system.

Thank for help.

  • Prev by Date: How to display the desired numerical precision?
  • Next by Date: First derivative of interpolated spline
  • Previous by thread: Re: Re: mathlink
  • Next by thread: Re: Re: mathlink