Animation Example Error: Implicit Declaration of LOGE Function

Original Created Apr 10, 2017 | Regeneration Apr 22, 2026

I'm trying to build the animation example project from Tizen's developer resources (originally at https://developer.tizen.org/community/tip-tech/animations-tizen-native-application) but encountering the following errors:

  1. Error: implicit declaration of function 'LOGE' is invalid in C99 [-Werror,-Wimplicit-function-declaration]

    • Occurs in the main function where LOGE is used to log errors
  2. Build error: ninja: build stopped: subcommand failed.

Here's the relevant code snippet causing the first error:

int main(int argc, char *argv[])
{
    // ... other code ...
    int ret = app_efl_main(&argc, &argv, &event_callback, &ad);
    if (ret != APP_ERROR_NONE) {
        LOGE("app_efl_main() is failed. err = %d", ret);
    }
    return ret;
}

Problem Understanding

The error occurs because the LOGE macro/function is not properly defined before its usage. This is a common issue when working with Tizen native applications that need logging functionality.

Solution Methods

  1. Define the LOGE macro: Add the following definition at the top of your source file to properly define the LOGE macro using Tizen's dlog API:

    #define LOGE(msg, ret) dlog_print(DLOG_ERROR, "APP_TAG", msg, ret)
    
  2. Include necessary headers: Ensure you have the required header for dlog:

    #include <dlog.h>
    
  3. Clean and rebuild: After making these changes, clean your project and rebuild it.

Code Examples

Here's the complete corrected implementation:

#include <dlog.h>
#define LOGE(msg, ret) dlog_print(DLOG_ERROR, "APP_TAG", msg, ret)

int main(int argc, char *argv[])
{
    appdata_s ad = {0,};
    app_event_callback_s event_callback;

    event_callback.create = app_create;
    event_callback.terminate = app_terminate;
    event_callback.pause = app_pause;
    event_callback.resume = app_resume;
    event_callback.app_control = NULL;

    event_callback.low_memory = NULL;
    event_callback.low_battery = NULL;
    event_callback.device_orientation = NULL;
    event_callback.region_format_changed = NULL;

    int ret = app_efl_main(&argc, &argv, &event_callback, &ad);
    if (ret != APP_ERROR_NONE) {
        LOGE("app_efl_main() failed. err = %d", ret);
    }
    return ret;
}

Additional Tips

  • You can view the logs in Tizen Studio's Log View. Set the log level to VERBOSE (V) to see your error messages.
  • Consider using different log levels (DLOG_ERROR, DLOG_WARN, DLOG_INFO) appropriately for different types of messages.
  • Make sure to define a meaningful tag (instead of "APP_TAG") that identifies your application in the logs.

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.