linux - Using C++ classes in .so libraries -
i'm trying write small class library c++ course.
i wondering if possible define set of classes in shared object , using them directly in main program demos library. there tricks involved? remember reading long ago (before started programming) c++ classes worked mfc .dlls , not plain ones, that's windows side.
c++ classes work fine in .so shared libraries (they work in non-mfc dlls on windows, that's not question). it's easier windows, because don't have explicitly export symbols libraries.
this document answer of questions: http://people.redhat.com/drepper/dsohowto.pdf
the main things remember use -fpic
option when compiling, , -shared
option when linking. can find plenty of examples on net.
Comments
Post a Comment