導航:首頁 > 源碼編譯 > 編譯安裝libxml

編譯安裝libxml

發布時間:2022-09-01 22:59:58

⑴ 求助QT5.4 安裝在win8.1後無法編譯

關於QT安裝時出現錯誤請參照我的上一篇文章http://hi..com/whyme%CE%DE%CF%DE/blog/item/91103d1a71f4aed5e2fe0b65.html
現在說一下編譯運行出錯的解決辦法:
說明:redhat紅帽5.4有點太老了,所以運行最新的QT時,出現了各種問題,最主要的就是各種庫的問題:
(1)undefined reference to `FcFreeTypeQueryFace'的問題
需要更新fontconfig,我用的是fontconfig-2.6.0.tar.gz,2.5.0我試了,出現了很多錯誤,不知道為什麼2.6.0可以,
附下載地址http://115.com/file/be9m2r
解壓到/usr/src 進入後 ./autogen.sh 然後終端中提示make,你就make,最後make install。完成。./autogen.sh也可以輸入./configure --sysconfdir=/etc --prefix=/usr --mandir=/usr/share/man 具體可能是./configure後指明了安在你想要安得地方吧(我用的是./autogen.sh)
如果期間遇到錯誤不要不耐煩,按照提示網路一下會有解決的辦法的。
(2)undefined reference to 'FT_Library_SetLcdFilter'
這是由於freetype太舊的原因,也是一樣,需要更新:
附下載地址:http://115.com/file/anwcxdfk
安裝方法與(1)一樣。也有安裝(1)時可能有問題要先安裝(2) 這個自己嘗試吧,我是先(1)後(2)的。
還有就是我的系統是紅帽企業版5.4,不是的或者版本不一樣的,我不知道我的方法有沒有效果。
(3)接下來應該有的常式就可以編譯運行了,但是還有不能運行的,那是因為你的glibc太舊了,這個是c動態庫。必須注意的是,幾乎所有的應用程序都依賴於glibc的動態庫,重新編譯安裝glibc必須非常謹慎,一旦出錯可能導致系統無法繼續使用。所以強烈建議閱讀源碼目錄下的INSTALL。
附下載地址:http://115.com/file/e749sc6n
第一步是配置glibc,出於安全的考慮,glibc不允許在源碼目錄樹下編譯,必須新建一個目錄,然後在新建目錄下運行configure,我就在/usr/src下建了一個glibc文件夾mkdir glibc。然後在新建目錄里運行解壓縮文件中的config,在運行這個之前,先在終端運行需要加上優化開關export CFLAGS="-g -O2 -march=i686" ,然後運行../glibc/configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin 這樣就不是默認安裝的路徑了安裝在/usr下,這會將glibc安裝為linux系統的標准庫。
執行make -j 。glibc的編譯相當耗時,可以給make加上-j選項並行編譯glibc。make -j
然後make install。
make時可能會有錯誤我就遇到了以下錯誤,我是這么解決的:
1、在編譯glibc的過程中可能出現錯誤:「../sysdeps/i386/fpu/s_frexp.S:66: Error: invalid identifier for ".ifdef"」,解決方法是:
1)、在glibc源碼目錄下找到文件:nptl/sysdeps/pthread/pt-initfini.c,找到第46行附近:asm ("\n#include "defs.h"");在其後添加代碼:
asm ("\n#if defined __i686 && defined __ASSEMBLER__");
asm ("\n#undef __i686");
asm ("\n#define __i686 __i686");
asm ("\n#endif");
2)、在glibc源碼目錄下找到文件:sysdeps/unix/sysv/linux/i386/sysdep.h,找到第30行附近:#include <tls.h>,在其後添加代碼:
#if defined __i686 && defined __ASSEMBLER__
#undef __i686
#define __i686 __i686
#endif
重新make
2、在編譯glibc的過程中可能出現錯誤:「./sysdeps/i386/i686/multiarch/strcmp.S:78: Error: Error: unrecognized symbol type "gnu_indirect_function"unrecognized symbol type "gnu_indirect_function"」,原因是沒有安裝新版的binutils,如果依照前面的步驟安裝了binutils-2.21應該不會出現該錯誤。(注第2個錯誤我沒遇到)
註:還有一個地方不知道是哪一步遇到錯誤了需要安裝libxml我在紅帽的系統鏡像中的server中找到了三個相關文件libxml2*.rpm安裝即可!!!!!!
至此,重啟reboot,打開QT運行常式,可能還有問題,我的就是還是有問題,解決辦法如下:
把QT的安裝目錄和QT中的bin都添加為環境變數,在/etc/profile下,具體怎麼填您應該知道吧,這里不提了。source /etc/profile一下
然後再點擊QT的左邊欄的項目在構建和運行的選項中,您可能哪裡沒有選擇,一定要讓你的項目有效和目錄正確,QT的版本正確!!!QT的gcc編譯目錄正確,gcc一般用的是QT文件中自帶的!!如果還不行,那就在你的在項目目錄項運行make clean!!如果還不對!!!vi Makefile 可能是這里有問題,如果不會改,就乾脆刪了rm Makefiel。然後再在QT中運行一下。

⑵ 編譯安裝python需要哪些依賴

依賴庫:
//使用apt
安裝即可
1.gcc,
make,
zlib1g-dev(壓縮/解壓縮庫)
安裝過程需要的庫。
2.libbz2-dev
bz2支持庫,若在編譯安裝python前沒有安裝,將無法通過pip
install
安裝提供bz2格式的第三方庫,會出現unsupported
archive
format:
.tar.bz2的錯誤,例如爬蟲庫Scrapy依賴的Twisted。
3.libsqlite3-dev
sqlite3支持庫,若在編譯安裝python前沒有安裝,則python中會缺失sqlite3模塊,當引入sqlite3或使用依賴sqllite3的第三方庫(例如Scrapy)時,會出現ImportError:
No
mol
named
_sqllite3的錯誤。
//以上為編譯安裝前需要安裝的庫,可能不夠全面,會不斷補充。
4.其他:安裝第三方庫需要的庫
python3-dev,
libxml2-dev,
libxslt1,
libffi-dev,
libssl-dev等,在安裝第三方庫會有具體說明,不做過多解釋。
安裝:
//通過wget獲取壓縮包,這里選擇3.6.1版
wget
https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tar.xz
//解壓
tar
xJf
Python-3.6.1.tar.xz
cd
Python-3.6.1
./configure
make
/*這步如果需要sudo,請使用sudo
-H命令,即sudo
-H
make
install,避免pip等模塊安裝失敗。
錯誤示例(pip安裝失敗):The
directory
'/home/ls/.cache/pip'
or
its
parent
directory
is
not
owned
by
the
current
user
and
caching
wheels
has
been
disabled.
check
the
permissions
and
owner
of
that
directory.
If
executing
pip
with
sudo,
you
may
want
sudo's
-H
flag.
*/
make
install

⑶ python導入libxml2dom不成功,求助

最近一個python項目需要用到libxml2dom這個包,然後就pip安裝之,之後驗證安裝是否成功:

shandow@mac:~ > python

Python 2.7.5 (default, Mar 9 2014, 22:15:05)

[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin

Type "help", "right", "credits" or "license" for more information.

>>> import libxml2dom

Traceback (most recent call last):

File "<stdin>", line 1, in <mole>

File "/Library/Python/2.7/site-packages/libxml2dom/__init__.py", line 24, in <mole>

from libxml2dom.macrolib import *

File "/Library/Python/2.7/site-packages/libxml2dom/macrolib/__init__.py", line 26, in <mole>

from libxml2dom.macrolib.macrolib import *

File "/Library/Python/2.7/site-packages/libxml2dom/macrolib/macrolib.py", line 30, in <mole>

from libxmlmods import libxml2mod

ImportError: No mole named libxmlmods

意思是缺乏libxmlmods庫,使用pip安裝之,提示找不到。。。。好吧,度娘問吧,找到一個類似libxml2dom的官方聲明似的網站:

libxml2dom

Current release: libxml2dom 0.5 (requiring the low-level libxml2 Python bindings, typically provided by the python-libxml2 or libxml2-python packages for various GNU/Linux distributions: Ubuntu, Debian, Fedora, Red Hat, SuSE)
Introction
The libxml2dom package provides a traditional DOM wrapper around the Python bindings for libxml2. In contrast to the standard libxml2 bindings, libxml2dom provides an API reminiscent of minidom, pxdom and other Python-based and Python-related XML toolkits. Performance is fairly respectable since libxml2dom makes direct use of libxml2mod - the low-level wrapping of libxml2 for Python. Moreover, serialisation of documents is much faster than many other toolkits because libxml2dom can make direct use of libxml2 rather than employing Python-level mechanisms to visit and serialise nodes.
Copyright and Licence
libxml2dom is licensed under the LGPL version 3 (or later).

這里第一句話就是libxml2dom依賴libxml2庫,可以通過查找python-libxml2或者libxml2-python下載,可是偶使用pip安裝都提示找不到資源。。。。好吧,再次度娘,手動下載了這個包。這里貼出我分享出來的地址:libxml2下載(我的是mac
os系統,windows系統的自行下載吧,哈哈。。。)再說下mac os下如何安裝:
1.先把下載的tar包放到自己python環境的site-packages,我的是:
/Library/Python/2.7/site-packages
2.解壓:sudo tar -xvf libxml2-2.7.8.tar
3.進入解壓後的文件夾,由於是源碼包需要編譯安裝:
cd libxml2-2.7.8
sudo ./configure
sudo make
sudo make install
好了,如果沒有報錯就ok了,測試下把:
python
import libxml2
提示沒有這個模塊,說明沒有導成功,郁悶。。。。
重新進入文件夾 :
cd libxml2-2.7.8
發現這個文件夾中有個python文件夾,進入:

shandow@mac:/Library/Python/2.7/site-packages/libxml2-2.7.8 > cd python/
shandow@mac:/Library/Python/2.7/site-packages/libxml2-2.7.8/python > ll
total 5704
-rw-r--r-- 1 root network 132 11 17 10:46 MANIFEST
-rw-r--r-- 1 root network 31357 11 17 10:43 Makefile
-rw-rw-r--@ 1 50138 network 1542 11 4 2010 Makefile.am
-rw-rw-r--@ 1 50138 network 32443 11 5 2010 Makefile.in
-rw-rw-r--@ 1 50138 network 1272 9 24 2009 README
-rw-rw-r--@ 1 50138 network 1623 9 24 2009 TODO
drwxr-xr-x 4 root network 136 11 17 10:46 build
-rw-rw-r--@ 1 50138 network 15061 9 24 2009 drv_libxml2.py
-rw-r--r-- 1 root network 0 11 17 10:44 gen_prog
-rwxrwxr-x@ 1 50138 network 47541 10 16 2010 generator.py
-rw-rw-r--@ 1 50138 network 104464 11 3 2010 libxml.c
-rw-r--r-- 1 root network 271 11 17 10:44 libxml.lo
-rw-r--r-- 1 root network 297240 11 17 10:44 libxml.o
-rw-rw-r--@ 1 50138 network 22817 10 12 2010 libxml.py
-rw-r--r-- 1 root network 126532 11 17 10:44 libxml2-export.c
-rw-r--r-- 1 root network 434813 11 17 10:44 libxml2-py.c
-rw-r--r-- 1 root network 112512 11 17 10:44 libxml2-py.h
-rw-r--r-- 1 root network 283 11 17 10:44 libxml2-py.lo
-rw-r--r-- 1 root network 819684 11 17 10:44 libxml2-py.o
-rw-rw-r--@ 1 50138 network 18669 10 12 2010 libxml2-python-api.xml
-rw-r--r-- 1 root network 341257 11 17 10:44 libxml2.py
-rw-r--r-- 1 root network 318440 11 17 10:44 libxml2class.py
-rw-r--r-- 1 root network 22768 11 17 10:44 libxml2class.txt
-rw-r--r-- 1 root network 1166 11 17 10:44 libxml2mod.la
-rw-rw-r--@ 1 50138 network 7277 10 12 2010 libxml_wrap.h
-rwxr-xr-x 1 root network 6685 11 17 10:43 setup.py
-rwxrwxr-x@ 1 50138 network 6707 9 24 2009 setup.py.in
drwxrwxr-x@ 55 50138 network 1870 11 17 10:43 tests
-rw-rw-r--@ 1 50138 network 21068 10 12 2010 types.c
-rw-r--r-- 1 root network 268 11 17 10:44 types.lo
-rw-r--r-- 1 root network 63320 11 17 10:44 types.o
shandow@mac:/Library/Python/2.7/site-packages/libxml2-2.7.8/python >
參照網上說的python第三方包的安裝方式:
sudo python setup.py build
sudo python setup.py install
這兩句運行完後,重新進入site-packages文件夾,發現多了libxml2的egg-info文件:

再次測試:

shandow@mac:/Library/Python/2.7/site-packages > python
Python 2.7.5 (default, Mar 9 2014, 22:15:05)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "right", "credits" or "license" for more information.
>>> import libxml2
>>> import libxml2dom
>>>
libxml2安裝成功了,libxml2dom也不會報錯了,大功告成。。。。。網上網路,google都沒有這個問題的解決辦法,作者這里原創一個,哈哈。。。

⑷ 我發現我在操作php的時候,在Linux下安裝PHP過程中,編譯時出現configure: err

其實有些東西我也講不太清楚,你可以參考下我的意見。nxu安裝 PHP:

yum -y install libxml2 libxml2-devel 下載安裝libxml2,通過libxml2編譯安裝PHP

./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with
最保險的方法是,多去後盾人看一下教學視頻,這樣更加有用。

⑸ 如何安裝libxml2和iconv

你沒有這個libxml2包,你需要去下載一個libxml2-2.6.20.tar.gz,然後進行編譯安裝 編譯步驟: # wget # tar zxvf libxml2-2.6.32.tar.gz# cd libxml2-2.6.32.tar.gz# ./configure# make && make install你選取標簽中的網址即刻

⑹ centos安裝web伺服器時候要裝libxml2,但是centos默認已經裝了低版本的,我刪除低版本的libxml2系統就開不

yum install libxml2
試試

⑺ ubuntu10.04在編譯安裝LAMP環境的時候,編譯安裝libxml包的時候,提示以下錯誤,在配置過程中是沒問題的

我也是在make的時候出現這個問題,菜鳥不知道如何解決,同問。

閱讀全文

與編譯安裝libxml相關的資料

熱點內容
伺服器的雙電是什麼意思 瀏覽:614
程序員離開後代碼運行幾天 瀏覽:386
多多樂app是什麼幹嘛的 瀏覽:346
文檔加密授權工具 瀏覽:436
命令與征服將軍閃退 瀏覽:132
vs2019預編譯怎麼設置 瀏覽:780
沈陽中軟python培訓班 瀏覽:493
逆戰文件夾怎麼放 瀏覽:120
怎麼統一刪除文件夾raw文件 瀏覽:121
卡爾曼濾波演算法書籍 瀏覽:769
安卓手機怎麼用愛思助手傳文件進蘋果手機上 瀏覽:844
安卓怎麼下載60秒生存 瀏覽:803
外向式文件夾 瀏覽:240
dospdf 瀏覽:431
怎麼修改騰訊雲伺服器ip 瀏覽:392
pdftoeps 瀏覽:496
為什麼鴻蒙那麼像安卓 瀏覽:736
安卓手機怎麼拍自媒體視頻 瀏覽:186
單片機各個中斷的初始化 瀏覽:724
python怎麼集合元素 瀏覽:481