[vbox-dev] building 2.1.0 on win32 - fixes, and CallNtPowerInformation

S. Brandt sbrandt at gmx.de
Wed Jan 28 11:00:15 GMT 2009


Klaus Espenlaub wrote:
> Which SDK do you use exactly? I'm no expert there, but the version field 
> in the SDK directory we use everywhere is "200504", which looks like 
> we're using some MSDN version. So maybe that one is a bit less strict 
> when it comes to linking.
> 
> Will ask the Windows experts here to investigate.
Hi!

My SDK:
cscript configure.vbs  --with-MinGW=c:\Programme\MingGW5  --with-sdk="C:\Programme\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK" --with-ddk="c:\Programme\WINDDK\3790.1830" --with-libSDL=C:\Programme\MingGW5\SDL --with-qt="C:\Programme\qt\3.3.3"  --with-DXSDK="c:\Programme\Microsoft DirectX SDK 2008-08" --with-libxml2="c:\programme\MingGW5\libxml2" --with-libxslt=c:\programme\MingGW5\libxslt

PATH_SDK_QT4=C:/Programme/Qt/4.4.3
PATH_SDK_QT3=C:/Programme/Qt/3.3.3
libxml2-2.7.2+.win32 (libxml2-2.7.2.win32 had the same problem)
libxslt-1.1.24.win32
SDL-1.2.13-win32 + SDL-devel-1.2.13-VC6
iconv-1.9.2.win32

MinGW5 is currently MinGW 5.1.4 "current", with gcc-core-3.3.3-20040217-1.tar.gz and gcc-g++-3.3.3-20040217-1.tar.gz unpacked over it b/c the configure-script wants 3.3.x, though 3.4.x seems to work as well.

I'm quite sure the PUEL version does not use the configure.vbs script ... b/c that one does neither work correctly, nor does it provide all information.  See my first post about the various problems ... I also attached a "new" version of the configure.vbs diff which includes some more stuff, e.g., the libxml2/xslt_a.lib fix. Though, in reality, you probably want the dll version of the two, yet the _STATIC flag is defined ...

One of the other problems is surely related to the PUEL/OSE differences (missing  VBox\Additions\WINNT\Installer\Makefile.kmk), and the iconv and the _a problem may be version related (MinGW or libxml2/libxslt).
CallNtPowerInformation may be PSDK version related.

Everything else looks like ... configure.vbs not working correctly
- "typos"
  if LogFindFile(strPathXml2, "lib/libxml2.lib") then 'that one does not even run
  str = LogFindFile(strPathXslt, "lib/libxslt.dll")
- QT3 not passed correctly to AutoConfig.kmk
- QT4 not checked at all nor passed to AutoConfig.kmk

BTW - the crash of the QT4 version on my machine was related to old versions of QtCore4/QtGUI4.dll in the path.


>> For fixing CallNtPowerInformation:
>>
>> 2. the missing function is
>> ?CallNtPowerInformation@@YGJW4POWER_INFORMATION_LEVEL@@PAXK1K at Z (C++ name
>> mangled!), while the method provided by the dll/lib is
>> [_imp]_CallNtPowerInformation at 20.
>> So, obviously, there is an 'extern "C"' missing in HostPowerWin.cpp
>>
>> src\VBox\Main\HostPowerWin.cpp:
>> extern "C" {
>> #include <PowrProf.h>
>> }

I've got no idea where this problem acomes from - win32api usually does not need such a construct ... maybe MS did some mistake there? 

The full error message is attached at the first post in this thread, and here again.
Short version:
Build: Linking VBoxSVC
kBuild: Compiling tstVMStructSize -
C:/home/Projekte/VirtualBox/VirtualBox-2.1.0/src/VBox/VMM/testcase/tstVMStructSize.cpp
tstVMStructSize.cpp
HostPowerWin.obj : error LNK2019: Nicht aufgelöstes externes Symbol '"long
__stdcall CallNtPowerInformation(enum POWER_INFORMATION_LEVEL,void
*,unsigned long,void *,unsigned long)"
(?CallNtPowerInformation@@YGJW4POWER_INFORMATION_LEVEL@@PAXK1K at Z)',
verwiesen in Funktion '"private: static long __stdcall
HostPowerServiceWin::WndProc(struct HWND__ *,unsigned int,unsigned
int,long)" (?WndProc at HostPowerServiceWin@@CGJPAUHWND__@@IIJ at Z)'
C:/home/Projekte/VirtualBox/VirtualBox-2.1.0/out/win.x86/release/obj/VBoxSVC/VBoxSVC.exe
: fatal error LNK1120: 1 unaufgelöste externe Verweise
kmk[2]: ***
[C:/home/Projekte/VirtualBox/VirtualBox-2.1.0/out/win.x86/release/obj/VBoxSVC/VBoxSVC.exe]
Error 1120
The failing command:
@ C:/PROGRA~2/MICROS~1.NET/Vc7/bin/link.exe -nologo
  /NOD /INCREMENTAL:NO /MAPINFO:EXPORTS /LARGEADDRESSAWARE /DEBUG
/DISALLOWLIB:libc.lib /DISALLOWLIB:libcd.lib /DISALLOWLIB:msvcrt.lib
/DISALLOWLIB:msvcrtd.lib /DISALLOWLIB:libcmtd.lib /DISALLOWLIB:libcmt.lib
psapi.lib powrprof.lib
/OUT:C:/home/Projekte/VirtualBox/VirtualBox-2.1.0/out/win.x86/release/obj/VBoxSVC/VBoxSVC.exe
/MAPINFO:EXPORTS /INCREMENTAL:NO /MAPINFO:LINES
/MAP:C:/home/Projekte/VirtualBox/VirtualBox-2.1.0/out/win.x86/release/obj/VBoxSVC/VBoxSVC.map
   /LIBPATH:C:/PROGRA~2/MICROS~1.NET/Vc7/PLATFO~1/Lib
/LIBPATH:C:/Programme/WINDDK/3790.1830/lib/wnet/i386
[remainder see attachment}]


Hope this helps,
yours,
Sebastian
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: configure.vbs.patch2
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20090128/b8afde77/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CallNtPowerInformation.err.txt
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20090128/b8afde77/attachment.txt>


More information about the vbox-dev mailing list