Clion c++ executable vs C++ library

Viewed 2420

I am new to the C++ language. And when I start building a new project, I can see two options. C++ Executable and C++ Library.

I have tried looking for their difference at a lot of places, but could not get anything. Can someone please guide me to a correct answer on this topic?

Thanks

For reference

1 Answers

If you're building a self standing program, you'll want an executable.

But you might be building a library of functions/classes that provide utility to someone else or another project. In that case you'll want other programs to be able to link against the library to access those functions/classes, either statically - to compile the library into their project - or dynamically to fetch stuff the library at runtime.

Related