Static/dynamic library linking

Static/dynamic library linking

BY 15 Aug 2013 Native Application Development

Hi all,
it is regarding common code sharing, sometimes 2 or more project should use common library.

1) I am able to use static linking of libraries for native projects : Properties window-> C/C++ Build > Settings->C++Linker->Libraries
and set “Library Search Path(-L)” inside/outside of my project
“${workspace_loc:/${ProjName}/lib}” – inside my project
${workspace_loc:/AnyProject/lib} – outside,in another project or somewhere on PC filesystem.
Appropriate lib name should be set in section “Libraries(-l)”…

2)Also I am able dynamically link the library in source code:
for library placed inside project it looks like:

wchar_t const * const LIB_NAME = L”lib/mylib.so”;
    Tizen::App::App *pxApp = Tizen::App::App::GetInstance();
    String libPath = pxApp-> GetAppRootPath();
    libPath.Append(LIB_NAME);

    //get initialized instance of Library
    Tizen::Base::Runtime::Library library;
    result ar = library.Construct(libPath);

How to dynamically link the library placed outside of project/package : to set correct absolute path on Tizen filesystem or maybe to set relative path? Is there restrictions where library could be placed on Tizen filesystem?

Thank you.
Alexey.

Written by