mirror of
https://github.com/maxDcb/C2TeamServer
synced 2026-06-06 16:14:27 +00:00
43 lines
563 B
C++
43 lines
563 B
C++
#include <iostream>
|
|
|
|
// g++ -fPIC -shared ./libtest.cpp -o libtest.so
|
|
|
|
class Test
|
|
{
|
|
public:
|
|
Test();
|
|
~Test();
|
|
};
|
|
|
|
|
|
#ifdef _WIN32
|
|
extern "C" __declspec(dllexport) Test * TestConstructor();
|
|
#else
|
|
extern "C" __attribute__((visibility("default"))) Test * TestConstructor();
|
|
#endif
|
|
|
|
|
|
#ifdef _WIN32
|
|
__declspec(dllexport) Test* TestConstructor()
|
|
{
|
|
return new Cat();
|
|
}
|
|
#else
|
|
__attribute__((visibility("default"))) Test* TestConstructor()
|
|
{
|
|
return new Test();
|
|
}
|
|
#endif
|
|
|
|
|
|
Test::Test()
|
|
{
|
|
std::cout << "Test Constructor" << std::endl;
|
|
}
|
|
|
|
|
|
Test::~Test()
|
|
{
|
|
}
|
|
|