Help with standalone program error resoltion: error: 'strcat' undefined.... error encountered in Octave evaluator!

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Help with standalone program error resoltion: error: 'strcat' undefined.... error encountered in Octave evaluator!

ashwin damle
Hello help-octave,

I am facing a problem executing my standalone program. I used embedded.cc from https://octave.org/doc/v4.4.0/Standalone-Programs.html#Standalone-Programs . Instead of calling the function 'gcd' I make a call to 'myfunc'. myfunc is defined as

function [resultString] = myfunc(inString)
resultString = strcat ('Good morning Mr. ', inString);
endfunction

Certainly, the gcd function works. However, myfucn does not. I get 
error: 'strcat' undefined near line 4 column 18
error encountered in Octave evaluator! 

I searched a bit and found similar discussion on the http://octave.1599824.n4.nabble.com/strcat-not-found-MinGW-td3482336.html Reading the thread I understand that this problem is related to path and copying strcat.m to the working directory does solve that error while popping up another 
error: 'common_size' undefined near line 110 column 11
error encountered in Octave evaluator!


Certainly myfunc is from the same thread. That is the thread which gives the temporary solution to get strcat error removed by copying the strcat.m into the working directory. However, it is not practical to copy all m files from my C:\Octave\Octave-4.4.0\share\octave\4.4.0\m to the working directory.

Question is how do I solve this problem? How do I avoid copying .m files and do a sane linking of all .m files functions. 

Attached are the two program sources I am using.

I am using Window 10 version 1803 OS build 17134.112 and GNU Octave, version 4.4.0. When I start Octave it mentions on the command Window Octave was configured for "x86_64-w64-mingw32.

Could you please help me solving this? Let me know if you have questions.

Thank you.
Ashwin Damle



embedded.cc (4K) Download Attachment
myfunc.m (146 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Help with standalone program error resoltion: error: 'strcat' undefined.... error encountered in Octave evaluator!

ashwin damle
Hello,

I could solve my problem by downgrading to Octave 4.0.2.

I have another question. I am using C++ function to call the Octave interpreter and execute commands. The program works well as long as I use the octave functions. However, I get errors when I use a package. I want to use the control package. Attached is the embedded.cc and myfunc.c files I am using. I get errors when loading the package control.

I search around and found that there were solutions posted like


Therefore, I tried loading the package in the embedded.cc using feval ("pkg", ovl ("load", "interval"), 0);. I get errors like





warning: docstring file '\scratch\jwe\mxe-octave\usr\i686-w64-mingw32\share\octave\4.0.2\etc\built-in-docstrings' not found

error: feval: function 'pkg' not found

error: octave_base_value::double_value (): wrong type argument '<unknown type>'

The good thing is that the embedded.cc works on a GNU/Linux Xubuntu system but not on Windows 10 with version 4.0.2. 

Also, want to let you know that the reason I am not using a higher version is because I have object files which are compiled with GCC 4.6.2 and newer version Octave is complaining that the file format is not recognised when I link all object file with the executable. This works on Linux but not on Windows 10.

Could you please help with any advice on how to load a package and execute that in the C++ program? 

Thank you.
Ashwin

On Tue, 3 Jul 2018 at 15:59, ashwin damle <[hidden email]> wrote:
Hello help-octave,

I am facing a problem executing my standalone program. I used embedded.cc from https://octave.org/doc/v4.4.0/Standalone-Programs.html#Standalone-Programs . Instead of calling the function 'gcd' I make a call to 'myfunc'. myfunc is defined as

function [resultString] = myfunc(inString)
resultString = strcat ('Good morning Mr. ', inString);
endfunction

Certainly, the gcd function works. However, myfucn does not. I get 
error: 'strcat' undefined near line 4 column 18
error encountered in Octave evaluator! 

I searched a bit and found similar discussion on the http://octave.1599824.n4.nabble.com/strcat-not-found-MinGW-td3482336.html Reading the thread I understand that this problem is related to path and copying strcat.m to the working directory does solve that error while popping up another 
error: 'common_size' undefined near line 110 column 11
error encountered in Octave evaluator!


Certainly myfunc is from the same thread. That is the thread which gives the temporary solution to get strcat error removed by copying the strcat.m into the working directory. However, it is not practical to copy all m files from my C:\Octave\Octave-4.4.0\share\octave\4.4.0\m to the working directory.

Question is how do I solve this problem? How do I avoid copying .m files and do a sane linking of all .m files functions. 

Attached are the two program sources I am using.

I am using Window 10 version 1803 OS build 17134.112 and GNU Octave, version 4.4.0. When I start Octave it mentions on the command Window Octave was configured for "x86_64-w64-mingw32.

Could you please help me solving this? Let me know if you have questions.

Thank you.
Ashwin Damle


--
Ashwin Damle



embedded.cc (1K) Download Attachment
myfunc.m (238 bytes) Download Attachment