In reply to @kromatik_19473 "i need a plugin": Not directly answering the question, but I wrote something similar to this for a dlc system in my game (allowed me to separate functions into a seperate dll/so file while keeping the same calling syntax), used macros to make a pragma that decided wether to call the function in the dll if it's the main executeable compiling, or if it should emit the dll code to the current object. If this fits your usecase I'd be glad to share code, moving it to a nimble lib eventually but itd be nice to test somewhere else.