U8G2 graphics library/component linking error

Sysprogs forums Forums VisualGDB U8G2 graphics library/component linking error

Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #23706
    erzyk
    Participant

    Hi,

    I’m trying to include an OLED display into my ESP32 IDF projects. I found that there is a nice port of the u8g2 monochrome display library for ESP32 IDF.
    The u8g2 library can be found here and the port files from N.Kolban are here
    There is also a quite detailed instruction written by Luca which is here, he also uploaded a short clip to YouTube about it.

    I followed everything that was written in the links above but I simply can’t get this to compile. There must be some trivial mistake that I can not find. I get errors like this:

    main/libmain.a(main.c.obj)(0): error : undefined reference to `u8g2_cb_r0'
    main/libmain.a(main.c.obj)(0): error : undefined reference to `u8g2_font_timR14_tf'
    main/libmain.a(main.c.obj)(0): error : undefined reference to `u8g2_Setup_ssd1306_128x64_noname_f'
    main/libmain.a(main.c.obj)(0): error : undefined reference to `u8x8_InitDisplay'
    main/libmain.a(main.c.obj)(0): error : undefined reference to `u8x8_SetPowerSave'
    main/libmain.a(main.c.obj)(0): error : undefined reference to `u8g2_SetFont'
    main/libmain.a(main.c.obj)(0): error : undefined reference to `u8g2_DrawStr'
    main/libmain.a(main.c.obj)(0): error : undefined reference to `u8g2_SendBuffer'
    main/libmain.a(main.c.obj): In function `app_main':

    There is some linking error and I hardly can’t find where.
    My project includign the u8g2 library and everything other can be found here.

    Can you help me put with this problem?

    • This topic was modified 5 years, 2 months ago by erzyk.
    • This topic was modified 5 years, 2 months ago by support. Reason: formatting
    #23709
    support
    Keymaster

    Hi,

    Sorry, we cannot provide much help troubleshooting 3rd-party libraries and components as a part of our product support. Our best advice would be to try searching the codebase for the definitions of the missing symbol and ensuring that the corresponding source or library file (.a) is included in the project. You may also find this tutorial useful – it explains the difference between C++ declarations and definitions and shows some tricks for finding symbol definitions in object files.

    #23710
    erzyk
    Participant

    The thing is, that there are no C++ files involved and if I compile it on the bare ESP32 IDF using command line tools I can get it to work…

    The problem is only using Visual GBD in Visual Studio

    #23711
    support
    Keymaster

    Hi,

    If the project builds successfully from command line, please try importing it into VisualGDB using the import wizard and then compare the manual build command line against the command line issued by VisualGDB (you can find it in the View -> Output -> Build Output window). Once you identify the part of the command line that breaks the build, we can help you configure VisualGDB to ensure it uses the correct command line as well.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.