This forum has been archived. All content is frozen. Please use KDE Discuss instead.

kde-4.6 link error "`_imp__TzSpecificLocalTimeToSystemTime@"

Tags: None
(comma "," separated)
Michael8988
Registered Member
Posts
3
Karma
0
Help Please!
I am trying to compile kde 4.6 on 32bits windows 7 following the instruction below:
http://techbase.kde.org/Getting_Started ... ows/emerge

Below is the commands:
cd emerge && git checkout kde-4.6
I use MinGW compiler
emerge qt worked successfully, but when I run the command below, I got linking error:
emerge kdelibs

"undefined reference to `_imp__TzSpecificLocalTimeToSystemTime@12'"

Here is the log:
...
c:/kderoot4.6/git/kdelibs/kjs/bytecode/opcodes.cpp.in:1372: warning: deprecated conversion from string constant to 'char
*'
[ 32%] Building CXX object kjs/CMakeFiles/kjs.dir/machine.obj
[ 32%] Building CXX object kjs/CMakeFiles/kjs.dir/nodes2bytecode.obj
[ 32%] Building CXX object kjs/CMakeFiles/kjs.dir/CompileState.obj
Linking CXX shared library ..\bin\libkjs.dll
Creating library file: ..\bin\libkjs.dll.a
CMakeFiles\kjs.dir/objects.a(date_object.obj): In function `makeTime':
c:/kderoot4.6/git/kdelibs/kjs/date_object.cpp:1006: undefined reference to `_imp__TzSpecificLocalTimeToSystemTime@12'
collect2: ld returned 1 exit status
gmake[2]: *** [bin/libkjs.dll] Error 1
gmake[1]: *** [kjs/CMakeFiles/kjs.dir/all] Error 2
gmake: *** [all] Error 2
emerge fatal error: while running make cmd: gmake
emerge fatal error: running python c:\kderoot4.6\emerge\portage\kde\kdelibs\kdelibs-20110130.py compile
Task: Emerge stopped after: 0:15:55.899000

I have beening search online but can not figure out how to fix it. I really appreciate any suggestion.

Thanks,
Michael
User avatar
Kraplax
Registered Member
Posts
36
Karma
1
OS
Hi

I've spent lots and lots of time trying to fight this thing.
As it appeared, this is the faulty MinGW package. The thing is you have to regenerate libkernel32.a from your kernel32.dll or use the one that should be shipped with emerge's MinGW. here are the instructions:

I. First way
To regenerate libkernel32.a from your kernel32.dll you have to:
1) enter in your console window:
Code: Select all
pexports C:\Windows\System32\kernel32.dll > %kderoot%\lib\kernel32.def

2) enter in your console window:
Code: Select all
dlltool -d %KDEROOT%\lib\kernel32.def -l %KDEROOT%\mingw\i686-w64-mingw32\lib\libkernel32.a

Note: %KDEROOT% stands for your kderoot directory, you might want to replace it with your own path.
Note: the exact path where to place your newly generated .a file can be found by simple windows search for libkernel32.a file.

II. The Second, and maybe, The Proper Way
Install the emerge package, that conbtains needed patch and required .a file in the tarball and solves this problem automagically
1) Enter in your console window:
Code: Select all
emerge --unmerge %your_mingw%

This would remove old and broken version of mingw that you use from KDEROOT (the exact name of %your_mingw% package you can find with 'emerge --print-installed' command). If you happen to use your own mingw version, that you've sinstalled separately and that didn't ship with emerge you'd better remove it from your PATH and follow the next step
2) install the right compiler package:
Code: Select all
emerge mingw-w32

This will install the right compiler package and solve your problem. Mind that if you will use 64bit Windows you'll have to install 'mingw-w64' package, that has no such a problem and thus doesn't provide you with regenerated libkernel32.a file

So now you should be ok. Ask if something isn't clear to you :)


Kraplax, proud to be a member of KDE forums since 2008-Oct.
Image
Michael8988
Registered Member
Posts
3
Karma
0
Hi Kraplax,

Thank you very much for your help. That fixed the issue. You saved my day :)

Best,
Michael


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell