I have just transferred from W95 to Linux and am having some trouble
compiling & running the MathLink examples.
Following the instructions in the documentation, I attempted to create
an executable from addtwo.c using "make" and the Makefile in the
examples directory. The error returned is "undefined reference to
MLMain". I presume that the compiler cannot find mathlink.h or libML.a,
but the paths in the Makefile are correct.
I then attempted to create the executable using mcc. An executable is
indeed created but will not install, the error message informs me that
the link is dead.
The pre-built examples work fine, so obviously the problem is with my
lack of experience using gcc & Linux.
Any help to get me going will be much appreciated.
Thanks,
Roger Mason
Check to see what the default runtime library environment on your
machine is. If it is a recent Linux distribution, chances are that
you are using version 2 of the GNU C library (glibc2). The version
number of this library is libc.so.6.x. The MathLink library libML.a
that comes with the developer kit on the CD-ROM is linked against
the older C library -- libc.so.5.x.
If the above situation is the case, you'll need to download a new
relelase of the MathLink Developer's Kit that contains a glibc2
version of libML.a.
Further information can be found at this FAQ page.
http://www.wolfram.com/support/MathLink/Linux/RedHat5.html
--
P.J. Hinton
Mathematica Programming Group pa...@wolfram.com
Wolfram Research, Inc. http://www.wolfram.com/~paulh/
Disclaimer: Opinions expressed herein are those of the author alone.