I am working on a simple C++ reflection system to use in my own library. I went for a manual registration by using static member per each class that has side effects in the constructor - it actually registers the class in the system.
Everything seemed to be fine until I found out that some of the types are not properly registered. After research I came to conclusion that this is because linker is refusing to link members from a translation unit that is not referenced (I am building a static library) anywhere in build executable.
My question is the following, are there any tricks/hacks, even platform specific ones, that would force linker to link to selected translation units.
Or even better, is there any solid alternative for described method of self registering classes.