kdelibs compile error
Ralf Habacker
ralf.habacker at freenet.de
Tue Aug 5 11:22:51 CEST 2008
Alexander Neundorf schrieb:
> On Monday 04 August 2008, Ralf Habacker wrote:
>
>> Patrick Spendrin schrieb:
>>
>>> Ralf Habacker schrieb:
>>>
>>>> Hi,
>>>>
>>>> with recent svn source code (tested with cmake 2.6.0 and 2.6.1) I got
>>>> linker errors:
>>>>
>>>>
>>>> Scanning dependencies of target kde4-config
>>>> Linking CXX executable ..\bin\kde4-config.exe
>>>> LINK : fatal error LNK1104: cannot open file 'optimized.lib'
>>>> LINK Pass 1 failed. with 2
>>>>
>>>> A look into the related build.cmake shows that the term
>>>> optimized;E:/daten/kde/emerge-msvc-root/lib/kdewin32.lib;debug;E:/daten/
>>>> kde/emerge-msvc-root/lib/kdewin32d.lib from the CMakeCache.txt are
>>>> evaluated into
>>>>
>>>> optimized.lib
>>>> E:\daten\kde\emerge-msvc-root\lib\kdewin32.lib
>>>> debug.lib
>>>> E:\daten\kde\emerge-msvc-root\lib\kdewin32d.lib
>>>>
>>>>
>>>> The optimized.lib and debug.lib are complete wrong here and there should
>>>> only be one real library listed on the link line depending on the build
>>>> type.
>>>>
>>>> Short time ago this does work without any problems. Any hints how to
>>>> solve this problem would be very welcome because it is currently not
>>>> possible to release several important binary packages for the KDE 4.1
>>>> release.
>>>>
>>> Exactly the same happens with the general keyword: it is not correctly
>>> used and thus produces strange errors (trying to link general.lib)-
>>>
>> The general keyword works for me with cmake 2.6.0 and 2.6.1
>>
>>
>>> this seems to be a cmake related problem (maybe a buildsystem one as
>>> cmake worked with this before).
>>>
>> When I remove the optimized/debug libraries from the related _DEPENDS
>> lines in CMakeCache.txt and add a
>> general;E:/daten/kde/emerge-msvc-root/lib/kdewin32d.lib (for debug
>> builds) then there is no linking error. I assume that there is a problem
>> in the area where cmake parses the _DEPENDS lines.
>>
>
> We really need to get this fixed.
> It would be cool if you could find out what happens, I didn't have the problem yet on my system.
> Which buildtype have you set ? Maybe "DEBUG" ?
>
// CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.
CMAKE_BUILD_TYPE:STRING=Debug
> The keywords "general", "optimized" and "debug" are handled in
> ------------
> cmTargetLinkLibrariesCommand::InitialPass().
> If there is a way that TARGET_LINK_LIBRARIES() ends up e.g.
> with "general;kdecore;debug;debug;kdeui;", i.e. two keywords behind each
> other, then this might cause the problem. The question is, can that happen ?
>
it is not, see below - I've added from kdecore/CMakeLists.txt
kde4_add_executable(kde4-config NOGUI kde-config.cpp )
foreach(var ${KDE4_KDECORE_LIBS})
message(STATUS ${var})
endforeach(var)
target_link_libraries(kde4-config ${KDE4_KDECORE_LIBS} )
and run nmake rebuild_cache which gives:
-- E:/daten/kde/emerge-msvc-root/lib/QtCored4.lib
-- kdecore
-- optimized
-- E:/daten/kde/emerge-msvc-root/lib/kdewin32.lib
-- debug
-- E:/daten/kde/emerge-msvc-root/lib/kdewin32d.lib
-- user32
-- shell32
-- ws2_32
-- netapi32
-- userenv
which looks okay.
> It shouldn't. Can you find out whether that happens there ?
>
Then I tried to recompile cmake 2.6.1 from zip file to have debug
symbols. Unfortunally this fails
Linking CXX executable ..\bin\DumpDocumentation.exe
CMakeLib.lib(cmCallVisualStudioMacro.obj) : error LNK2019: unresolved
external symbol "wchar_t * __stdcall _com_util::ConvertStringToBSTR(ch
ar const *)" (?ConvertStringToBSTR at _com_util@@YGPA_WPBD at Z) referenced in
function "public: __thiscall _bstr_t::Data_t::Data_t(char const *)"
(??0Data_t at _bstr_t@@QAE at PBD@Z)
CMakeLib.lib(cmCallVisualStudioMacro.obj) : error LNK2019: unresolved
external symbol "char * __stdcall _com_util::ConvertBSTRToString(wchar
_t *)" (?ConvertBSTRToString at _com_util@@YGPADPA_W at Z) referenced in
function "public: char const * __thiscall _bstr_t::Data_t::GetString(void
)const " (?GetString at Data_t@_bstr_t@@QBEPBDXZ)
..\bin\DumpDocumentation.exe : fatal error LNK1120: 2 unresolved externals
LINK Pass 1 failed. with 2
NMAKE : fatal error U1077: 'E:\daten\kde\emerge-msvc-root\bin\cmake.exe'
: return code '0xffffffff'
Stop.
NMAKE : fatal error U1077: '"C:\Programme\Microsoft Platform SDK for
Windows Server 2003 R2\Bin\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Programme\Microsoft Platform SDK for
Windows Server 2003 R2\Bin\nmake.exe"' : return code '0x2'
Stop.
so no luck here - is it possible to run the released cmake 2.6.1 to
recreate only the related build.make file with debug informations so
that it would be possible to see what happens internal ? How would the
related command line looks ?
> --------------
> They are also handled in
> cmComputeLinkDepends::AddVarLinkEntries() and cmTarget::GatherDependencies().
> These two functions may have the same issue, i.e. if the arguments they get
> contains two of the keywords in a row it might happen.
> Can check whether that happens ?
>
>
currently not see above.
Ralf
More information about the Kde-windows
mailing list