How to add external library in Tizen native project

Original Created Oct 07, 2016 | Regeneration Apr 22, 2026

I'm trying to include LibPng library in my Tizen native project. I've followed these steps:

  1. Added "png" and "z" in Libraries (-l) under:
    • C/C++ Build → Settings → Tool Settings → C++ Linker → Libraries
  2. Added library paths:
    • "...\libpng-1.6.24"
    • "...\zlib-1.2.8" in the Library search path (-L)

However, I'm getting the following build error:

cannot find -lpng
ninja: build stopped: subcommand failed.

Could anyone help me resolve this issue with including external libraries in Tizen native projects?

Problem Understanding

The issue occurs when trying to link external libraries (LibPng and zlib) in a Tizen native project. The error suggests the linker cannot find the specified library files despite the paths being configured.

Solution Methods

  1. Verify Library Paths:

    • Ensure the paths you provided are absolute and correct
    • Check that the library files (libpng.a/libpng.so and zlib.a/zlib.so) actually exist in the specified directories
  2. Proper Library Naming:

    • Tizen typically expects library files to be named with the "lib" prefix (e.g., libpng.a)
    • Make sure your library files follow this naming convention
  3. Project Configuration:

    • In your project's manifest.xml, add:
      <library-path>path_to_your_libraries</library-path>
      
    • For Tizen Studio projects, also check:
      • Project Properties → C/C++ Build → Settings → Tool Settings
      • Ensure both the library names and paths are correctly specified
  4. Build System Considerations:

    • For CMake projects, add these lines to your CMakeLists.txt:
      find_library(PNG_LIBRARY png)
      find_library(ZLIB_LIBRARY z)
      target_link_libraries(your_target ${PNG_LIBRARY} ${ZLIB_LIBRARY})
      

Additional Tips

  • Always use absolute paths for library locations
  • Verify the library architecture matches your target device (arm/arm64/x86)
  • Check file permissions on the library files
  • For Tizen 5.5+, consider using the pkg-config approach if available

Customize your cookie preferences

You can enable or disable non-essential cookies. Essential cookies are always on to ensure the site works properly and to keep you signed in.

Necessary

These cookies are necessary for the website to function properly and cannot be switched off. They help with things like logging in and setting your privacy preferences.

Always on

Analytics

These cookies help us improve the site by tracking which pages are most popular and how visitors move around the site.

Enable analytics cookies
Public Forum Public Forum
Employees only. Please sign in with your company account.