Hello! Its my first time here posting, i've been searching for this topic for a lot of time and can't get to the solution, so i decided to try and ask, so maybe one of you can help me!
First of all, im using Microchip Studio, programing on C, using an ATmega32, the thing is, i'm trying to use the u8g2 library to put some images in a GLCD. At this moment, if i put the image on main, i dont have any problems, but i'm trying to get a "clearner" look, and because GIMP exports it with Header and source already, i tried to use it, with no good result. Everytime i try it, i get an undefined of the function.
Im sorry, because English is not my first language, and this is really difficult to try and explain it, way worse than any conversation ive had until today.
So, this is whats intereesting on my main:
#include <VA_default.h> #include <avr/io.h> #include <u8g2.h> #include <util/delay.h> #include <stdio.h> #include <stdlib.h> // config and setup of the LCD goes here, not really usefull right now int main(void) { u8g2_ClearBuffer(&u8g2); u8g2_DrawXBMP(&u8g2, 0, 0, VA_DEFAULT_WIDTH, VA_DEFAULT_HEIGHT, VA_default_bits); u8g2_SetFont(&u8g2, u8g2_font_t0_12_tf ); u8g2_DrawStr(&u8g2, 50, 28, x_value); u8g2_DrawStr(&u8g2, 50, 50, y_value); u8g2_SendBuffer(&u8g2); }
And here is my VA_default.h
#ifndef __VA_DEFAULT_H #define __VA_DEFAULT_H #define VA_DEFAULT_WIDTH 128 #define VA_DEFAULT_HEIGHT 64 static const unsigned char VA_default_bits[]; #endif /* __VA_DEFAULT_H */
And my default.c
#include "VA_default.h" #include "avr/pgmspace.h" static const unsigned char VA_default_bits[] PROGMEM= { //Hex image goes here };
I dont know if this is enough, the thing is that, if i put the image simply on main, i get no error, but when i use this libraries like this, i get:
Severity Code Description Project File Line
Error undefined reference to `VA_default_bits' ST7920GLCD_Test E:\DaRkNeSs\Documents\Universidad\TFG\AVR programing\ST7920GLCD_Test\ST7920GLCD_Test\main.c 304
Error undefined reference to `VA_default_bits' ST7920GLCD_Test E:\DaRkNeSs\Documents\Universidad\TFG\AVR programing\ST7920GLCD_Test\ST7920GLCD_Test\main.c 304
two times, also, so, could anyone point me what im missing? thanks!