# Virtualbox-ose fails to compile on amd64 & FreeBSD 8.1



## datentod (Mar 17, 2011)

```
Build Error:

/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.12_OSE/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp: In member function 'virtual nsresult 
VBoxSDLConsoleCallback::OnShowWindow(PRUint64*)':
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.12_OSE/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp:585: error: 'struct SDL_SysWMinfo' has no 
member named 'info'
kBuild: Compiling VBoxSDL - /usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.12_OSE/src/VBox/Frontends/VBoxSDL/Helper.cpp
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.12_OSE/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp: In function 'int TrustedMain(int, 
char**, char**)':
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.12_OSE/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp:1382: warning: ISO C++ forbids compound-
literals
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.12_OSE/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp:1384: warning: ISO C++ forbids compound-
literals
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.12_OSE/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp:2022: error: 'struct SDL_SysWMinfo' has 
no member named 'info'
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.12_OSE/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp:2027: error: 'struct SDL_SysWMinfo' has 
no member named 'info'
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.12_OSE/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp:2809: error: 'struct SDL_SysWMinfo' has 
no member named 'info'
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.12_OSE/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp:2824: error: 'struct SDL_SysWMinfo' has 
no member named 'info'
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.12_OSE/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp: In function 'uint16_t 
Keyevent2Keycode(const SDL_KeyboardEvent*)':
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.12_OSE/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp:3220: error: 'struct SDL_SysWMinfo' has 
no member named 'info'
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.12_OSE/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp: In function 'void SetPointerShape(const 
PointerShapeChangeData*)':
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.12_OSE/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp:4465: error: 'struct SDL_SysWMinfo' has 
no member named 'info'
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.12_OSE/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp:4484: error: 'struct SDL_SysWMinfo' has 
no member named 'info'
kmk[2]: *** [/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.12_OSE/out/freebsd.amd64/release/obj/VBoxSDL/VBoxSDL.o] Error 1
The failing command:
@c++ -c -O2 -fPIC -g -pipe -pedantic -Wshadow -Wall -Wextra -Wno-missing-field-initializers -Wno-unused -Wno-trigraphs -fdiagnostics-show-
option -Wno-long-long -Wno-variadic-macros -Wno-long-long -Wno-non-virtual-dtor -Wshadow -fshort-wchar -fpermissive -fexceptions -frtti -O2 -
mtune=generic -fno-omit-frame-pointer -fno-strict-aliasing -fvisibility-inlines-hidden -fvisibility=hidden -DVBOX_HAVE_VISIBILITY_HIDDEN -
DRT_USE_VISIBILITY_DEFAULT -m64 -I/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.12_OSE/out/freebsd.amd64/release/obj/VBoxSDL -
I/usr/include -I/usr/X11R6/include -I/usr/local/include -I/usr/ports/emulators/virtualbox-ose/work/VirtualBox-
3.2.12_OSE/out/freebsd.amd64/release/bin/sdk/bindings/xpcom/include -I/usr/ports/emulators/virtualbox-ose/work/VirtualBox-
3.2.12_OSE/out/freebsd.amd64/release/bin/sdk/bindings/xpcom/include/xpcom -I/usr/ports/emulators/virtualbox-ose/work/VirtualBox-
3.2.12_OSE/out/freebsd.amd64/release/bin/sdk/bindings/xpcom/include/string -I/usr/ports/emulators/virtualbox-ose/work/VirtualBox-
3.2.12_OSE/out/freebsd.amd64/release/bin/sdk/bindings/xpcom/include/xpcom -I/usr/ports/emulators/virtualbox-ose/work/VirtualBox-
3.2.12_OSE/out/freebsd.amd64/release/bin/sdk/bindings/xpcom/include/nsprpub -I/usr/ports/emulators/virtualbox-ose/work/VirtualBox-
3.2.12_OSE/out/freebsd.amd64/release/bin/sdk/bindings/xpcom/include/ipcd -I/usr/local/include/SDL -I/usr/local/include -
I/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.12_OSE/include -I/usr/ports/emulators/virtualbox-ose/work/VirtualBox-
3.2.12_OSE/out/freebsd.amd64/release -DVBOX -DVBOX_OSE -DVBOX_WITH_64_BITS_GUESTS -DVBOX_WITH_HARDENING -
DRTPATH_APP_PRIVATE=\"/usr/local/share/virtualbox-ose\" -DRTPATH_APP_PRIVATE_ARCH=\"/usr/local/lib/virtualbox\" -
DRTPATH_SHARED_LIBS=\"/usr/local/lib/virtualbox\" -DRTPATH_APP_DOCS=\"/usr/local/share/doc/virtualbox-ose\" -DRT_OS_FREEBSD -D__FREEBSD__ -
DRT_ARCH_AMD64 -D__AMD64__ -DPIC -DIN_RING3 -DUNICODE -DNDEBUG=1 -DVBOX_WITH_XPCOM -DNDEBUG -DTRIMMED -DVBOXSDL_WITH_X11 -Wp,-
MD,/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.12_OSE/out/freebsd.amd64/release/obj/VBoxSDL/VBoxSDL.o.dep -Wp,-
MT,/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.12_OSE/out/freebsd.amd64/release/obj/VBoxSDL/VBoxSDL.o -Wp,-MP -o 
/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.12_OSE/out/freebsd.amd64/release/obj/VBoxSDL/VBoxSDL.o /usr/ports/emulators/virtualbox-
ose/work/VirtualBox-3.2.12_OSE/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
kmk[2]: *** Waiting for unfinished jobs....
kmk[2]: Leaving directory `/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.12_OSE'
kmk[2]: Entering directory `/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.12_OSE'
kmk[2]: *** Exiting with status 2
kmk[1]: *** [pass_dlls_this] Error 2
kmk[1]: Leaving directory `/usr/ports/emulators/virtualbox-ose/work/VirtualBox-3.2.12_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.
```


```
[root@thor /usr/src/sys/amd64/conf]# uname -a
FreeBSD masked.masked.com 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Mon Mar  7 16:11:54 EST 2011     [email]datentod@masked.masked.com[/email]:/usr/obj/usr/src/sys/THOR  amd64
```


```
[root@thor /usr/src/sys/amd64/conf]# kldstat
Id Refs Address            Size     Name
 1   23 0xffffffff80100000 a63570   kernel
 2    1 0xffffffff80b64000 1ad088   zfs.ko
 3    2 0xffffffff80d12000 3a08     opensolaris.ko
 4    1 0xffffffff80d16000 21008    geom_mirror.ko
 5    1 0xffffffff80d38000 f030     aio.ko
 6    3 0xffffffff80e22000 25ec4    vboxdrv.ko
 7    1 0xffffffff80e48000 d0c      vboxnetadp.ko
 8    1 0xffffffff80e49000 28ae     vboxnetflt.ko
 9    2 0xffffffff80e4c000 8d2c     netgraph.ko
10    1 0xffffffff80e55000 151a     ng_ether.ko
```


```
[root@thor /usr/src/sys/amd64/conf]# cat /etc/make.conf
# added by use.perl 2011-03-07 09:35:45
PERL_VERSION=5.10.1
USA_RESIDENT= YES
#WITHOUT_X11= YES
NO_GUI= true
WITH_APACHE_SUEXEC=YES
NO_PROFILE= true
#NO_X=yes

#CFLAGS+=-O2 -mtune=native
CFLAGS= -O2 -pipe -fno-strict-aliasing
COPTFLAGS= -O2 -pipe -funroll-loops -ffast-math -fno-strict-aliasing

OPTIMIZED_CFLAGS= YES
BUILD_OPTIMIZED= YES
WITH_CPUFLAGS= YES
WITHOUT_DEBUG= YES
WITH_OPTIMIZED_CFLAGS= YES
```

Kernel Config:

```
[root@thor /usr/src/sys/amd64/conf]# cat /root/THOR | grep COMPAT_FREEBSD32
options         COMPAT_FREEBSD32        # Compatible with i386 binaries
```


----------



## SirDice (Mar 17, 2011)

datentod said:
			
		

> ```
> CFLAGS= -O2 -pipe -fno-strict-aliasing
> COPTFLAGS= -O2 -pipe -funroll-loops -ffast-math -fno-strict-aliasing
> 
> ...



Remove these from /etc/make.conf and try again.


----------



## datentod (Mar 18, 2011)

Thanks, your suggestion worked.

However I had to deinstall devel/sdl12 and redo *make install* with new /etc/make.conf settings, since it was still failing initially.


----------



## SirDice (Mar 18, 2011)

Just a tip, leave the CFLAGS and COPTFLAGS alone. The defaults are good enough.


----------

