编译共享库到一个程序? [英] Compile shared library into a program?

查看:122
本文介绍了编译共享库到一个程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个程序,使用安装在我的系统上的共享库。此库很少安装在其他系统。我如何编译我的程序,使该库并不需要在其他系统上安装的?我源$ C ​​$ C可用库中。什么是最好的方法是什么?

I wrote a program, that uses a shared library installed on my system. This library is seldom installed on other systems. How do I compile my program so that the library doesn't need to be installed on other systems? I have the source code for the library available. What's the best way?

当然,其他的系统具有相同的结构和OS

The other systems of course have the same architecture and OS.

推荐答案

编译为静态库,并链接到可执行文件。

Compile it as a static library and link that into the executable.

这篇关于编译共享库到一个程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆