[Top][All Lists]

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

Statically linking Octave to C++ program

From: mark8
Subject: Statically linking Octave to C++ program
Date: Sat, 12 Sep 2009 13:08:23 -0700 (PDT)

I need to statically link the Octave library within a C++ program so that it
can be used on a distributed grid. For other libraries, I have made symlinks
with altered names to the static library (such as libgsl-s.a for the gsl
library) in the same library directory, and then compile with, for example,

This works fine for any other library except Octave. With Octave, I can
#include<octave/oct.h> and of course it links in fine so long as I don't
call any octave functions. As soon as I try to declare an octave object
(such as Matrix m(2,2);), I get hundreds of lines of "undefined symbols"
followed by 
ld: symbol(s) not found

Right now, I'm working with not much more than a "Hello World" program. It
is fine if I use -loctave but not if I use -loctave-s where liboctave-s.a is
a symlink to liboctave.a.
I've also tried to use the -static compiler flag
I do have the static libraries octave-3.2.2/liboctave.a (and libcruft.a and

Other details:
I'm using octave 3.2.2 on Mac OSX 10.5
Octave obtained via macports (but I've also built it myself with no
Compiler: gcc 4.0.1 (but other versions give the same result)

Is it possible to do this static linking? If so, can anyone suggest how?
Thank you very much,

View this message in context:
Sent from the Octave - General mailing list archive at

reply via email to

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