help-octave
[Top][All Lists]
Advanced

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

Re: mkoctfile and C


From: Laurent Hoeltgen
Subject: Re: mkoctfile and C
Date: Mon, 21 Feb 2011 16:38:03 +0100

On Mon, 2011-02-21 at 08:39 -0600, Jordi Gutiérrez Hermoso wrote:
> On 21 February 2011 03:46, Laurent Hoeltgen <address@hidden> wrote:
> > I was wondering if there is some magic behind compiling C code with
> > mkoctfile. On the octave webpages, there's this short example written in
> > C++ which compiles fine for me. However, I can't get anything to run
> > once it's in plain C.
> 
> The Octave headers are in C++, so you can't #include them from files
> that are intended to be C, which is a different language. The errors
> you are seeing are what happens when a C compiler sees C++ code in
> oct.h.
> 
> You could write C wrappers for the Octave headers, if you want to do the work.
> 
> - Jordi G. H.

Thanks for the info. But in that case, I think the text at
http://www.gnu.org/software/octave/doc/interpreter/Getting-Started-with-Oct_002dFiles.html
 is a bit misleading, because there it says in the first sentence:

"The mkoctfile function compiles source code written in C, C++, or
Fortran."

and a few paragraphs later you get told that you need the octave header
files.

Regards,
Laurent

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

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