Group Abstract Group Abstract

Message Boards Message Boards

0
|
11.4K Views
|
11 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Issues with WSTP

Posted 9 years ago
11 Replies

Oh, sorry didn't see the commands you inputted. For the path, I checked already. It works on my machine too. Thank you.

How did you compile the file?

By typing make but you can see the exact 4 commands it ran in my post. The contents of f.c and f.tm were taken from above.

Another thing you may want to check is the exact path to WSTP on your system, in particular whether it has Contents/SystemFiles/Links in it or just SystemFiles/Links (for me with version 10.0 it was the latter).

POSTED BY: Ilian Gachevski

I included -stdlib=libstdc++ but it didn't seem to work. How did you compile the file?

POSTED BY: Ilian Gachevski
Posted 9 years ago

What about adding -std=c++11 into the command?

POSTED BY: Shujie CHEN

Right now my make file is giving the following error:

Undefined symbols for architecture x86_64:
  "_WSMain", referenced from:
      _main in f.o
ld: symbol(s) not found for architecture x86_64

So I've been compiling executing the different commands in the make file. The -stdlib=libstdc++ is the EXTRA_CFLAGS which appears only in the second command. The error I showed earlier comes from the first command:

cc -I/Applications/Mathematica.app/Contents/SystemFiles/Links/WSTP/DeveloperKit/MacOSX-x86-64/CompilerAdditions ftm.o f.o -L/Applications/Mathematica.app/Contents/SystemFiles/Links/WSTP/DeveloperKit/MacOSX-x86-64/CompilerAdditions -lWSTPi4 -ls tdc++ -framework Foundation -o f

Do both -stdlib=libstdc++ and -lstdc++ appear on your linker command line?

POSTED BY: Ilian Gachevski

I just made that adjustment and get an error that starts like this:

Undefined symbols for architecture x86_64:
  "std::__basic_file<char>::is_open() const", referenced from:
      WSTP::MLLog::logSelectorToFileWithName(WSTP::mllogselector, char const*) in libWSTPi4.a(mllog.cpp.o)
  "std::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::str() const", referenced from:
      mlopen_argv(ws_environment*, long, char**, void*, void*, int*) in libWSTPi4.a(mlopen.c.o)
      WSTP::MLLog::~MLLog() in libWSTPi4.a(mllog.cpp.o)
  "std::basic_ios<char, std::char_traits<char> >::widen(char) const", referenced from:
      feature_greeting(ws_environment*, WSLink*, device_kebab*, _queue*, feature_set*) in libWSTPi4.a(mlgreet.c.o)
      WSTP::MLExceptionMessage::print(std::ostream&) const in libWSTPi4.a(mlexceptions.cpp.o)
      WSTP::initSyncObjectDir() in libWSTPi4.a(mlplatformthreads.cpp.o)
      WSTP::MLLog::~MLLog() in libWSTPi4.a(mllog.cpp.o)
      WSTP::MLLog::operator()(WSTP::mllogselector) in libWSTPi4.a(mllog.cpp.o)
      WSTP::MLExprLog::writeContentsToStreams(WSTP::MLExprLog::mllogdirection&, bool, std::basic_ostringstream<char, std::char_traits<char>, WSTP::MLStdAllocator<char> >&) in libWSTPi4.a(mlexprlog.cpp.o)
      WSTP::MLInterfaceContainer::PrintInterfaceContainer(std::ostream&) const in libWSTPi4.a(mlinterface.cpp.o)
      ...

It may be the same exact one I had earlier

Prior to version 10.4, use -lstdc++ in EXTRA_LIBS to link against libstdc++ instead of libc++

(there is also an alternative set of WSTP libraries supplied if you wish to use the libc++ standard library instead).

POSTED BY: Ilian Gachevski

Are you on OS X? Which version of Mathematica are you using?

You may need -stdlib=libstdc++ but that's difficult to say without the above information and the actual Makefile.

POSTED BY: Ilian Gachevski
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard