linux 下 POCO 安装
来源:互联网 发布:罗永浩大战王自如知乎 编辑:程序博客网 时间:2024/06/09 18:39
之前必须确定 openssl 和 Mysql 安装了,如果你不想安装这两个可以在下面的排除选项中排除它. 我这里不需要 ODBC和 SQListe ,安装路径为 /usr ,它会把头文件安装在/usr/include/Poco下, lib文件安装在 usr/lib下
参数解释: --omit 排除(不编译的), --prefix安装路径
> sudo ./configure --omit=Data/ODBC,Data/SQLite --prefix=/usr --static --shared
> sudo make -s install
PS:
如果没有 --static --shared 默认为 shared 不编译静态库
如果在x64的系统下使用到静态库 .记得一定要加-fPIC,动态库不用.
./configure --omit=Data/ODBC,Data/SQLite --prefix=/usr --cflags=-fPIC --static
gmake -s install
否则会出现这类的错误:
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../
....
can not be used when making a shared object; recompile with -fPIC
如果你的是Centos x64 z可能会报一些没有库的错误.
例如
/usr/bin/ld: cannot find -lpthread
collect2: ld returned 1 exit status
make[1]: *** [/root/poco-1.4.3p1-all/PageCompiler/bin/Linux/x86_64/static/cpspcd] Error 1
make: *** [PageCompiler-libexec] Error 2
这个表示没有找到共享库libpthread
可以在 /usr 下搜索一下这个库在哪, 然后做个软链接到 /user/lib64 下就行了.
例如:
[root@localhost ~]# find /usr/ -name libpthread*
/usr/lib/x86_64-redhat-linux5E/lib64/libpthread_nonshared.a
/usr/lib/x86_64-redhat-linux5E/lib64/libpthread.so
/usr/lib/x86_64-redhat-linux5E/lib64/libpthread.a
/usr/lib64/libpthread_nonshared.a
/usr/lib64/libpthread.so
/usr/lib64/libpthread.a
如果没有找到 libpthread.a 哪安装一个 glibc-static
yum install glibc-static
小技巧:
如果你不知道某个库文件属于库的话 可以使用 yum provides 来搜索它.
以上面的libpthread.a为例:
yum provides \*/libpthread.a
- linux 下 POCO 安装
- poco linux安装
- centos下安装ice和poco c++
- C++框架库--POCO学习: 一 Linux下的编译和安装
- Poco stlPort 安装
- Poco c ++ 库安装
- POCO安装并测试
- POCO库 安装
- centos7.2 安装poco
- windows下搭建poco库
- vs2008 安装编译poco c++
- vs2008编译安装poco库
- 在Linux/centos下,如何将poco库添加到qtcreator中
- POCO
- poco库学习笔记(1) poco库的安装
- Poco库下的编码转换
- 【Poco】Poco1.4.4 Win7 VS2010安装配置
- poco for ARM的安装及使用
- mvc.net 实现对Controller层的单元测试
- ArrayList Vector LinkedList
- C# 简单的ZEBRA标签打印程序
- PowerDesigner导入SQL生成数据模型
- 俺的小网站,有小论坛了
- linux 下 POCO 安装
- Java并发学习笔记(12)避免活跃度危险(死锁)
- poj 1655 Balancing Act
- Java并发学习笔记(13)线程之间的协作(Object.wait(),notifu(),notifyAll() Thread.join())
- openvz和xen两种虚拟技术(VPS)的对比
- JAVA --String类笔试面试题
- hibernate.bytecode.use_reflection_optimizer
- 常见的网络服务器软件综合比较介绍(apache、IIS、tomcat、jboss、resin、weblogic、websphere)
- 矩阵类的实现,运算符重载