[OctDev] MSVC (VS2005) mkoctfile linking problem (DiagMatrix operator *)

Hiroaki Kawashima kawashima at i.kyoto-u.ac.jp
Sat Aug 23 19:22:19 CDT 2008


Michael, thank you very much for your comment. 
John, I would really appreciate if you could make the 
change when you get a chance as I often 
use the operator.

Thanks,
Hiro


On Fri, 22 Aug 2008 11:29:56 +0200
"Michael Goffioul" <michael.goffioul at gmail.com> wrote:

> 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