How to package c++ dependencies on linux -


i'm developing c++ program on ubuntu 16.04 using cmake, compiling g++5 , clang++-3.8.

now i'd make program availabile 14.04, too, i'm using lot of c++14 features can't recompile on system. instead, wanted ask if/how possible package dependencies (in particular c++ standard library) in way can unpack folder on target system , run app.

ideally i'm looking automated/scripted solution can add cmake build.

bonus question:
now, simple command line program can recompile 3rd party dependencies (and in fact do). in long run however, i'd port qt application. ideally solution work scenario.

the worst part of contitions incompatible standard library. have link statically anyway (see comments answer).

a number of options:

completely static linking:

i think it's easiest way you, requires can build (or way) third-party libs static. if can't reason it's not option.

you build app usual , link libs need statically (see documentation compiler). dependencies-free executable, work on abi-compatible system (you may need check if x86 executable works on x86_64).

partially static linking

you link statically can , dynamically other. distribute dynamic libs (*.so) along app (in path/to/app/lib or path/to/app/ folder), don't depend on system libraries. create deb package brings files /opt or $home/appname folder. have load dynamic libs either "by hand" or ask compiler on linking stage (see documentation).

docker container

i don't know know requires docker installed on target system (not option).

useful links:

g++ link options

static linking manual

finding dynamic or shared libraries

there similar docs clang, google it.


Comments

Popular posts from this blog

python - Selenium remoteWebDriver (& SauceLabs) Firefox moseMoveTo action exception -

html - How to custom Bootstrap grid height? -

transpose - Maple isnt executing function but prints function term -