#Is it allowed to have an extern function from a library that's not linked if it's unused?

1 messages · Page 1 of 1 (latest)

dark sparrow
#

I'm working on xcb bindings, and I have some stuff from the xcb shape API since I'm using it for a project, but I don't know if I need to do anything extra to check if the library exists or not or if I can just ignore it and write the bindings normally and it'll work without linking as long as they don't use those functions

lofty trout
#

As long as you don't reference those functions from your main file, there won't be link errors

#

So yes, you can have an extern function that refers to a library that isn't linked, as long as that function is never used