Reputation: 66955
So I wonder how my code that can be included into different projects can find out if it is included into library of application? (on Linux, Mac and Windows)
Upvotes: 1
Views: 122
Reputation: 153929
The simple answer is that it can't. The decision whether an object file (generated by the compiler) is part of a library or part of the application isn't made until link time (and aren't libraries part of the application?).
Upvotes: 4