undefined reference to 'xx' - Page 1
Forum section: electronics / general

author: strawberry
author_rank: Super Contributor
timestamp: February 05, 2021, 09:46:59 pm
content: Cube IDE compiler error ( undefined reference to 'xx' )

author: ataradov
author_rank: Super Contributor
timestamp: February 05, 2021, 10:06:08 pm
content: So? What if your question?

author: strawberry
author_rank: Super Contributor
timestamp: February 05, 2021, 10:27:04 pm
content: error show up when using another fontcant spot difference between fonts , why one work and another not

author: ataradov
author_rank: Super Contributor
timestamp: February 05, 2021, 10:28:40 pm
content: There is no chance anyone can help you with this information. You either need to provide details or figure this out on your own.Missing symbols usually mean that you forgot to include some files for compilation.

author: ejeffrey
author_rank: Super Contributor
timestamp: February 05, 2021, 10:59:50 pm
content: Quote from: strawberry on February 05, 2021, 10:27:04 pmAnother font for what?

author: strawberry
author_rank: Super Contributor
timestamp: February 05, 2021, 11:11:18 pm
content: Quote from: ejeffrey on February 05, 2021, 10:59:50 pmfor LCD

author: rstofer
author_rank: Super Contributor
timestamp: February 06, 2021, 12:03:20 am
content: Do a search for 'xx' and see where it is used. Then figure out what it is, what it does and how to provide a value.Look at the working source and see if 'xx' exists. Figure out what it is what it does and how the value is provided. Copy and paste (more or less).Sometimes it is as simple as a spelling error.

author: strawberry
author_rank: Super Contributor
timestamp: February 06, 2021, 01:30:01 pm
content: when placed (printnewstr(35,120, ORANGE, &FreeSerifItalic12pt7b, 1, "ADC1"); ) somewhere else ,it wont give error (undefined reference to 'FreeSerifItalic12pt7b') but will happen Hard fault and CPU stopsIf use this font FreeMonoBold12pt7b and/or FreeMonoOblique12pt7b and disable FreeSerifItalic12pt7b and some other, everything works fineFree RAM 18KB FLASH 64KB

author: ajb
author_rank: Super Contributor
timestamp: February 06, 2021, 03:31:22 pm
content: Where are those fonts defined? Note that defining something is different from declaring it. You'll need to show your code if you want useful help

author: rstofer
author_rank: Super Contributor
timestamp: February 06, 2021, 03:48:46 pm
content: Here is a font header file that includes both the declaration and definition of a font:https://github.com/adafruit/Adafruit-GFX-Library/blob/master/Fonts/FreeSerifItalic12pt7b.hWith the definition (all those constants) in the header file, it can only be included once in a project. If it is included in 2 separate files, the linker will complain about multiple definitions.Make sure you have the header file included in your project.

author: strawberry
author_rank: Super Contributor
timestamp: February 07, 2021, 12:57:09 pm
content: fonts code is bricked after changing int8_t to unsigned char and back again

author: ataradov
author_rank: Super Contributor
timestamp: February 07, 2021, 06:43:52 pm
content: Change where exactly?

author: strawberry
author_rank: Super Contributor
timestamp: February 07, 2021, 07:36:41 pm
content: inside fonts.h file

author: ataradov
author_rank: Super Contributor
timestamp: February 07, 2021, 07:39:56 pm
content: Are just trolling at this point? There are no instances of "unsigned char" in that file, and the only "int8_t" members are xOffset and yOffset, which need to be signed, as they are later initialized with negative numbers for some characters.I'm done helping you if your replies do not contain complete and properly capitalized sentences. It is a waste of my time.

author: strawberry
author_rank: Super Contributor
timestamp: February 07, 2021, 08:38:26 pm
content: This library do not work.

author: JohnnyMalaria
author_rank: Super Contributor
timestamp: February 07, 2021, 08:51:12 pm
content: Quote from: strawberry on February 07, 2021, 12:57:09 pmWhy are you changing it? And isn't it uint8_t?What bit length is an unsigned char on your target? chars aren't always 8 bits.

author: strawberry
author_rank: Super Contributor
timestamp: February 07, 2021, 09:32:00 pm
content: Quote from: JohnnyMalaria on February 07, 2021, 08:51:12 pmtry & error, no clue on how this library works

author: JohnnyMalaria
author_rank: Super Contributor
timestamp: February 07, 2021, 09:34:36 pm
content: Quote from: strawberry on February 07, 2021, 12:57:09 pmExplain. What did you change and why?No-one can help if you do not provide clear information.

author: strawberry
author_rank: Super Contributor
timestamp: February 07, 2021, 10:20:16 pm
content: https://github.com/adafruit/Adafruit-GFX-Library+https://github.com/Bodmer/TFT_eSPI+ maybe some other library => my tft library for stm32 cube idethere could be fundamental error in theory how it should read data from flash on ARM CPU and scrap itor one bug in anywhere in library in one line of codefound something like thishttps://www.educative.io/edpresso/how-to-use-the-typedef-struct-in-cand some other general info witch do not help much

author: JohnnyMalaria
author_rank: Super Contributor
timestamp: February 07, 2021, 10:32:26 pm
content: Last try - how do you know that "fonts code is bricked after changing int8_t to unsigned char and back again"?Post an example of the font .c file that works.