Languages

Menu
Sites
Language
build a shared library on Tizen WITHOUT SDK

Hi All,

Maybe this is a dump question, but I still want to know that is there a proper way to build a shared library WITHOUT SDK and the IDE env ?

I was porting some property library from android to tizen, on Android all we need is creat a Android.mk file then build our property source as a sub-module.  I'm a totally newbie to tizen, so my question is what's the proper way to build a shared library on tizen ?

Thanks

Alan

Responses

8 Replies
Alex Ashirov

Hi,

I am not sure that I understand your requirements properly. But anyway, the link below explains how to use command line interface in order to build Tizen native binaries without the Tizen SDK IDE. However, it still requires Tizen SDK installed. But hopefully, this helps you to solve your problem.

https://developer.tizen.org/dev-guide/2.2.1/org.tizen.native.appprogramming/html/ide_sdk_tools/command_line_interface.htm

Alex Dem

Hi,
To use CLI you will need to install Tizen SDK at minimum. If you have installed Tizen SDK you are able to create required project using IDE, go to New>Project->Tizen Native project->Library (Shared, Static, or NPShared libraries) to build library with desired architecture and compiler.
Alexey.

Gary V

Alan,

A shared library is built on Android in order to provide a module that can be dynamically loaded and accessed at runtime by a Java virtual machine through JNI. However, the Android SDK (tools and platform includes/libraries) is still used in order to cross-compile for the ARM architecture using a x86 processor.

Analogously, you can build a shared library without the Tizen SDK, but you would be building a x86 Linux library, instead of cross-compiling for the ARM architecture.

Try the Tizen IDE, File >> New >> Tizen Native Project, Template >> Library >> Shared Library. However, it is easier to use a Static Library, since it can be linked directly to a Tizen executable anyway, as opposed to having to be located at runtime.

Gary

Alan Wang

Thanks for you reply, I build my shared library with tizen IDE. But I meet another problem that when I use readelf command on my .so I got message as below:

 0x00000001 (NEEDED)                     Shared library: [libosp-uifw.so.1]    
 0x00000001 (NEEDED)                     Shared library: [libosp-appfw.so.1]
 0x00000001 (NEEDED)                     Shared library: [libosp-image.so.1]
 0x00000001 (NEEDED)                     Shared library: [libosp-json.so.1]
 0x00000001 (NEEDED)                     Shared library: [libosp-ime.so.1]
 0x00000001 (NEEDED)                     Shared library: [libosp-net.so.1]
 0x00000001 (NEEDED)                     Shared library: [libosp-content.so.1]
 0x00000001 (NEEDED)                     Shared library: [libosp-locations.so.1]
 0x00000001 (NEEDED)                     Shared library: [libosp-telephony.so.1]
 0x00000001 (NEEDED)                     Shared library: [libosp-uix.so.1]
 0x00000001 (NEEDED)                     Shared library: [libosp-media.so.1]
 0x00000001 (NEEDED)                     Shared library: [libosp-messaging.so.1]
 0x00000001 (NEEDED)                     Shared library: [libosp-web.so.1]
 0x00000001 (NEEDED)                     Shared library: [libosp-social.so.1]
 0x00000001 (NEEDED)                     Shared library: [libosp-wifi.so.1]
 0x00000001 (NEEDED)                     Shared library: [libosp-bluetooth.so.1]
 0x00000001 (NEEDED)                     Shared library: [libosp-nfc.so.1]
 0x00000001 (NEEDED)                     Shared library: [libosp-face.so.1]
 0x00000001 (NEEDED)                     Shared library: [libosp-secure-element.so.1]
 0x00000001 (NEEDED)                     Shared library: [libosp-speech-tts.so.1]
 0x00000001 (NEEDED)                     Shared library: [libosp-shell.so.1]
 0x00000001 (NEEDED)                     Shared library: [libosp-shell-core.so.1]
 0x00000001 (NEEDED)                     Shared library: [libosp-speech-stt.so.1]
 0x00000001 (NEEDED)                     Shared library: [libosp-vision.so.1]
 0x00000001 (NEEDED)                     Shared library: [libxml2.so.2]
 0x00000001 (NEEDED)                     Shared library: [libalut.so.0]
 0x00000001 (NEEDED)                     Shared library: [libopenal.so.1]
 0x00000001 (NEEDED)                     Shared library: [libstdc++.so.6]
 0x00000001 (NEEDED)                     Shared library: [libm.so.6]
 0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]

I don't think  library libosp-* is needed here.

Can anyone guide me that How can I remove the dependency of libraries like libosp-uifw.so.1.

 

Thanks

 

Dongsheng Dai

ide->property->C/C++ build->Tizen Setting  then  right page remove Framework

Gary V

Notice that not only libosp* seems to be needed, but also libc*, so default libraries. Try C/C++ Build >> Settings >> C++ Linker >> General and uncheck (clear) "Do not use default libraries" and "No startup or default libs" . That might be it.

Gary

Alan Wang

Thanks Gary,

Finally I figure it out why those libraries is needed by my shared library unexpectedly.

Go to Properties->Settings->C++Linker->All optiones

-nodefaultlibs -L"/home/likewise-open/SPREADTRUM/alan.wang/workspace/m4vdec/lib" -shared -lpthread --sysroot="/home/likewise-open/SPREADTRUM/alan.wang/tizen-sdk/platforms/tizen2.2/rootstraps/tizen-device-2.2.native" -L"/home/likewise-open/SPREADTRUM/alan.wang/tizen-sdk/platforms/tizen2.2/rootstraps/tizen-device-2.2.native/usr/lib" -L"/home/likewise-open/SPREADTRUM/alan.wang/tizen-sdk/platforms/tizen2.2/rootstraps/tizen-device-2.2.native/usr/lib/osp" -losp-uifw -losp-appfw -losp-image -losp-json -losp-ime -losp-net -lpthread -losp-content -losp-locations -losp-telephony -losp-uix -losp-media -losp-messaging -losp-web -losp-social -losp-wifi -losp-bluetooth -losp-nfc -losp-face -losp-secure-element -losp-speech-tts -losp-shell -losp-shell-core -losp-speech-stt -losp-vision -lxml2 -lalut -lopenal

 

As you can see all libosp* libraries are listed after.  But those options are not editable, so maybe there is another way to achieve my purpose.

Dongsheng Dai

ide->property->C/C++ build->Tizen Setting  then  right page remove Framework