Compilation problem MSVC with recent 'sort' implementation
Michael Goffioul
michael.goffioul at gmail.com
Sun Feb 3 06:44:55 CST 2008
On 2/3/08, John W. Eaton <jwe at bevo.che.wisc.edu> wrote:
> Since the Range class is not used directly in Array.cc, I don't see
> why it needs to be included there. I've removed the #include
> statement.
Unfortunately, this is not enough to make it compilable with
MSVC. At link stage of liboctave, I get duplicated symbols
error (see below). This seems logical to me to have duplicated
symbols as Array-C.cc includes Array.cc and that the assign
instantiation also instantiates Array<double>. However, as
Array-d.cc also perform explicit specialization, I guess the
compiler cannot determine which one it has to export in the
DLL (I also wonder how gcc resolves this).
I don't know how to handle this.
Michael.
Array-d.o : error LNK2005: "bool __cdecl
ascending_compare<double>(double,double)"
(??$ascending_compare at N@@YA_NNN at Z) already defined in Array-C.o
Array-d.o : error LNK2005: "bool __cdecl
ascending_compare<double>(class vec_index<double> *,class
vec_index<double> *)"
(??$ascending_compare at N@@YA_NPAV?$vec_index at N@@0 at Z) already defined in
Array-C.o
Array-d.o : error LNK2005: "bool __cdecl
descending_compare<double>(double,double)"
(??$descending_compare at N@@YA_NNN at Z) already defined in Array-C.o
Array-d.o : error LNK2005: "bool __cdecl
descending_compare<double>(class vec_index<double> *,class
vec_index<double> *)"
(??$descending_compare at N@@YA_NPAV?$vec_index at N@@0 at Z) already defined
in Array-C.o
Array-d.o : error LNK2005: "public: class Array<double> __thiscall
Array<double>::sort(int,enum sortmode)const "
(?sort@?$Array at N@@QBE?AV1 at HW4sortmode@@@Z) already defined in
Array-C.o
Array-d.o : error LNK2005: "public: class Array<double> __thiscall
Array<double>::sort(class Array<int> &,int,enum sortmode)const "
(?sort@?$Array at N@@QBE?AV1 at AAV?$Array at H@@HW4sortmode@@@Z) already
defined in Array-C.o
More information about the Octave-maintainers
mailing list