www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - DMD's kernel32.lib missing symbols?

reply simendsjo <simendsjo gmail.com> writes:
Not sure how I can search for symbols in the library, but it seems the 
library is missing functions.
I've tried using coffimplib on kernel32.lib from the Windows SDK, but it 
neither produces a new library or give me an error.

What Windows version is the library based on?
How can I check what symbols exists?
Is there a way to convert WinSDK's library to omf?
Jul 29 2011
parent reply Simon <s.d.hammett gmail.com> writes:
On 29/07/2011 11:14, simendsjo wrote:
 Not sure how I can search for symbols in the library, but it seems the
 library is missing functions.
 I've tried using coffimplib on kernel32.lib from the Windows SDK, but it
 neither produces a new library or give me an error.

 What Windows version is the library based on?
 How can I check what symbols exists?
 Is there a way to convert WinSDK's library to omf?
Shows how to make your own import lib for windows system dll: http://www.sstk.co.uk/d.php Been ages since I did that though so let me know if you have problems. -- My enormous talent is exceeded only by my outrageous laziness. http://www.ssTk.co.uk
Jul 29 2011
parent reply simendsjo <simendsjo gmail.com> writes:
On 29.07.2011 19:13, Simon wrote:
 On 29/07/2011 11:14, simendsjo wrote:
 Not sure how I can search for symbols in the library, but it seems the
 library is missing functions.
 I've tried using coffimplib on kernel32.lib from the Windows SDK, but it
 neither produces a new library or give me an error.

 What Windows version is the library based on?
 How can I check what symbols exists?
 Is there a way to convert WinSDK's library to omf?
Shows how to make your own import lib for windows system dll: http://www.sstk.co.uk/d.php Been ages since I did that though so let me know if you have problems.
I've tried using implib too, but replacing dmd's own kernel32.lib seems to create problems.
Jul 29 2011
parent reply Simon <s.d.hammett gmail.com> writes:
On 29/07/2011 19:27, simendsjo wrote:
 On 29.07.2011 19:13, Simon wrote:
 On 29/07/2011 11:14, simendsjo wrote:
 Not sure how I can search for symbols in the library, but it seems the
 library is missing functions.
 I've tried using coffimplib on kernel32.lib from the Windows SDK, but it
 neither produces a new library or give me an error.

 What Windows version is the library based on?
 How can I check what symbols exists?
 Is there a way to convert WinSDK's library to omf?
Shows how to make your own import lib for windows system dll: http://www.sstk.co.uk/d.php Been ages since I did that though so let me know if you have problems.
I've tried using implib too, but replacing dmd's own kernel32.lib seems to create problems.
What sort of problems? It's worked perfectly for me so far. -- My enormous talent is exceeded only by my outrageous laziness. http://www.ssTk.co.uk
Jul 29 2011
parent reply simendsjo <simendsjo gmail.com> writes:
On 29.07.2011 22:06, Simon wrote:
 On 29/07/2011 19:27, simendsjo wrote:
 On 29.07.2011 19:13, Simon wrote:
 On 29/07/2011 11:14, simendsjo wrote:
 Not sure how I can search for symbols in the library, but it seems the
 library is missing functions.
 I've tried using coffimplib on kernel32.lib from the Windows SDK,
 but it
 neither produces a new library or give me an error.

 What Windows version is the library based on?
 How can I check what symbols exists?
 Is there a way to convert WinSDK's library to omf?
Shows how to make your own import lib for windows system dll: http://www.sstk.co.uk/d.php Been ages since I did that though so let me know if you have problems.
I've tried using implib too, but replacing dmd's own kernel32.lib seems to create problems.
What sort of problems? It's worked perfectly for me so far.
PTLINK (R) for Win32 Release 8.00.12 opyright (C) Digital Mars 1989-2010 All rights reserved. ttp://www.digitalmars.com/ctg/optlink.html :\dmd\windows\bin\..\lib\phobos.lib(dmain2) Error 42: Symbol Undefined _LocalFree 4 :\dmd\windows\bin\..\lib\phobos.lib(dmain2) Error 42: Symbol Undefined _WideCharToMultiByte 32 etc.. I tried to replace kernel32.lib like this: c:\dmd\windows\lib>implib /system kernel32.lib \Windows\system32\kernel32.dll As this didn't work, I recompiled druntime and phobos with the new kernel32.lib, but I get the same errors.
Jul 30 2011
parent reply torhu <no spam.invalid> writes:
On 30.07.2011 11:43, simendsjo wrote:
 On 29.07.2011 22:06, Simon wrote:
  On 29/07/2011 19:27, simendsjo wrote:
  On 29.07.2011 19:13, Simon wrote:
  On 29/07/2011 11:14, simendsjo wrote:
  Not sure how I can search for symbols in the library, but it seems the
  library is missing functions.
  I've tried using coffimplib on kernel32.lib from the Windows SDK,
  but it
  neither produces a new library or give me an error.

  What Windows version is the library based on?
  How can I check what symbols exists?
  Is there a way to convert WinSDK's library to omf?
Shows how to make your own import lib for windows system dll: http://www.sstk.co.uk/d.php Been ages since I did that though so let me know if you have problems.
I've tried using implib too, but replacing dmd's own kernel32.lib seems to create problems.
What sort of problems? It's worked perfectly for me so far.
PTLINK (R) for Win32 Release 8.00.12 opyright (C) Digital Mars 1989-2010 All rights reserved. ttp://www.digitalmars.com/ctg/optlink.html :\dmd\windows\bin\..\lib\phobos.lib(dmain2) Error 42: Symbol Undefined _LocalFree 4 :\dmd\windows\bin\..\lib\phobos.lib(dmain2) Error 42: Symbol Undefined _WideCharToMultiByte 32 etc.. I tried to replace kernel32.lib like this: c:\dmd\windows\lib>implib /system kernel32.lib \Windows\system32\kernel32.dll As this didn't work, I recompiled druntime and phobos with the new kernel32.lib, but I get the same errors.
Both those symbols are definitely present in the kernel32.lib that comes with DMD 2.053. Just grep for them and you'll see. There is something going on with either your DMD install or the command line passed to the linker.
Jul 30 2011
next sibling parent simendsjo <simendsjo gmail.com> writes:
On 30.07.2011 16:30, torhu wrote:
 On 30.07.2011 11:43, simendsjo wrote:
 On 29.07.2011 22:06, Simon wrote:
 On 29/07/2011 19:27, simendsjo wrote:
 On 29.07.2011 19:13, Simon wrote:
 On 29/07/2011 11:14, simendsjo wrote:
 Not sure how I can search for symbols in the library, but it seems
 the
 library is missing functions.
 I've tried using coffimplib on kernel32.lib from the Windows SDK,
 but it
 neither produces a new library or give me an error.

 What Windows version is the library based on?
 How can I check what symbols exists?
 Is there a way to convert WinSDK's library to omf?
Shows how to make your own import lib for windows system dll: http://www.sstk.co.uk/d.php Been ages since I did that though so let me know if you have problems.
I've tried using implib too, but replacing dmd's own kernel32.lib seems to create problems.
What sort of problems? It's worked perfectly for me so far.
PTLINK (R) for Win32 Release 8.00.12 opyright (C) Digital Mars 1989-2010 All rights reserved. ttp://www.digitalmars.com/ctg/optlink.html :\dmd\windows\bin\..\lib\phobos.lib(dmain2) Error 42: Symbol Undefined _LocalFree 4 :\dmd\windows\bin\..\lib\phobos.lib(dmain2) Error 42: Symbol Undefined _WideCharToMultiByte 32 etc.. I tried to replace kernel32.lib like this: c:\dmd\windows\lib>implib /system kernel32.lib \Windows\system32\kernel32.dll As this didn't work, I recompiled druntime and phobos with the new kernel32.lib, but I get the same errors.
Both those symbols are definitely present in the kernel32.lib that comes with DMD 2.053. Just grep for them and you'll see. There is something going on with either your DMD install or the command line passed to the linker.
These errors comes after replacing kernel32.lib in dmd. Not sure if that was clear from my post. How is kernel32.lib supplied with dmd created? This is a simple test showing a missing symbol: pragma(lib, "kernel32.lib"); extern(Windows) { uint LocaleNameToLCID(const(wchar)*, int); } void main() { auto us = LocaleNameToLCID("en-US", 0); }
Jul 31 2011
prev sibling next sibling parent simendsjo <simendsjo gmail.com> writes:
On 30.07.2011 16:30, torhu wrote:
 On 30.07.2011 11:43, simendsjo wrote:
 On 29.07.2011 22:06, Simon wrote:
 On 29/07/2011 19:27, simendsjo wrote:
 On 29.07.2011 19:13, Simon wrote:
 On 29/07/2011 11:14, simendsjo wrote:
 Not sure how I can search for symbols in the library, but it seems
 the
 library is missing functions.
 I've tried using coffimplib on kernel32.lib from the Windows SDK,
 but it
 neither produces a new library or give me an error.

 What Windows version is the library based on?
 How can I check what symbols exists?
 Is there a way to convert WinSDK's library to omf?
Shows how to make your own import lib for windows system dll: http://www.sstk.co.uk/d.php Been ages since I did that though so let me know if you have problems.
I've tried using implib too, but replacing dmd's own kernel32.lib seems to create problems.
What sort of problems? It's worked perfectly for me so far.
PTLINK (R) for Win32 Release 8.00.12 opyright (C) Digital Mars 1989-2010 All rights reserved. ttp://www.digitalmars.com/ctg/optlink.html :\dmd\windows\bin\..\lib\phobos.lib(dmain2) Error 42: Symbol Undefined _LocalFree 4 :\dmd\windows\bin\..\lib\phobos.lib(dmain2) Error 42: Symbol Undefined _WideCharToMultiByte 32 etc.. I tried to replace kernel32.lib like this: c:\dmd\windows\lib>implib /system kernel32.lib \Windows\system32\kernel32.dll As this didn't work, I recompiled druntime and phobos with the new kernel32.lib, but I get the same errors.
Both those symbols are definitely present in the kernel32.lib that comes with DMD 2.053. Just grep for them and you'll see. There is something going on with either your DMD install or the command line passed to the linker.
The implib created file is different from the one in the distribution, but I have no idea what this means: ** ORIGINAL ** ============== c:\dmd\windows\lib>find "LocalFree" kernel32.lib ---------- KERNEL32.LIB LocalFree ♀_LocalFree 4♀KERNEL32.dll LocalFree ♀_LocalFree 4}♀ ** IMPLIB ** ============ c:\dmd\windows\lib>implib /system kernel32.lib \Windows\system32\kernel32.dll c:\dmd\windows\lib>find "LocalFree" kernel32.lib ---------- KERNEL32.LIB LocalFree _LocalFree♀kernel32.dll LocalFree _MoveFileExA!╔¶↓_QueryPerformanceCounter!c▬¶_ReadConsoleOutputA!╙▬ _LocalFreeZ¶
Jul 31 2011
prev sibling parent simendsjo <simendsjo gmail.com> writes:
On 30.07.2011 16:30, torhu wrote:
 On 30.07.2011 11:43, simendsjo wrote:
 On 29.07.2011 22:06, Simon wrote:
 On 29/07/2011 19:27, simendsjo wrote:
 On 29.07.2011 19:13, Simon wrote:
 On 29/07/2011 11:14, simendsjo wrote:
 Not sure how I can search for symbols in the library, but it seems
 the
 library is missing functions.
 I've tried using coffimplib on kernel32.lib from the Windows SDK,
 but it
 neither produces a new library or give me an error.

 What Windows version is the library based on?
 How can I check what symbols exists?
 Is there a way to convert WinSDK's library to omf?
Shows how to make your own import lib for windows system dll: http://www.sstk.co.uk/d.php Been ages since I did that though so let me know if you have problems.
I've tried using implib too, but replacing dmd's own kernel32.lib seems to create problems.
What sort of problems? It's worked perfectly for me so far.
PTLINK (R) for Win32 Release 8.00.12 opyright (C) Digital Mars 1989-2010 All rights reserved. ttp://www.digitalmars.com/ctg/optlink.html :\dmd\windows\bin\..\lib\phobos.lib(dmain2) Error 42: Symbol Undefined _LocalFree 4 :\dmd\windows\bin\..\lib\phobos.lib(dmain2) Error 42: Symbol Undefined _WideCharToMultiByte 32 etc.. I tried to replace kernel32.lib like this: c:\dmd\windows\lib>implib /system kernel32.lib \Windows\system32\kernel32.dll As this didn't work, I recompiled druntime and phobos with the new kernel32.lib, but I get the same errors.
Both those symbols are definitely present in the kernel32.lib that comes with DMD 2.053. Just grep for them and you'll see. There is something going on with either your DMD install or the command line passed to the linker.
Hmmm.. Got coffimplib working. No idea what I did to break it before.
Jul 31 2011