problems building ktorrent with msvc

Christian Ehrlicher Ch.Ehrlicher at gmx.de
Thu Apr 24 15:11:00 CEST 2008


> Von: Carlo
> Hi,
> ktorrents build fine with mingw, so now I'm trying to build it with
> msvc too, but I get this error and I don't know how to fix it
> 
<snip>
> C:\Programmi\Microsoft Visual Studio 8\VC\INCLUDE\vector(565) : error
> C2036: 'pollfd *': dimensione sconosciuta
>         C:\Programmi\Microsoft Visual Studio 8\VC\INCLUDE\vector(550):
> durante la compilazione della classe modello, funzione membro
> 'std::vector<_Ty> &std::vector<_Ty>::operator =(const std::vector<_Ty>
> &)'
>         with
>         [
>             _Ty=pollfd
>         ]
>         c:\kde4\src\ktorrent\libbtcore\peer\authenticationmonitor.h(41):
> vedere il riferimento all'istanza del modello di classe
> 'std::vector<_Ty>' in corso di compilazione
>         with
>         [
>             _Ty=pollfd
>         ]
> C:\Programmi\Microsoft Visual Studio 8\VC\INCLUDE\vector(569) : error
> C2036: 'pollfd *const ': dimensione sconosciuta
> C:\Programmi\Microsoft Visual Studio 8\VC\INCLUDE\vector(578) : error
> C2036: 'pollfd *': dimensione sconosciuta
> 
> since poll exists only in windows vista i've copied an implementation
> of poll that uses select from polipo in ktorrent, and the pollfd
> struct is defined here
>

This has imo nothing to do with your structure in general.
The problem is that in authenticationmonitor.h:44 you define a std::vector (hey, is this a c++ or qt program ? ;) ) and then export the class. Because of this msvc has to instantiate the whole class including the vector member. But due to the forward declaration it's not possible. See also KDE_FULL_TEMPLATE_EXPORT_INSTANTIATION in kdemacros.h .

There're two solutions

1) use a d-ptr to hide it from the compiler at this stage
2) include header where pollfd is defined so the compiler can instantiate it


HTH
Christian
-- 
GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
Jetzt dabei sein: http://www.shortview.de/?mc=sv_ext_mf@gmx


More information about the Kde-windows mailing list