⑴ 求助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的时候出现这个问题,菜鸟不知道如何解决,同问。