Languages

Menu
Sites
Language
Shared object created using SDK 2.3 doesnt export symbols

Using Tizen SDK 2.3 for shared object creation.
I created a sample c file and h file and generated the .so file.

But the created .so file doesnt export the symbol (function) in the c file (checked using 'nm -D' command)
and I get link error for the symbol if tried to link with the application.

Any extra setting needed for this?

It works straight away in SDK 2.2.1.

Responses

4 Replies
Alex Dem

Hi,
I don't know exactly your way from description but I was able to add Shared Library into my project (lib/libSHARED.so) , configure Properties->C/C++Builds->Settings-> Tool Settings->C++Linker-> Libraries
after and call any method using eina_module:

    Eina_Module* module= eina_module_new  ("/opt/usr/apps/org.tizen.myapp/lib/libSHARED.so") ;
    eina_module_load(module);
    bool (*myfunc)(void);
    myfunc=  eina_module_symbol_get  ( module, "tizensharedlib1" );
    (*myfunc)();
    eina_module_unload(module);

It should work/I have checked on SDK 2.3.0rev2(Win64).
Alexey.

Alex Dem

Hi, just important note,
I have added shared library for 2.3.0 in accordance with this instruction:
https://developer.tizen.org/dev-guide/2.2.1/org.tizen.native.appprogramming/html/app_dev_process/adding_libraries_and_library_search_paths.htm
Alexey.

Alex Ashirov

Hi,

You can try to create your shared library using template:

File->New->Tizen Native Project  

Then go to Template tab, select Library->Shared Library

After that you may add additional functions into .c file and build your library:

Right click on the project and choose Build Project from dropdown menu.

Then go to Debug folder of your Project and run ‘nm –D yourlibname.so’ You should be able to observe exported functions.

Gururaj Bhat

Hi Alex,

Thanks for the reposnse.

My problem was actually in the creation of the shared library.

The created .so was not exporting the symbols.

I was using SDK 2.3 Rev1.

I upgarded to Rev2 and it is working fine , but we need to add EXPORT_API prefix to
function declarations to export them.

In Rev1 even with EXPORT_API prefix the symbols are not exported.

So I am assuming it is broken in Rev1.

Regards.
Gururaj