環境: Ubuntu 12.04 (64 bits), Virtualbox 4.2.8源碼
首先從https://www.virtualbox.org/wiki/Downloads下載Virtualbox原始碼,其官方Wiki上還提供了編譯指導:https://www.virtualbox.org/wiki/Linux%20build%20instructions。總體上按指導上一步步來就行,但實際操作中總還是會碰到問題的,下面總結一下:
1. 指導中提到要建立libXTrap.so的軟連結,但Ubuntu中壓根沒有這個檔案。根據https://forums.virtualbox.org/viewtopic.php?f=10&t=52734,不用去管它。
2. /home/zjin/source/VirtualBox-4.2.8/src/bldprogs/checkUndefined.sh: following symbols not defined in the files
xxx:
__realpath_chk __memcpy_chk __sprintf_chk
根據https://forums.virtualbox.org/viewtopic.php?f=10&t=54337,建立LocalConfig.kmk,內容為
VBOX_JAVA_HOME := /usr/lib/jvm/java-6-openjdkVBOX_WITH_WARNINGS_AS_ERRORS :=VBOX_WITH_TESTCASES :=VBOX_WITH_TESTSUITE :=
3. jni.h: No such file or directory
LocalConfig.kmk中JDK路徑沒設好,確保VBOX_JAVA_HOME路徑下有include/jni.h。
4. 編譯tex檔案時出錯:
! I can't find file `bchr8t'.
<*> ...:=ljfour; mag:=1; nonstopmode; input bchr8t
Please type another input file name
! Emergency stop.
<*> ...:=ljfour; mag:=1; nonstopmode; input bchr8t
Transcript written on mfput.log.
! I can't find file `bchr8t'.
<*> ...:=ljfour; mag:=1; nonstopmode; input bchr8t
Please type another input file name
! Emergency stop.
<*> ...:=ljfour; mag:=1; nonstopmode; input bchr8t
根據http://michail.flouris.net/2010/07/using-the-tkiz-package-in-latex-on-rhel5-centos-fc-and-ubuntu-linux/,
$ sudo apt-get install texlive-fonts-recommended
即可解決。