Question
I'm developing using a .mk file with the Linux make command. My .mk file contains the following configuration:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := $(CONFIG_MODULE_...)
LOCAL_C_INCLUDES := \
$(LOCAL_PATH)/src \
...
LOCAL_SRC_FILES := \
$(wildcard $(CONFIG_DIR)/*.c)
LOCAL_CFLAGS := \
$(CONFIG_LOCAL_EXPORT_CFLAGS) \
$(CONFIG_COVERAGE_CFLAGS)
include $(BUILD_STATIC_LIBRARY)
One of my header files includes #include <tizen_error.h>. When I run the make command, I get the error:
...h:24:25: fatal error: tizen_error.h: No such file or directory
The command works fine with dummy files when I remove this include. How can I properly add the Tizen library or SDK to my .mk configuration to resolve this dependency?
Answer
Problem Understanding
The error occurs because the build system cannot find the Tizen SDK headers, specifically tizen_error.h. This is a common issue when building Tizen applications outside of the standard Tizen Studio environment.
Solution Methods
-
Using GBS (Git Build System)
- Install GBS if you haven't already
- Create a GBS build root:
gbs build -A armv7l --include-all - Copy your project to the GBS root:
cp -r your_project $HOME/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.0/home/ - Enter the chroot environment:
sudo chroot $HOME/GBS-ROOT/local/BUILD-ROOTS/scratch.armv7l.0 - Navigate to your project and build:
cd /home/your_project make
-
Manual SDK Path Configuration
- Add the Tizen SDK include paths to your LOCAL_C_INCLUDES:
LOCAL_C_INCLUDES := \ $(LOCAL_PATH)/src \ $(TIZEN_SDK_PATH)/include \ $(TIZEN_SDK_PATH)/include/privilege - Set TIZEN_SDK_PATH to point to your Tizen SDK installation
- Add the Tizen SDK include paths to your LOCAL_C_INCLUDES:
Additional Tips
- For ARM builds, you may need to install additional packages:
sudo apt-get install qemu binfmt-support qemu-user-static - Consider using Tizen Studio for development as it handles these dependencies automatically
- For more information on GBS, refer to the official documentation at Samsung Tizen OS