Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>To build a standalone: <a href="http://www.gnu.org/software/octave/doc/interpreter/Standalone-Programs.html#Standalone-Programs" rel="nofollow">http://www.gnu.org/software/octave/doc/interpreter/Standalone-Programs.html#Standalone-Programs</a></p> <p>I have a similar problem, which is to create a .dll for C# I've been looking for a way to do this for a while now, I have not been able to find instructions or an easy way to do it. This is more an ongoing project than a question, but I' d definitely take any answer or help!:) </p> <p>I am planning to keep track of my efforts here, so at the end this should become a page that will allow people to find how to compile octave into a .dll ( always assuming this is possible)</p> <p>So:</p> <p>-I am using VS2010</p> <p>-I started with the MS VS2010 compiled binaries for octave, assuming this will be closer.</p> <p>-I created a project in VS and used the following code:</p> <pre><code>#include &lt;iostream&gt; #include &lt;octave/oct.h&gt; #include &lt;octave/octave.h&gt; #include &lt;octave/parse.h&gt; int main(int argc, char* argv[]) { std::cout&lt;&lt;"hello world"&lt;&lt;std::endl; char a[900]; std::cin&gt;&gt;a; return 0; } </code></pre> <p>-The code would of course not find the octave libs, so I added them, e.g.,</p> <pre><code>C:\Octave\Octave-3.6.1-VS10\lib\octave\3.6.1;C:\Octave\Octave-3.6.1-VS10\include\octave-3.6.1;C:\Octave\Octave-3.6.1-VS10\include;$(VCInstallDir)include;... </code></pre> <p>To Include Directories (Right click on Project-->Properties)</p> <p>Now I get</p> <pre><code>Error 73 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) ...\Projects\cppap32\cppap32\main.obj cppap32 </code></pre> <p>which basically means it cannot find octave_value... By using dumpbin.exe we can see that it needs to have both octave.lib AND octinterp.lib</p> <p>It now does compile.... :) </p> <p>Next step create a .dll ...</p> <p>Notes:</p> <p>To check what is exported by a .lib:</p> <pre><code>dumpbin.exe /exports C:\Octave\Octave-3.6.1-VS10\lib\octave\3.6.1\octave.lib </code></pre> <p>Relevant links:</p> <p>Similar, open question on other site: <a href="http://www.daniweb.com/software-development/cpp/threads/297336/gnu-octave-for-c-how-to-start" rel="nofollow">http://www.daniweb.com/software-development/cpp/threads/297336/gnu-octave-for-c-how-to-start</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload