help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

strcat not found--MinGW


From: Daryl Lee
Subject: strcat not found--MinGW
Date: Thu, 28 Apr 2011 15:44:49 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9

I'm trying to embed my Octave function into a C++ program, using MinGW/MSYS on a Windows 7 machine. Here's the Octave function (example2.m):

function [resultString] = example2(inString)
    resultString = strcat ('Good morning, ', inString);
end

And when I run it from the Octave prompt it works as expected. Now I create a stand-alone program (test2.cpp) to call it:

#include <iostream>
#include <octave/oct.h>
#include <octave/octave.h>
#include <octave/parse.h>
#include <octave/toplev.h>

int main()
{
    string_vector argv(2);
    argv(0) = "test2";
    argv(1) = "-q";
    octave_main(2, argv.c_str_vec(), 1);

    octave_value_list in;
    in(0) = "Hero";

    octave_value_list out = feval("example2", in);

    std::cout << out(0).string_value() << std::endl;

    return 0;
}

I build this with

$ mkoctfile --link-stand-alone test2.cpp -o test2

and when I run test2, the program fails with "strcat undefined" on line 2 of the Octave function. It works fine on my Linux/Ubuntu box.

What do I need to do to get such functions defined?

--
Daryl Lee


reply via email to

[Prev in Thread] Current Thread [Next in Thread]