When I am using a non-standard library in C++ I have to add the library name in linker-->input-->additional dependencies . But the alternative is to write
#pragma comment(lib , "library name")
Are these two methods completely the same?
They are not.
The said pragma adds a defaultlib. The option a mandatory lib to the linker line.
The latter is processed no matter what, and you get error if it is missing. The default lib is ignored silently if not found. And using options "ignore default libs" or "ignore specific default lib" can be used to dismiss its use even if it is present.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With