# virtualbox-ose-3.2.8 fails with bad C++ code



## bsd4eva (Aug 14, 2010)

This is a fresh FreeBSD 8.1-STABLE #1 installation; using the GENERIC amd64 kernel; 
the world built successfully; fully updated with [cmd=]portupdate[/cmd] without error.
All the PKG [cmd=]pkgdb -F[/cmd] and Ports [cmd=]portsnap update[/cmd] DBs check clean.
VirualBox has not been installed here before.

Any Suggestions Welcome. How could I install a previous Ports virtualbox-ose version?

First I ran [cmd=]portupgrade -NR virtualbox-ose-kmod[/cmd]

```
virtualbox-ose-kmod-3.2.8   =  up-to-date with port
```
  no problem
Then I ran [cmd=]portupgrade -NR virtualbox-ose[/cmd]
:q

```
/usr/local/share/kBuild/footer.kmk:3132: warning: overriding recipe for target `/usr/ports/emulators/virtualbox-ose/work/VirtualBox-
3.2.8_OSE/out/freebsd.amd64/release/bin/src/vboxdrv/include/iprt/net.h'
/usr/local/share/kBuild/footer.kmk:3132: warning: ignoring old recipe for target 

[snip ...]

/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/src/VBox/VMM/VMMSwitcher/AMD64andLegacy.mac:866: warning: value does not fit in 
32 bit field
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/src/VBox/VMM/VMMSwitcher/AMD64andLegacy.mac:975: warning: `ds' segment register 
ignored in 64-bit mode
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/src/VBox/VMM/VMMSwitcher/AMD64andLegacy.mac:977: warning: `es' segment register 
ignored in 64-bit mode
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/src/VBox/VMM/VMMSwitcher/AMD64andLegacy.mac:984: warning: `ss' segment register 
ignored in 64-bit mode
Compilation complete. 0 Errors, 0 Warnings, 0 Remarks, 404 Optimizations
Compilation complete. 0 Errors, 0 Warnings, 0 Remarks, 0 Optimizations
Compilation complete. 0 Errors, 0 Warnings, 0 Remarks, 72 Optimizations
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/src/VBox/Devices/Network/lwip/src/core/pbuf.c:590: warning: declaration of 
'old_level' shadows a previous local [-Wshadow]
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/src/VBox/Devices/Network/lwip/src/core/pbuf.c:552: warning: shadowed declaration 
is here [-Wshadow]
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/src/VBox/Devices/Network/lwip/src/core/ipv4/ip_frag.c:231: warning: comparison 
between signed and unsigned

[snip ...]

/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/src/libs/xpcom18a4/nsprpub/pr/src/pthreads/ptio.c:2937: warning: pointer targets 
in passing argument 5 of 'getsockopt' differ in signedness
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/src/libs/xpcom18a4/xpcom/typelib/xpt/src/xpt_xdr.c:146: warning: cast from 
pointer to integer of different size [-Wpointer-to-int-cast]

[snip ...]

/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/src/libs/xpcom18a4/xpcom/io/nsLocalFileUnix.h:78:1: warning: "STATFS" redefined
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/src/libs/xpcom18a4/xpcom/io/nsLocalFileUnix.h:70:1: warning: this is the location 
of the previous definition
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/src/libs/xpcom18a4/xpcom/reflect/xptinfo/src/xptiManifest.cpp:360: 
warning: 'values[1]' may be used uninitialized in this function
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/src/libs/xpcom18a4/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_linux.cpp:82: 
warning: 'value' may be used uninitialized in this function
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/src/VBox/Main/cbinding/VBoxXPCOMCGlue.c:141: warning: ISO C forbids conversion of 
object pointer to function pointer type
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/include/VBox/com/defs.h:282:1: warning: "FALSE" redefined
/usr/include/rpc/types.h:58:1: warning: this is the location of the previous definition
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/include/VBox/com/defs.h:283:1: warning: "TRUE" redefined
/usr/include/rpc/types.h:61:1: warning: this is the location of the previous definition
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-
3.2.8_OSE/out/freebsd.amd64/release/bin/sdk/bindings/xpcom/include/string/nsEmbedString.h:111: warning: base class 'class nsCStringContainer' 
should be explicitly initialized in the copy constructor [-Wextra]
kBuild: Compiling VBoxCOM - /usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/src/VBox/Main/glue/ErrorInfo.cpp
kBuild: Compiling VBoxCOM - /usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/src/VBox/Main/glue/SupportErrorInfo.cpp
kBuild: Compiling VBoxCOM - /usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/src/VBox/Main/glue/VirtualBoxErrorInfo.cpp
/usr/local/share/kBuild/footer.kmk:3132: warning: overriding recipe for target `/usr/ports/emulators/virtualbox-ose/work/VirtualBox-
3.2.8_OSE/out/freebsd.amd64/release/bin/src/vboxdrv/include/iprt/net.h'
/usr/local/share/kBuild/footer.kmk:3132: warning: ignoring old recipe for target `/usr/ports/emulators/virtualbox-ose/work/VirtualBox-
3.2.8_OSE/out/freebsd.amd64/release/bin/src/vboxdrv/include/iprt/net.h'
/usr/local/share/kBuild/footer.kmk:3132: warning: overriding recipe for target `/usr/ports/emulators/virtualbox-ose/work/VirtualBox-
3.2.8_OSE/out/freebsd.amd64/release/bin/src/vboxdrv/include/iprt/net.h'
/usr/local/share/kBuild/footer.kmk:3132: warning: ignoring old recipe for target `/usr/ports/emulators/virtualbox-ose/work/VirtualBox-
3.2.8_OSE/out/freebsd.amd64/release/bin/src/vboxdrv/include/iprt/net.h'
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/src/libs/xpcom18a4/xpcom/io/nsLocalFileUnix.h:78:1: warning: "STATFS" redefined
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/src/libs/xpcom18a4/xpcom/io/nsLocalFileUnix.h:70:1: warning: this is the location 
of the previous definition
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/src/VBox/Main/xpcom/server_module.cpp:243: warning: ISO C++ forbids compound-
literals
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp:874: warning: ISO C++ forbids 
compound-literals
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/src/VBox/Frontends/VBoxHeadless/VBoxHeadless.cpp:879: warning: ISO C++ forbids 
compound-literals
kBuild: Compiling VBoxPython2_6 - /usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/src/libs/xpcom18a4/python/src/ErrorUtils.cpp
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/include/VBox/com/defs.h:282:1: warning: "FALSE" redefined
/usr/include/rpc/types.h:58:1: warning: this is the location of the previous definition
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/include/VBox/com/defs.h:283:1: warning: "TRUE" redefined
/usr/include/rpc/types.h:61:1: warning: this is the location of the previous definition
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/src/libs/xpcom18a4/python/src/module/_xpcom.cpp:682: error: 'PyEval_InitThreads' 
was not declared in this scope
kmk[2]: *** [/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/out/freebsd.amd64/release/obj/VBoxPython2_6/src/module/_xpcom.o] 
Error 1
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/src/libs/xpcom18a4/python/src/dllmain.cpp:215: error: 'PyEval_InitThreads' was 
not declared in this scope
kmk[2]: *** [/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/out/freebsd.amd64/release/obj/VBoxPython2_6/src/dllmain.o] Error 1
kmk[1]: *** [pass_dlls_this] Error 2
kmk: *** [pass_dlls_order] Error 2
kmk[1]: Leaving directory `/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE'
kmk: *** [pass_dlls_order] Error 2
*** Error code 2
Stop in /usr/ports/emulators/virtualbox-ose.
*** Error code 1
Stop in /usr/ports/emulators/virtualbox-ose.
--->  ** Install tasks 16: 15 done, 0 ignored, 0 skipped and 1 failed	! emulators/virtualbox-ose	(bad C++ code)
```

Attached is the full output.  Thanks.


----------



## yks (Sep 13, 2010)

*Another "bad c++ code" fail while building virtualbox-ose-3.2.8*

While trying to upgrade an old virtualbox version to the fresh 3.2.8, first using portupgrade, then just using _make_, I run into the following error:
	
	



```
......
kBuild: Installing tstVMMFork => /usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/out/freebsd.amd64/release/bin/tstVMMFork
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/out/freebsd.amd64/release/bin/tstVMStructRC: 1: Syntax error: "(" unexpected
kmk[2]: *** [/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/out/freebsd.amd64/release/obj/VMM/tstVMStructRC.h] Error 2
kmk[2]: *** Deleting file `/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE/out/freebsd.amd64/release/obj/VMM/tstVMStructRC.h'
kmk[2]: *** Waiting for unfinished jobs....
kmk[2]: Leaving directory `/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE'
kmk[2]: Entering directory `/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE'
kmk[2]: *** Exiting with status 2
kmk[1]: *** [pass_binaries_this] Error 2
kmk[1]: Leaving directory `/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.8_OSE'
kmk: *** [pass_binaries_order] Error 2
*** Error code 2

Stop in /usr/ports/emulators/virtualbox-ose.
*** Error code 1

Stop in /usr/ports/emulators/virtualbox-ose.
```

I guess the file tstVMStructRC.h is auto-generated and I can not anyhow influence its contents; I can not even view it as it gets deleted right after the error, and I could not catch the short moment when it appears. But looking at the file tstAsmStructsHC.h in the same directory, it contains just a set of macros without any clue. So don't think that the problem is here.

I have rebuilt kBuild but this didn't help.
My system is:

```
FreeBSD *** 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Aug  2 16:24:27 MSD 2010     ***@***:home/src/src/sys/amd64/compile/KERNEL_20100802  amd64
```

All dependencies including Qt are the latest versions.
The complete log of the compilation process is attached below.


----------



## SIFE (Sep 13, 2010)

try reinstall python .


----------



## Murf (Oct 14, 2010)

*How i "Solved" the problem*

I got the exact same error.
I did the stupid thing and changed a lot of stuff at the same time so I'm not exactly sure what did the trick.

1. Added "options COMPAT_FREEBSD32" to my kernel config
2. updated sources, rebuilt world and kernel installed them, rebooted.
3. portsnap fetch extract
4. Emptied make.conf
5. Built and installed virtualbox-ose-kmod
6. Now virtualbox-ose builds. Only DBUS, VNC & Webservice checked.

Hope this helps in some way.


----------



## Serafim (Nov 24, 2010)

Thx! Added 
	
	



```
options COMPAT_FREEBSD32
```
 - solution problem! =)

I'm using FreeBSD 8.2-prerelease amd64 and vb 3.2.10, my options: GUESTADDITIONS, DBUS, VDE, VNC, WEBSERVICE.


----------

