3
$\begingroup$

I recently set about to re-compile some old (2008-2009) applications that use MathLink in preparation for creating new, modified versions. Mathlink has been deprecated but WSTP seems like a fairly painless replacement and I had no trouble getting the code to compile and the project to build under Visual Studio 2013.

Unfortunately, the resulting code doesn't run correctly. Whereas the old code, if double-clicked, did this:

enter image description here

the new one does this

enter image description here

The "missing" DLL is definitely on the drive, and the project would not have compiled without it. Putting an extra copy into the application directory doesn't help.

DependencyWalker reports as follows:

enter image description here

Which seems to restate the problem in other words but doesn't bring me to a solution.

The DLL has been included in the project, but Visual Studio marks it "Does Not Participate in Build," which seems as though it might be a problem but it's not at all obvious what to change it to.

enter image description here

Any suggestions?

$\endgroup$
  • 1
    $\begingroup$ My first intention would be to use the dependency walker on the created executable and see what it shows you about the library that is missing. $\endgroup$ – halirutan Feb 18 '15 at 19:58
  • $\begingroup$ Perhaps you'll find some useful info here: mathematica.stackexchange.com/a/74132/12 I haven't encountered this particular problem you mention. $\endgroup$ – Szabolcs Feb 18 '15 at 20:00
  • $\begingroup$ Also note, "The WSTP dlls are no longer installed in the Windows System32 (SysWOW64) directory. Instead these libraries are contained in the Wolfram System layout." $\endgroup$ – Szabolcs Feb 18 '15 at 20:01
  • $\begingroup$ Finally: you can copy these DLLs next to your application, just make sure you know which one (which version) is needed. I believe they can even be distributed for as long as you abide by the license. $\endgroup$ – Szabolcs Feb 18 '15 at 20:03
  • $\begingroup$ What DependencyWalker shows is unusual. First, did you use the MathLink development kit or the WSTP one? If it's an old program that uses the ML naming convention then you should use the MathLink one and use DLLs named as ml64i3.dll or ml64i4.dll (for interface version 4). Since it's an old program and you might want to ensure compatibility with v9 too, I suggest using interface version 3. $\endgroup$ – Szabolcs Feb 18 '15 at 20:15
4
$\begingroup$

I asked the above question a long time ago and have since successfully written several WSTP programs. I can't say for certain what caused the above problem, but it is likely that I placed the necessary DLL in the source code directory rather than the Debug directory and/or failed to maintain proper path setups for resources in the Visual Studio IDE.

In my current work, I have copied the .lib files into Visual Studio's normal search path, and in the Solution Explorer I include only wstp32i4.lib among the Resource Files. I don't know if including the others causes problems, but it certainly doesn't help.

Also be sure to include wstp.h in the Header Files.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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