help-octave
[Top][All Lists]
Advanced

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

Re: call octave from C++ - linker error


From: Juan Pablo Carbajal
Subject: Re: call octave from C++ - linker error
Date: Fri, 4 Nov 2011 12:35:33 +0100

On Fri, Nov 4, 2011 at 11:59 AM, Miklos Espak <address@hidden> wrote:
> Hi all,
> now I compiled and installed the latest stable Octave (3.4.3) from sources.
> Then I tried to compile the simple test with the following command:
> g++ -I /usr/local/include/octave-3.4.3 -L/usr/local/lib/octave/3.4.3/
> -loctave -loctinterp -lcruft -ooctave_test octave_test.cc
> I get this error from the linker:
> /tmp/ccKIAjJB.o: In function `main':
> octave_test.cc:(.text+0x3b): undefined reference to `octave_main'
> octave_test.cc:(.text+0x5b): undefined reference to
> `octave_value::octave_value(int)'
> octave_test.cc:(.text+0xa0): undefined reference to
> `octave_value::octave_value(char const*, char)'
> octave_test.cc:(.text+0x1b5): undefined reference to
> `MatrixType::MatrixType()'
> octave_test.cc:(.text+0x1d2): undefined reference to
> `octave_value::octave_value(Matrix const&, MatrixType const&)'
> octave_test.cc:(.text+0x210): undefined reference to
> `MatrixType::~MatrixType()'
> octave_test.cc:(.text+0x250): undefined reference to
> `feval(std::basic_string<char, std::char_traits<char>, std::allocator<char>
>> const&, octave_value_list const&, int)'
> octave_test.cc:(.text+0x36e): undefined reference to
> `operator<<(std::basic_ostream<char, std::char_traits<char> >&, Matrix
> const&)'
> octave_test.cc:(.text+0x382): undefined reference to `do_octave_atexit()'
> octave_test.cc:(.text+0x409): undefined reference to
> `MatrixType::~MatrixType()'
> /tmp/ccKIAjJB.o: In function `octave_base_value::octave_base_value()':
> octave_test.cc:(.text._ZN17octave_base_valueC2Ev[_ZN17octave_base_valueC5Ev]+0x13):
> undefined reference to `vtable for octave_base_value'
> /tmp/ccKIAjJB.o: In function `octave_base_value::~octave_base_value()':
> octave_test.cc:(.text._ZN17octave_base_valueD2Ev[_ZN17octave_base_valueD5Ev]+0x13):
> undefined reference to `vtable for octave_base_value'
> /tmp/ccKIAjJB.o: In function `octave_value_list::resize(int, octave_value
> const&)':
> octave_test.cc:(.text._ZN17octave_value_list6resizeEiRK12octave_value[octave_value_list::resize(int,
> octave_value const&)]+0x3b): undefined reference to
> `Array<octave_value>::resize(dim_vector const&, octave_value const&)'
> /tmp/ccKIAjJB.o: In function `octave_value_list::elem(int)':
> octave_test.cc:(.text._ZN17octave_value_list4elemEi[octave_value_list::elem(int)]+0x26):
> undefined reference to `Array<octave_value>::resize_fill_value()'
> /tmp/ccKIAjJB.o: In function `Array<double>::Array(dim_vector const&)':
> octave_test.cc:(.text._ZN5ArrayIdEC2ERK10dim_vector[_ZN5ArrayIdEC5ERK10dim_vector]+0x2e):
> undefined reference to `dim_vector::safe_numel() const'
> collect2: ld returned 1 exit status
>
> The library is there and it contains the required symbols:
> address@hidden:~/src/octave-test$ file
> /usr/local/lib/octave/3.4.3/liboctinterp.so.0.0.0
> /usr/local/lib/octave/3.4.3/liboctinterp.so.0.0.0: ELF 64-bit LSB shared
> object, x86-64, version 1 (GNU/Linux), dynamically linked, not stripped
> address@hidden:~/src/octave-test$ strings
> /usr/local/lib/octave/3.4.3/liboctinterp.so.0.0.0 | grep octave_main
> octave_main
> What options I have to add?
> Does anybody know how to get it working?
> Thanks,
> Miklos
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://mailman.cae.wisc.edu/listinfo/help-octave
>
>

Shouldn't you compile with

mkoctfile

?

-- 
M. Sc. Juan Pablo Carbajal
-----
PhD Student
University of Z├╝rich
http://ailab.ifi.uzh.ch/carbajal/


reply via email to

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