__attribute__((dllexport)) bool exported_test_function()
{
std::cout << "Function Called Externally" << std::endl;
return true;
}
src/cpp.licenses.cpp:25:56: warning: ‘dllexport’ attribute directive ignored [-Wattributes]
25 | __attribute__((dllexport)) bool exported_test_function()
bin/Release/libdlicenses.so: file format elf64-x86-64
DYNAMIC SYMBOL TABLE:
0000000000000000 w D *UND* 0000000000000000 __cxa_finalize
0000000000000000 w D *UND* 0000000000000000 _ITM_registerTMCloneTable
0000000000000000 w D *UND* 0000000000000000 _ITM_deregisterTMCloneTable
0000000000000000 w D *UND* 0000000000000000 __gmon_start__
__attribute__((visibility("default"))) bool exported_test_function()
#if defined(BUILDING)
#define DLL_ATTR __declspec(dllexport)
#else
#define DLL_ATTR __declspec(dllimport)
#endif
Та же проблемаа, нету функции exported_test_function в таблице экспорта, как исправить?
$ cat > 1027136.cс
__attribute__((visibility("default"))) bool exported_test_function()
{
return true;
}
$ g++ -fPIC -shared 1027136.cc -o 1027136.so
$ objdump -T 1027136.so
1027136.so: file format elf64-x86-64
DYNAMIC SYMBOL TABLE:
0000000000000000 w DF *UND* 0000000000000000 GLIBC_2.2.5 __cxa_finalize
0000000000000000 w D *UND* 0000000000000000 _ITM_deregisterTMCloneTable
0000000000000000 w D *UND* 0000000000000000 __gmon_start__
0000000000000000 w D *UND* 0000000000000000 _ITM_registerTMCloneTable
00000000000010f5 g DF .text 000000000000000b Base _Z22exported_test_functionv