这是Dynamic Shared Library compilation with g++的后续行动.
I'm trying to create a shared class library in C++ on Linux. I'm able to get the library to compile, and I can call some of the (non-class) functions using the tutorials that I found here and here. My problems start when I try to use the classes that are defined in the library. The second tutorial that I linked to shows how to load the symbols for creating objects of the classes defined in the library, but stops short of using those objects to get any work done.
有没有人知道一个更完整的教程,用于创建共享C++类库,它还演示了如何在单独的可执行文件中use个类?这是一个非常简单的教程,展示了对象的创建、使用(简单的getter和setter就可以了),以及删除.链接或引用一些开源代码来说明共享类库的使用也同样好.
Although the answers from codelogic and nimrodm do work, I just wanted to add that I picked up a copy of Beginning Linux Programming since asking this question, and its first chapter has example C code and good explanations for creating and using both static and shared libraries. These examples are available through Google Book Search in an older edition of that book.