5

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

Rahul Gulia
  • 57
  • 1
  • 3

1 Answers1

4

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.

user213305
  • 402
  • 2
  • 10
  • For more about libraries see also: https://stackoverflow.com/questions/2766233/what-is-the-c-runtime-library, https://stackoverflow.com/questions/140061/when-to-use-dynamic-vs-static-libraries and https://stackoverflow.com/questions/9688200/difference-between-shared-objects-so-static-libraries-a-and-dlls-so?rq=1 – user213305 May 24 '21 at 11:31