[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
QT - undefined reference to feval
From: |
alexegin |
Subject: |
QT - undefined reference to feval |
Date: |
Thu, 25 May 2017 00:16:22 -0700 (PDT) |
Hi all.I am trying to run an example from Octave docs
<http://www.gnu.org/software/octave/doc/interpreter/Standalone-Programs.html>
using Qt Creator on Windows.Here is *.pro* file:
TEMPLATE = appCONFIG += console c++11CONFIG -= app_bundleCONFIG -= qtSOURCES
+= main.cppunix|win32: LIBS += -LC:/Octave/Octave-4.2.1/lib/octave/4.2.1/
-lliboctave.dllunix|win32: LIBS +=
-LC:/Octave/Octave-4.2.1/lib/octave/4.2.1/ -lliboctinterp.dllINCLUDEPATH +=
C:/Octave/Octave-4.2.1/include/octave-4.2.1INCLUDEPATH +=
C:/Octave/Octave-4.2.1/include/octave-4.2.1/octaveDEPENDPATH +=
C:/Octave/Octave-4.2.1/include/octave-4.2.1DEPENDPATH +=
C:/Octave/Octave-4.2.1/bin
And *.cpp* file:
#include #include <octave/oct.h>#include <octave/octave.h>#include
<octave/parse.h>#include <octave/interpreter.h>int main( void ){
string_vector argv( 2 ); argv( 0 ) = "embedded"; argv( 1 ) = "-q";
octave_main( 2, argv.c_str_vec (), 1 ); octave_idx_type n = 2;
octave_value_list in; for ( octave_idx_type i = 0; i < n; i++ )
in( i ) = octave_value ( 5 * ( i + 2 ) ); octave_value_list out = feval(
"gcd", in, 1 ); if ( out.length () > 0 ) std::cout << "GCD of ["
<< in( 0 ).int_value() << ", " << in( 1
).int_value() << "] is " << out( 0 ).int_value()
<< std::endl; else std::cout << "invalid\n"; clean_up_and_exit(
0 );}
But I have the following errors from compiler:
undefined reference to feval(std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator > const&, octave_value_list
const&, int)undefined reference to Array<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator > >::nil_rep()undefined reference
to Array<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator > >::resize_fill_value() constundefined reference to
Array<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator > >::resize_fill_value() const
But when I Ctrl+Click on feval function in Qt Creator - it opens the
appropriate file.I also can use mkoctfile from Octave GUI - it runs without
any problem.What am I doing wrong? Thank you very much in advance.
--
View this message in context:
http://octave.1599824.n4.nabble.com/QT-undefined-reference-to-feval-tp4683465.html
Sent from the Octave - General mailing list archive at Nabble.com.