|
From: | Jeriel Jammullamudy |
Subject: | How can I run an Octave (.m) file from C++ written in Qt? |
Date: | Wed, 3 Aug 2022 16:44:07 -0500 |
My goal is to run an Octave file (an original .m script) from C++ written in Qt.
Currently, I am using Octave v7.1.0 on Windows 10, and the C++17 code is written in the Qt IDE v7.0.2. Additionally, my Build Environment has been edited to include mkoctfile.exe for compiling purposes.
I have followed the descriptions found from the Octave user manual in working with standalone programs, found here: Standalone Programs. I can get the first matrix example problem working fine as shown with the following designed output,
11:51:02: Starting C:\Users\berg\Documents\build-ForgeOctave-Desktop_Qt_6_3_1_MinGW_64_bit-Debug\debug\ForgeOctave.exe...
FTH: (2596): *** Fault tolerant heap shim applied to current process. This is usually due to previous crashes. ***
Hello Octave world!
11 12
21 22
11:51:02: C:\Users\berg\Documents\build-ForgeOctave-Desktop_Qt_6_3_1_MinGW_64_bit-Debug\debug\ForgeOctave.exe exited with code 0
however the second example that requires the octave interpreter (which is needed for calling external Octave .m files per Standalone Programs) crashes with the following output:
11:54:52: Starting C:\Users\berg\Documents\build-ForgeOctave-Desktop_Qt_6_3_1_MinGW_64_bit-Debug\debug\ForgeOctave.exe... FTH: (11156): *** Fault tolerant heap shim applied to current process. This is usually due to previous crashes. *** error: ignoring const execution_exception& while preparing to exit error: ignoring const execution_exception& while preparing to exit error encountered in Octave evaluator! 11:54:53: C:\Users\berg\Documents\build-ForgeOctave-Desktop_Qt_6_3_1_MinGW_64_bit-Debug\debug\ForgeOctave.exe exited with code 0
This leads me to believe that my issue is IDE-related. The exact issue that I am having at the moment, is when I call the Octave interpreter (octave::interpreter), it simply returns an error message of a crash.
My suspicion is that I may be missing a link to needed libraries or need to further edit my Build Environment or Build Steps.
Below is my .pro file.
TEMPLATE = app CONFIG += console c++17 CONFIG -= app_bundle CONFIG += qt LIBS+= -L C:\Users\berg\Desktop\Octave\octave-7.1.0-w64\mingw64\bin -loctave-9 -LC:\Users\berg\Desktop\Octave\octave-7.1.0-w64\mingw64\lib\octave\7.1.0 -loctinterp -loctave SOURCES += \ main.cpp INCLUDEPATH += C:\Octave-7.1.0\mingw64\include\octave-7.1.0\octave libmatrix.a
Does anyone have any idea how to solve this Octave interpreter problem or have suggestions? Thanks!
[Prev in Thread] | Current Thread | [Next in Thread] |