Where do i include emWin_png library in project?

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Where do i include emWin_png library in project?

      Hello.

      I have a problem: display png image file.

      IDE: IAR Embedded Workbench IDE - Arm 8.40.2
      MCU : STM32F469
      emWin version : 5.40

      I have downloaded pnglib at SEGGER - The Embedded Experts - Downloads via STemWin540.pdf

      However, I have tried multiple attempts but I am getting the following error
      :no definition for "GUI_PNG_Draw"But I'm not sure which project path should include the png file (emwin_png\V540).

      I don't know which project path should contain the png file (emwin_png\V540).

      Project File Tree
      example : Project A
      A - Drivers file - BSP file, CMSIS file, STM32F4xx_HAL_Drvier file
      - Middlewares file - ST file ( Config, inc, Lib, OS, etc... in STemWin File ), Third_Party file
      - Projects file - Core file( source code ), EWARM file, MDK-ARM file, StemWin file(GUIConf.c, GUIConf.h, LCDConf.h, LCDConf_Stm32469i_discovery.c in Target file) , SW4STM32 file

      I would really appreciate it if you could teach me.
      Thanks for reading.
    • Suuuny,
      It does not really matter where you put this library. You must add a proper path to IAR compiler to be able to compile the library and code that uses it.
      Words "no definition for "GUI_PNG_Draw" are highly likely the linker swearings. It failed to find this function in object files that you supplied.
      Function GUI_PNG_Draw resides in 540\png\gui_png.c
      Make sure this file has been compiled and you got corresponding gui_png.o in IAR Obj directory.

      The post was edited 1 time, last by warlord ().

    • Thanks warload.

      Thanks to you, I solved the compille error.
      As you said, I did the following.
      1) I added the png file to the project.
      2) IAR Project has added the group and source files.
      3) There was no problem using GUI_PNG_Draw() when I tried to build.

      I'm really appreciate to you!!!

      However, there is one problem....
      When debugging, it falls into the png_longjmp state after GUI_PNG_Draw() function processing.
      The PNG image was not drawn on the screen, and it seems to be in the fault state where no other action is available.



      C Source Code: pngerror.c

      1. png_longjmp,(png_const_structrp png_ptr, int val),PNG_NORETURN)
      2. {
      3. #ifdef PNG_SETJMP_SUPPORTED
      4. if (png_ptr != NULL && png_ptr->longjmp_fn != NULL &&
      5. png_ptr->jmp_buf_ptr != NULL)
      6. png_ptr->longjmp_fn(*png_ptr->jmp_buf_ptr, val);
      7. #else
      8. PNG_UNUSED(png_ptr)
      9. PNG_UNUSED(val)
      10. #endif
      11. /* If control reaches this point, png_longjmp() must not return. The only
      12. * choice is to terminate the whole process (or maybe the thread); to do
      13. * this the ANSI-C abort() function is used unless a different method is
      14. * implemented by overriding the default configuration setting for
      15. * PNG_ABORT().
      16. */
      17. PNG_ABORT();
      18. }
      Display All

      Could you tell me what kind of problem it is?

      Thank you for reading
    • Suuuny,
      png_longjmp function is called by a set of png_error functions. You are to trace through the PNG library to find out what code called png_error and then, eventually, png_longjmp. It seems that you will see the string explaining your case, i.e.
      png_error(png_ptr, "internal error: array alloc");