I am trying to compile the codes in C++ using WSTP in Windows OS. The code can be compiled however it requires me to create a link.

enter image description here

I have tried options like placing the necessary dll in the source code directory, included wstp32i4.lib in the Resouce Files and wstp.h in the Header Files.

Have I missed some steps or are there any other possible solutions?

  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$
    – Michael E2
    Aug 11, 2016 at 3:09
  • $\begingroup$ Could you tell the steps you are following to compile the code? $\endgroup$
    – dsingh
    Aug 11, 2016 at 14:47
  • 2
    $\begingroup$ You would get the same behavior by launching one of the prebuilt examples, like addtwo.exe, since it is meant to be used via Install which takes care of establishing the link. $\endgroup$
    – ilian
    Aug 11, 2016 at 17:07

1 Answer 1


This is normal behaviour for installable MathLink programs. Instead of running them directly, use them with Install.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.