简体   繁体   中英

Should I add whole library to my project in c++

I am pretty new to c++. At the moment I am working on ONNX involving project and I have a question, if I have to make my application portable (assuming that person which will be using it does not have installed onnx on their machine) do I have to install whole library in my project folder or how should I do it?

Thanks for help

So one option is to link all your libraries statically, so the person using the application does not need to have a particular library installed on their machine

See this Q/A:

Compiling a static executable with CMake

I recommend setting up a CI machine where these libraries are available (or better yet with a reproducible installation script/container configuration) ( yes this represents some work to set up for you) and then giving the statically linked binaries buit on this machine to your clients (so no hassle for them).

You'll read online about potential compatibility issues with statically linked binaries and complaints about exe size (some people believe -static is evil), but honestly this approach puts the least strain possible on client configuration.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM