mathlink
- To: mathgroup at smc.vnet.net
- 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 wolfram.com
Hi,
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 f.tm :
--------------------------------------------------------------------
:Begin:
:Function: f
:Pattern: f[x_Integer, y_Integer]
:Arguments: {x, y}
:ArgumentTypes: {Integer, Integer}
:ReturnType: Integer
:End:
---------------------------------------------------------------------
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.