Build error on kdelibs

Christian Ehrlicher Ch.Ehrlicher at gmx.de
Wed Apr 11 19:59:38 CEST 2007


Andreas Pakulat schrieb:
> On 11.04.07 19:20:48, Christian Ehrlicher wrote:
>> Andreas Pakulat schrieb:
>>> On 11.04.07 18:56:36, Christian Ehrlicher wrote:
>>>> Andreas Pakulat schrieb:
>>>>> On 11.04.07 18:39:47, Christian Ehrlicher wrote:
>>>>>> Andreas Pakulat schrieb:
>>>>>>> anybody with a hint how to fix this one:
>>>>>>> [  0%] Building CXX object 
>>>>>>> kdecore/CMakeFiles/kdecore.dir/network/netsupp.obj
>>>>>>> In file included from 
>>>>>>> D:\MinGW\sources\kdelibs\kdecore\network\netsupp.cpp:48:
>>>>>>> D:\MinGW\sources\kdelibs\kdecore\network\netsupp.h:294:1: warning: 
>>>>>>> "gai_strerror
>>>>>>> " redefined
>>>>>>> In file included from D:/MinGW/install/include/mingw/sys/socket.h:26,
>>>>>>>               from 
>>>>>>> D:\MinGW\sources\kdelibs\kdecore\network\netsupp.cpp:22:
>>>>>>> D:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/ws2tcpip.h:332:1: 
>>>>>>> warn
>>>>>>> ing: this is the location of the previous definition
>>>>>>> D:\MinGW\sources\kdelibs\kdecore\network\netsupp.cpp:889: error: explicit 
>>>>>>> qualif
>>>>>>> ication in declaration of `char* KDE::gai_strerror(int)'
>>>>>>> mingw32-make[2]: *** [kdecore/CMakeFiles/kdecore.dir/network/netsupp.obj] 
>>>>>>> Error
>>>>>>> 1
>>>>>>> mingw32-make[1]: *** [kdecore/CMakeFiles/kdecore.dir/all] Error 2
>>>>>>> mingw32-make: *** [all] Error 2
>>>>>> Adding
>>>>>> # ifdef gai_strerror
>>>>>> #  undef gai_strerror
>>>>>> # endif
>>>>>>
>>>>>> in netsupp.h around line 270 should work
>>>>> I hoped there would be a way without editing the source, but well, it
>>>>> seems the file does a few other undef's too...
>>>> Yes, that's what netsupp.c is used for :)
>>>>> Should I commit this to kdelibs?
>>>> Yes, please
>>> Ok, it fixes the warning, but unfortunately not the error:
>>> D:\MinGW\sources\kdelibs\kdecore\network\netsupp.cpp:889: error: explicit 
>>> qualification in declaration of `char* KDE::gai_strerror(int)'
>>> mingw32-make[2]: *** [kdecore/CMakeFiles/kdecore.dir/network/netsupp.obj] 
>>> Error
>>> 1
>>> mingw32-make[1]: *** [kdecore/CMakeFiles/kdecore.dir/all] Error 2
>>> mingw32-make: *** [all] Error 2
>> That's because of the definitions in netsupp.h:
>> # define gai_strerror	KDE::gai_strerror
>>
>> -> gai_strerror is replaced by KDE::gai_strerror which is wrong. Holger 
>> Schröder changed this two weeks ago, but it's wrong (see also here: 
>> http://wiki.services.openoffice.org/wiki/Writing_correct_Cplusplus#Extra_Qualification
>>
>> --> remove "namespace KDE {}" around gai_strerror
> 
> I guess I'm missing something, but why is there no problem with the code
> on Linux?
> 
This problem also occours on linux - but only when getaddrinfo (and 
friends) are not available and the netsupp.cpp functions are used then. 
Looks like getaddrinfo is available everywhere and/or the compiler there 
is less strict.

Christian

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 250 bytes
Desc: OpenPGP digital signature
Url : http://mail.kde.org/pipermail/kde-windows/attachments/20070411/6adf7e16/attachment.pgp 


More information about the Kde-windows mailing list