Linking Statically with glibc and libstdc++

后端 未结 4 2151
遥遥无期
遥遥无期 2020-12-07 19:41

I\'m writing a cross-platform application which is not GNU GPL compatible. The major problem I\'m currently facing is that the application is linked dynamically with glibc a

4条回答
  •  悲哀的现实
    2020-12-07 19:51

    You don't need to.

    Copy the original libraries you linked against to a directory (../lib in this example) in your application folder.

    Like:

    my_app_install_path

    1. .bin
    2. lib
    3. documentation

    Rename you app for something like app.bin. Substitute your app for a little shell script that sets the enviroment variable LD_LIBRARY_PATH to the library path (and concatenate the previous LD_LIBRARY_PATH contents, if any). Now ld should be able to find the dynamic libraries you linked against and you don't need to compile them statically to your executable.

    Remember to comply with the LGPL adding the given attribution to the libraries and pointing in the documentation where the source can be downloaded.

提交回复
热议问题