Interesting Question
Hello all,
I''m using libtool to create modules for my engine. My module loader uses dlopen/dlsym/etc... to load a module''s exportFunc(const char*). The function when called with a proper id will instantiate the appropriate class and return it to the module loader (I actually do something a bit different book-keeping-wise).
This setup has worked for me before with normal classes. But when I want to use templated-classes (yes, the types are hard-coded, so these templates are actually specialized) I''ll run into problems.
Problems:
1. If no -fexport-dynamic is given when the module is compiled, dlopen will complain that a symbol within the class defined in the module is unresolved.
2. If the flag -fexport-dynamic is given then dlopen will complain about an unresolved symbol in the same class''s parent class, even though these symbols are defined in the executable! (Not sure if they are the exact same symbols).
Questions:
1. What flags would you use (assuming gcc) to ensure that all of the symbols declared and defined in the module''s source files are exported when the module is compiled/linked?
2. What flags would you use (once again, assuming gcc) to ensure that the unresolved symbols (concerning the parent class) in the module are resolved to the defined symbols in the executable?
3. Is this post too confusing? If you all want, I''ll elaborate, if asked.
Thanks,
joeG
joeG
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement