Mathematica Asked by Azzurro94 on July 7, 2021
I tried to run very simple example of connecting to WSTP. I checked a few links in this site but none of them could resolved my issue. I added three .lib files to visual studio location from this link and also linked to my program on visual studio. Also i did it for wstp.h and .exe. each one as explained in documentation
developer tutorial. I modified the linker on C++ project and added all these files to current project on visual studio. But still i am getting this problem. I wish they had better documentation. Can someone help me , thanks
error LNK2019: unresolved external symbol _WSInitialize
error LNK2019: unresolved external symbol _WSDeinitialize
error LNK2019: unresolved external symbol _WSOpenString
error LNK2019: unresolved external symbol _WSClose
#include "wstp.h"
#include<iostream>
using namespace std;
int main()
{
WSENV env;
WSLINK link;
int error;
env = WSInitialize((WSEnvironmentParameter)0);
if (env == (WSENV)0)
{ /* unable to initialize WSTP environment */
}
link = WSOpenString(env, "/usr/local/bin/math -mathlink", &error);
if (link == (WSLINK)0 || error != WSEOK)
{ /* unable to create link to the Kernel */
}
/* ... */
WSClose(link);
WSDeinitialize(env);
return 0;
}
EDITED Solved: beside the right answer, i should have compile as x64 because my system is 64bit, but i ran the program as x86 and got those errors
Those particular linker errors mean that the input library was not added under the linker settings. I put together an example project on GitHub that you can use for reference. The paths are currently setup for the default installation location for Mathematica 12.2.
Correct answer by ihojnicki on July 7, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP