Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'MathLink' topicStudent Support Forum > General > "MathLink"

Next Comment >Help | Reply To Topic
Author Comment/Response
Ryan Tibshirani
03/20/05 05:38am

Hello -

I am trying to use Mathlink for the first time, and am just trying to get some basic C++ code to work. Here is my code:

#include "mathlink.h"

int main(int argc, char *argv[])
{
   MLENV env;
   MLINK link;
   long errno;

   env = MLInitialize(0);
   link = MLOpenArgv(env, argv, argv+argc, &errno);
   MLActivate(link);

...

which is exactly as the Mathlink documentation says to do in the Mathematica Help Browswer. However when I compile (I'm using Microsoft Visual C++) I get the following errors:

Compiling...
smoothContour.cpp
Linking...
smoothContour.obj : error LNK2019: unresolved external symbol _MLConnect@4 referenced in function _main
smoothContour.obj : error LNK2019: unresolved external symbol _MLOpenArgv@16 referenced in function _main
smoothContour.obj : error LNK2019: unresolved external symbol _MLInitialize@4 referenced in function _main
Debug/smoothContour.exe : fatal error LNK1120: 3 unresolved externals

Can anybody please tell me how I can get this to compile and work properly? Thanks.

Ryan Tibshirani
---------------
Stanford University Class of 2007

URL: ,

Subject (listing for 'MathLink')
Author Date Posted
MathLink Ryan Tibshir... 03/20/05 05:38am
Re: MathLink Lawson English 04/04/05 08:05am
Next Comment >Help | Reply To Topic