openoffice編譯

編譯openoffice是個費力的活,建議最好建個虛擬機,在虛擬機裏跑,編譯環境很重要,說不了裝的什麼軟件就會影響編譯,想我電腦裝了UItraEdit,關聯了js格式文件就導致編譯openoffice出錯,而且報的錯誤會往其他方向上誤導。

編譯具體步驟我就不說了我貼上官方的方法http://wiki.openoffice.org/wiki/Documentation/Building_Guide_AOO/Step_by_step#Windows_7大家可以照着這個一步一步來,編譯中我遇到了幾個問題跟大家說下。

一、配置環境

有幾種方法

1.

./configure 
 --disable-build-mozilla 
 --with-mozilla-build="/cygdrive/d/OOo/mozilla-build-1.3" \
 --with-cl-home="/cygdrive/c/Program Files/Microsoft Visual Studio 9.0/VC" \
 --with-mspdb-path="/cygdrive/c/Program Files/Microsoft Visual Studio 9.0/Common7/IDE" \
 --with-frame-home="/cygdrive/c/Program Files/Microsoft SDKs/Windows/v6.1" \
 --with-psdk-home="/cygdrive/c/Program Files/Microsoft SDKs/Windows/v6.1" \
 --with-midl-path="/cygdrive/c/Program Files/Microsoft SDKs/Windows/v6.1/Bin" \
 --with-asm-home="/cygdrive/c/Program Files/Microsoft Visual Studio 9.0/VC/Bin" \
 --with-csc-path="/cygdrive/c/WINDOWS/Microsoft.NET/Framework/v3.5" \
 --with-jdk-home="/cygdrive/c/j2sdk1.5.0.06" \
 --with-directx-home="/cygdrive/d/OOo/DirectXSDK" \
 --with-ant-home=/ant \
2.

MSVC_HOME="/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 9.0"
SDK_PATH="/cygdrive/C/Program Files/Microsoft SDKs/Windows/v6.1"
./configure \
    --with-cl-home="$MSVC_HOME/VC" \
    --with-mspdb-path="$MSVC_HOME/Common7/IDE" \
    --with-asm-home="$MSVC_HOME/VC/Bin" \
    --with-frame-home="$SDK_PATH" \
    --with-psdk-home="$SDK_PATH" \
    --with-midl-path="$SDK_PATH/bin" \
    --with-directx-home="c:/Program Files (x86)/Microsoft DirectX SDK (June 2010)" \
    --with-jdk-home="/cygdrive/C/Program Files/Java/jdk1.6.0_45" \
    --with-csc-path="/cygdrive/C/Windows/Microsoft.NET/Framework/v3.5" \
    --with-ant-home="/cygdrive/c/apache-ant-1.9.0" \
    --with-dmake-url="http://dmake.apache-extras.org.codespot.com/files/dmake-4.12.tar.bz2" \
    --with-epm-url=http://ftp.easysw.com/pub/epm/3.7/epm-3.7-source.tar.gz \
    --enable-pch \
    --disable-atl \
    --disable-activex \
    --disable-binfilter \
    --without-junit

3.

./configure \
-with-cl-home='C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC' \
-with-mspdb-path='C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE' \
-with-asm-home='C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin' \
-with-csc-path='C:\Windows\Microsoft.NET\Framework\v3.5' \
-with-frame-home='C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A' \
-with-psdk-home='C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A' \
-with-midl-path='C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin' \
-with-jdk-home='C:\Program Files\Java\jdk1.7.0_21' \
-with-ant-home='C:\apache-ant-1.9.0' \
-with-dmake-url="http://dmake.apache-extras.org.codespot.com/files/dmake-4.12.tar.bz2" \
-with-epm-url="http://ftp.easysw.com/pub/epm/3.7/epm-3.7-source.tar.gz" \
-enable-pch \
-disable-directx \
-disable-atl \
-disable-activex \
-disable-binfilter \
-without-junit \
-enable-dbgutil 

第一種方法我沒配置通過,路徑不能識別,2、3都能配置通過。2是通過建立臨時路徑3是windows下尋找路徑的方法。當然相應的路徑你的根據自己的去配置。

別注意用vs2010的話要配置-with-cl-home='C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC' \的路徑,配置10的話編譯通不過,編譯到libxml2時會報連接錯誤,配置

9.0就不會出這個錯誤。java要用1.6不要用1.7如果執行./configure是報c++編譯器太老不是新版本的話就配置下系統環境變量把C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE加到path環境變量裏。

二。代碼錯誤

libxml2模塊裏代碼有誤,testapi.c裏294行static xmlChar gen_xmlChar(int no, int nr ATTRIBUTE_UNUSED) {
    if (no == 0) return('a');
    if (no == 1) return(' ');
    //if (no == 2) return((xmlChar) '?);
    if (no == 2) return((xmlChar) '\xf8');
    return(0);
}把那個?替換成\xf8。

bean模塊代碼也有問題,編譯通不過提示如下圖錯誤

我修改了一下com_sun_star_comp_beans_LocalOfficeWindow.c裏的代碼就可以通過編譯了直接把110行的result = JAWT_GetAWT(env, &awt);這句代碼註釋掉。



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章