fix linking of kdecore

Sebastian Sauer mail at dipe.org
Sun Oct 22 14:56:14 CEST 2006


Hi,

and hours after hours of testing I would suggest following change in 
kdelibs\cmake\modules\FindKDEWIN32.cmake

- # add the winsock2 library
- #find_library(WIN32_LIBC_LIBRARY NAMES msvcrt PATHS $ENV{WINDIR}/system32)
- #find_library(WIN32_USER32_LIBRARY NAMES user32 PATHS $ENV{WINDIR}/system32)
- #find_library(WIN32_SHELL32_LIBRARY NAMES shell32 PATHS 
$ENV{WINDIR}/system32)
- #find_library(WIN32_WS_LIBRARY NAMES wsock32 PATHS $ENV{WINDIR}/system32)
- #find_library(WIN32_WS2_LIBRARY NAMES ws2_32 PATHS $ENV{WINDIR}/system32)
- #set(KDEWIN32_LIBRARIES ${KDEWIN32_LIBRARY} ${WIN32_WS_LIBRARY} 
${WIN32_LIBC_LIBRARY} ${WIN32_USER32_LIBRARY} ${WIN32_SHELL32_LIBRARY} 
${WIN32_WS2_LIBRARY})

+ set(KDEWIN32_LIBRARIES ${KDEWIN32_LIBRARY} msvcrt ws2_32 user32 shell32)

This fixes two problems.

1) KDEWIN32_LIBRARIES is currently undefined while it should be defined at 
least with something like 
set(KDEWIN32_LIBRARIES ${KDEWIN32_LIBRARY})

2) At least here linking of kdecore fails cause of missing libraries that are 
at least here not automaticly added. The missing libs are msvcrt which seems 
to be the libc-solution on Windows and provides basic functionality like e.g. 
strcpy. Without that lib I keep to get "undefined reference to 'strcpy'" 
errors on linking. The ws2_32 lib (winsock2) which contains things like 
gethostbyproto and user32 which has things like getuid. I don't know if 
shell32 is really needed, but since it was defined there as well before my 
first commit, I would suggest to have it in there again too.

p.s. as you may note the above says
set(KDEWIN32_LIBRARIES ${KDEWIN32_LIBRARY} msvcrt ws2_32 user32 shell32)
and not
set(KDEWIN32_LIBRARIES "${KDEWIN32_LIBRARY} msvcrt ws2_32 user32 shell32")
(with quotes). IIRC is should have quotes and before it breaked for me cause 
it did not have them. I tried it now on another fresh system and there it 
compiles even without the quotes. hmmm... So, it can't be a caching-issue 
what is even more confusing.

Anyway. Commit? More testing? Feedback! :)

-- 
Sebastian Sauer aka dipesh[sebsauer]
http://www.dipe.org/public_key.asc
Fingerprint: 8F1E 219B 16E6 4EC7 29CC F408 E193 65E2 9134 2221
Coder in http://www.koffice.org && http://www.kmldonkey.org



More information about the Kde-windows mailing list