[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "Hello World" mex file: failed
From: |
Steve C. Thompson |
Subject: |
Re: "Hello World" mex file: failed |
Date: |
Fri, 30 Mar 2007 15:21:05 -0700 |
Oh man! I just got an email from David Bateman. It turns out my
problem with "Hello, world" is trivial:
mkoctfile-2.9.10 -o hello.oct --mex hello.c
doesn't work, but
mkoctfile-2.9.10 -o hello.mex --mex hello.c
does. (The reason I had .oct was from a script I saw from
David---strange.)
Onward and upward.
Steve
On Fri, 2007-03-30 at 12:35 -0700, Steve Thompson wrote:
> Dear Group,
>
> I've compiled the "Hello World" mex file from
> http://www.mathworks.com/support/tech-notes/1600/1605.html#example1
>
> Here's what I get:
>
> $ cat hello.c
> #include "mex.h"
> void mexFunction(int nlhs, mxArray *plhs[],
> int nrhs, const mxArray *prhs[]) {
> mexPrintf("Hello, world!\n");
> }
>
> $ mkoctfile-2.9.10 -o hello.oct --mex hello.c
>
> $ ls
> ...
> -rw-r--r-- 1 ... ... 137 2007-03-30 12:06 hello.c
> -rw-r--r-- 1 ... ... 3.1K 2007-03-30 12:14 hello.o
> -rwxr-xr-x 1 ... ... 7.0K 2007-03-30 12:14 hello.oct
> ...
>
> $ octave-2.9.10
>
> octave-2.9.10:1> hello
> error: `hello' undefined near line 1 column 1
> octave-2.9.10:1> addpath ('./')
> octave-2.9.10:2> hello
> error: `hello' undefined near line 2 column 1
>
> Why could this be?
>
> Thanks.
>
> Steve