0

Is it possible to embed Octave in a C++ program compiled with Visual Studio 2017?

(Something like How to embed the GNU Octave in C/C++ program?)

Octave Windows binaries are compiled with MinGW, so its libraries can't be linked with Visual Studio linker.

Enrico Detoma
  • 3,159
  • 3
  • 37
  • 53
  • 1
    The simple solution is that you can create an octave process so it can evaluate a string or run a file. However if you need to call its internal API you can use its C [mex interface](https://stackoverflow.com/questions/56176203/call-gnu-octave-functions-in-c). Nearly all the functions that begins with mx or mex that are included in liboctinterp-X.dll can be used. But you need to create a def file and make an [import library](https://stackoverflow.com/questions/2529770/how-to-use-libraries-compiled-with-mingw-in-msvc) for the needed functions. – rahnema1 Jun 17 '19 at 07:04
  • Thank you very much for the information about the mex interface. You could make an answer instead of a comment, so I can flag it as the corrent answer. – Enrico Detoma Jun 17 '19 at 10:23
  • 1
    Unfortunately I currently don't have an access to msvc to provide a full answer. Regarding the informations if you could provide a more complete answer I will upvote! – rahnema1 Jun 17 '19 at 12:09
  • 1
    and always keep in mind that you have to release your code also under GPLv2 if you link against GNU Octave – Andy Jun 18 '19 at 18:49

0 Answers0