help-octave
[Top][All Lists]
Advanced

[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)

Hi,
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,
-lgsl-s. 

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
liboctinterp.a)

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
differences)
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,
Mark


-- 
View this message in context: 
http://www.nabble.com/Statically-linking-Octave-to-C%2B%2B-program-tp25417085p25417085.html
Sent from the Octave - General mailing list archive at Nabble.com.



reply via email to

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