[OctDev] MSVC (VS2005) mkoctfile linking problem (DiagMatrix operator *)
Michael Goffioul
michael.goffioul at gmail.com
Fri Aug 22 04:29:56 CDT 2008
On Fri, Aug 22, 2008 at 10:49 AM, Hiroaki Kawashima <memakura at gmail.com> wrote:
> Hi,
>
> I've started using mkoctfile-3.0.1 with MSVC and found that the following
> code could not be linked with octave.lib.
>
> // diagtest.cpp
> #include <iostream>
> #include <octave/oct.h>
> int main()
> {
> DiagMatrix a(2,2, 2.0), b(2,2, 3.0), c;
> c = a*b;
> std::cerr << c << std::endl;
> return 0;
> }
>
> ---- version of octave ----
> octave-3.0.1-setup.exe (windows installer) from sourceforge.net
>
> ---- compilation batch file ----
> call "C:\Program Files\Microsoft Visual Studio 8\VC\vcvarsall.bat"
> "C:\Program Files\Octave\bin\mkoctfile" --link-stand-alone diagtest.cpp -o
> diagtest.exe
>
> ---- error message at linking ----
> diagtest.o : error LNK2019: unresolved external symbol "class DiagMatrix
> __cdecl opera
> tor*(class DiagMatrix const &,class DiagMatrix const &)" (
> ??D at YA?AVDiagMatrix@@A
> BV0 at 0@Z) ...
> I guess the reason might be that ' operator * () ' is not exported since
> 'extern OCTAVE_API'
> is not added to the prototype in dDiagMatrix.h.
> Could someone please give me an advice whether this is bug or just a
> specification of the API?
There's no API specification yet. The reason is simply that the class
is not decorated with OCTAVE_API (the reason being I never needed
it). John, could you consider making the change?
Michael.
More information about the Octave-maintainers
mailing list