Prev: mathcode
Next: Limit
From: M. Prabhakar Rao on
Hello:

I have a question regarding MathLink. The basic idea is to be able to
access a function written in C via Mathematica. I followed the procedure
illustrated in the Mathematica Book. I wrote a template file for the
function and used mprep to generate corresponding .c file. However, when
I compile this .c file to generate the executable, I get the following
error:

In fuunction 'int _MLMain(char**, char**, char*):
error: '_fstrncpy' undeclared (first use this function)
error: (Each undeclared identifier is reported only once for each function
it appears in.)

When I look at the .c file generated by mprep, the function _fstrncpy is
declared as follows:
#if WIN32_MATHLINK && !defined(_fstrncpy)
# define _fstrncpy
#endif

System Information:
I am running Mathematica on a laptop under Windows XP. Since I do not have
Microsoft Visual Studio, I am using cygwin to write all my code in C.

Please help.

Best regards,

Prabhakar Rao
--
M. Prabhakar Rao, Ph.D.
Department of Mechanical Engineering
University of Maryland Baltimore County
http://userpages.umbc.edu/~mrao1

From: Jens-Peer Kuska on
Hi,

AFAIK MathLink will work with Borland C/C++ (free Personal edition
http://www.borland.com/downloads/download_cbuilderx.html),
Visual Studio (the free Visual Studio Express Edition
http://msdn.microsoft.com/vstudio/express/visualc/download/default.aspx)
Open Watcom C/C++
(http://www.openwatcom.org/index.php/Main_Page)
compilers. But it will not work with Cygwin and you should try
one of the compilers above -- none costs money for personal use.


Regards
Jens


"M. Prabhakar Rao" <mrao1(a)umbc.edu> schrieb im
Newsbeitrag news:dsetls$jgp$1(a)smc.vnet.net...
| Hello:
|
| I have a question regarding MathLink. The basic
idea is to be able to
| access a function written in C via Mathematica.
I followed the procedure
| illustrated in the Mathematica Book. I wrote a
template file for the
| function and used mprep to generate
corresponding .c file. However, when
| I compile this .c file to generate the
executable, I get the following
| error:
|
| In fuunction 'int _MLMain(char**, char**,
char*):
| error: '_fstrncpy' undeclared (first use this
function)
| error: (Each undeclared identifier is reported
only once for each function
| it appears in.)
|
| When I look at the .c file generated by mprep,
the function _fstrncpy is
| declared as follows:
| #if WIN32_MATHLINK && !defined(_fstrncpy)
| # define _fstrncpy
| #endif
|
| System Information:
| I am running Mathematica on a laptop under
Windows XP. Since I do not have
| Microsoft Visual Studio, I am using cygwin to
write all my code in C.
|
| Please help.
|
| Best regards,
|
| Prabhakar Rao
| --
| M. Prabhakar Rao, Ph.D.
| Department of Mechanical Engineering
| University of Maryland Baltimore County
| http://userpages.umbc.edu/~mrao1
|


 | 
Pages: 1
Prev: mathcode
Next: Limit