c++ - Use Octave in msvc 2010 -


i using octave within msvc 2010. first downloaded octave latest version @ link. after installing, tried run simple code:

#include <iostream> #include<octave-3.6.4\octave\oct.h> #include<octave-3.6.4\octave\config.h> #include<octave-3.6.4\octave\octave.h>  using namespace std;   int main (void) {   std::cout << "hello octave world!\n";       system("pause");   return 0;   } 

note added these links project well:

  1. c:\software\octave-3.6.4\include\octave-3.6.4\octave--->includ. dir.,
  2. c:\software\octave-3.6.4\include--->includ. dir.
  3. c:\software\octave-3.6.4\lib--->lib. dir.
  4. c:\software\octave-3.6.4\lib\octave\3.6.4--->lib dir.
  5. i added 1 , 2 additional inc dir!!
  6. c:\software\octave-3.6.4\lib\octave\3.6.4--->additional lib. dir in linker.

first, got error cannot find math.h in program files while file in program files (x86). so, changed to: c:\program files (x86)\microsoft visual studio 10.0\vc\include\math.h , solved error. however, error:

error lnk2019: unresolved external symbol "__declspec(dllimport) public: __thiscall octave_value::~octave_value(void)" (__imp_??1octave_value@@qae@xz) referenced in function "public: void * __thiscall octave_value::`vector deleting destructor'(unsigned int)" (??_eoctave_value@@qaepaxi@z) 

it not sufficient add library path project.

you have add library name(s) (including .lib) "additional dependencies" in linker/input tab.

edit

to verify library has been searched can enable linker/general/show progress option. can see in build output library has used in symbol search.

edit

your example code doesn't show instance of array of octave_value instances. it's bit surprising need link library code you've shown. anyway want have these externals resolved.

if there no other resource (manual, ...) should detect octave_value class implemented. can static library or dll.

you can detect dll implementation dumpbin /exports on dlls. in case need corresponding import libraries. lib should have same base name dll. verify have added dependency , how linker searches library symbols.

the name of symbols __imp_??1octave_value@@qae@xz indicates should in dll. since have problem might want search libs too. can detect lib implementation dumpbin /symbols. in case have add lib directly. again verify build output.

the dumpbin output verbose. should use either findstr limit output or redirect output file , search symbols editor of choice.

search ocatave_value. if find different decoration of constructor , destructor might have missed set option. preprocessore directory used define how library use. e.g. if find octave_value::octave_value without __imp_ prefix have accidentily compiled dll version altough class implemented in static library. in case, read manual , ask @ octave mailing list forum or whatever.


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -