poco mysql 安装_linux 下 POCO 安装

之前必须确定

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可能会报一些没有库的错误.

例如

* Building executable (debug)

/root/poco-1.4.3p1-all/PageCompiler/bin/Linux/x86_64/static/cpspcd

/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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值