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

S. Brandt sbrandt at gmx.de
Thu Jan 8 16:32:17 GMT 2009


Hi!
Again, I can't manage compiling on windows ... I did some small fixes on the
way, yet, I'm still getting stuck somewhere ...
It's CallNtPowerInformation / HostPowerServiceWin::WndProc.


(1) configure.vbs
(a)
function CheckForXml2Sub(strPathXml2)

  if LogFindFile(strPathXml2, "lib/libxml2.lib") then
' is incorrect, needs to be
  if LogFindFile(strPathXml2, "lib/libxml2.lib")<>"" then

(b)
function CheckForXsltSub(strPathXslt)
  str = LogFindFile(strPathXslt, "lib/libxslt.dll")
' looks for the .dll in the lib subdir, while windows always puts it into
bin path
  str = LogFindFile(strPathXslt, "bin/libxslt.dll")

(2) Config.kmk
Several variables are not defined by the configure.vbs at all; this is OK
for me, but, adding some information to the build instructions would really
help.

PATH_SDK_QT4=C:/Programme/Qt/4.4.3
PATH_TOOL_QT4_BIN=$(PATH_SDK_QT4)/bin

PATH_SDK_QT3=C:/Programme/Qt/3.3.3
PATH_TOOL_QT3_BIN=$(PATH_SDK_QT3)/bin

(3) VBox\Additions\WINNT\Installer
This directory is included in the tar.bz2, but does not contain a
Makefile.kmk (b/c the installer is not part of the OSS).
But the WINNT/Makefile.kmk tries to include Installer/Makefile.kmk, because
the directory exists. Please remove/rename either the directory, add a
Makefile.kmk, or change the check in WINNT/Makefile.kmk to check for
Installer/Makefile.kmk, and not the directory.

(4) libxml2, libxslt, and stuff
(a) libxml2 needs iconv.h, and all files that link libxml2 need libiconv.a.
I installed iconv from the libxml binary distribution into mingw5/iconv and
added to Config.kmk:

SDK_VBOX_ICONV =.
SDK_VBOX_ICONV_INCLUDES  := C:/Programme/MinGW5/iconv/include
SDK_VBOX_ICONV_LIBS  := C:/Programme/MinGW5/iconv/lib/iconv_a.lib

and changed src/VBox/Main/Makefile.kmk

VBoxSettings_SDKS       = VBOX_LIBXSLT VBOX_LIBXML2 VBOX_ZLIB VBOX_ICONV

(b) When using LIBXML_STATIC, it is necessary to link against libxml_a.lib,
not libxml.lib.
I changed AutoConfig.kmk:
SDK_VBOX_LIBXML2_LIBS  := C:/Programme/MinGW5/libxml2/lib/libxml2_a.lib
same applies to xslt:
SDK_VBOX_LIBXSLT_LIBS   := C:/Programme/MinGW5/libxslt/lib/libxslt_a.lib

Patches for the changes up to here are attached.

diff -U3 configure.vbs.orig configure.vbs > configure.vbs.patch
diff -U3 Config.kmk.orig Config.kmk > Config.kmk.patch
diff -U3 src/VBox/Main/Makefile.kmk.orig src/VBox/Main/Makefile.kmk >
	src/VBox/Main/Makefile.kmk.patch




Now, the following error is given:
kBuild: 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}]

Anyone able to help here?

Yours,
Sebastian
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: AutoConfig.kmk.patch
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20090108/7ea2e932/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/20090108/7ea2e932/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Config.kmk.patch
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20090108/7ea2e932/attachment-0001.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: configure.vbs.patch
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20090108/7ea2e932/attachment-0002.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Makefile.kmk.patch
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20090108/7ea2e932/attachment-0003.ksh>


More information about the vbox-dev mailing list