3
$\begingroup$

Can LINK addtwo.obj addtwotm.obj wstp64i4.lib /OUT:addtwo.exe actually work with Visual Studio 2019 tools, if so how?

My setup is as I reported in this question: https://mathematica.stackexchange.com/questions/232846/where-to-place-the-essential-wstp-files-in-visual-studio-2019/232955#232955

I am out of my depth here:

LINK addtwo.obj addtwotm.obj wstp64i4.lib /OUT:addtwo.exe

Microsoft (R) Incremental Linker Version 14.25.28614.0
Copyright (C) Microsoft Corporation.  All rights reserved.

addtwotm.obj : error LNK2019: unresolved external symbol __imp_TranslateMessage referenced in function WSDefaultYielder
addtwotm.obj : error LNK2019: unresolved external symbol __imp_DispatchMessageA referenced in function WSDefaultYielder

( Several more ... )

addtwo.exe : fatal error LNK1120: 12 unresolved externals

If LINK addtwo.obj addtwotm.obj wstp64i4.lib /OUT:addtwo.exe works with the Visual Studio 2019 tools please show me the proof, so that I can keep working on this.

I am currently at the decision point of installing Visual Studio 2012(!) because at least the documentation seems to be up-to-date with that version.

Note that I am working on starting up an open source project adding full Pari/GP functionality to Mathematica. Should this be done with VS 2012 tools?? Or: should I use MathLink?

Perhaps Wolfram is a 100% Mac shop, ignoring the majority of computer users.

$\endgroup$
2
  • 1
    $\begingroup$ The several more are really important. But that link line should include kernel32.lib user32.lib gdi32.lib. $\endgroup$
    – ihojnicki
    Commented Oct 20, 2020 at 11:32
  • $\begingroup$ Have done that before. Does it work on your system? If so, what is your config? $\endgroup$ Commented Oct 20, 2020 at 11:47

1 Answer 1

2
$\begingroup$

My "solution" is, finally, the following. Do not waste your time trying to get Mathematica WSTP working with Visual Studio 2019. It does not work. ( Sadly, nobody proved otherwise. )

I installed Microsoft Visual Studio 11 2012(!) which lines up with the documentation provided with Mathemathica 12.1, and, as expected, I was able to produce addtwo.exe.

$\endgroup$
2
  • $\begingroup$ I could connect VS 2019 to mathematica kernel and works fine, what is your problem? $\endgroup$
    – Azzurro94
    Commented Mar 24, 2021 at 17:00
  • $\begingroup$ Lucky you. If only you said that last October. :-) - Since then I dumped VS, used a simple, open source, c IDE, called geany and finished the work I had to do in C. Thanks for your reply. $\endgroup$ Commented Mar 24, 2021 at 17:54

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.