开发者

How can I link glibc statically with qt

开发者 https://www.devze.com 2022-12-23 23:30 出处:网络
I have built a static version of qt and download a static version of glibc.Now I would like to link glibc statically to my qt application.I know about going into the .pro and adding the line LIBS += -

I have built a static version of qt and download a static version of glibc. Now I would like to link glibc statically to my qt application. I know about going into the .pro and adding the line LIBS += -L path/to/static_lib but I am wondering if these that is enough? Will it still link glibc statically even though the OS I am building on has the dynamic libraries also? The reason I am doing this is to deploy the application in a sta开发者_StackOverflow社区ndalone manner. (After installing and updating Red Hat 5.3 glibc_2.9 was not found on the target computer)


Passing -static to gcc will force it to link statically when possible.

Alternatively, download and install CentOS 5 and build on that.


As you discovered, linking fully statically with glibc is not possible, because for instance nss support is loaded dynamically. However, the required glibc version depends mostly on the features you actually use.

Anyway, I think you should instead use Linux Standard Base, also because of reasons exposed here.

0

上一篇:

:下一篇

精彩评论

暂无评论...
验证码 换一张
取 消