Author Topic: undefined reference to 'xx'  (Read 2002 times)

0 Members and 1 Guest are viewing this topic.

Offline strawberryTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 1199
  • Country: lv
undefined reference to 'xx'
« on: February 05, 2021, 09:46:59 pm »
Cube IDE compiler error ( undefined reference to 'xx' )
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11530
  • Country: us
    • Personal site
Re: undefined reference to 'xx'
« Reply #1 on: February 05, 2021, 10:06:08 pm »
So? What if your question?
Alex
 

Offline strawberryTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 1199
  • Country: lv
Re: undefined reference to 'xx'
« Reply #2 on: February 05, 2021, 10:27:04 pm »
error show up when using another font
cant spot difference between fonts , why one work and another not
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11530
  • Country: us
    • Personal site
Re: undefined reference to 'xx'
« Reply #3 on: February 05, 2021, 10:28:40 pm »
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.
Alex
 

Offline ejeffrey

  • Super Contributor
  • ***
  • Posts: 3828
  • Country: us
Re: undefined reference to 'xx'
« Reply #4 on: February 05, 2021, 10:59:50 pm »
error show up when using another font

Another font for what?
 

Offline strawberryTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 1199
  • Country: lv
Re: undefined reference to 'xx'
« Reply #5 on: February 05, 2021, 11:11:18 pm »
 

Online rstofer

  • Super Contributor
  • ***
  • Posts: 9915
  • Country: us
Re: undefined reference to 'xx'
« Reply #6 on: February 06, 2021, 12:03:20 am »
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.

 

Offline strawberryTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 1199
  • Country: lv
Re: undefined reference to 'xx'
« Reply #7 on: February 06, 2021, 01:30:01 pm »
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 stops
If use this font FreeMonoBold12pt7b and/or FreeMonoOblique12pt7b and disable FreeSerifItalic12pt7b and some other, everything works fine
Free RAM 18KB FLASH 64KB
 

Offline ajb

  • Super Contributor
  • ***
  • Posts: 2689
  • Country: us
Re: undefined reference to 'xx'
« Reply #8 on: February 06, 2021, 03:31:22 pm »
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
 

Online rstofer

  • Super Contributor
  • ***
  • Posts: 9915
  • Country: us
Re: undefined reference to 'xx'
« Reply #9 on: February 06, 2021, 03:48:46 pm »
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.h

With 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.
« Last Edit: February 06, 2021, 03:52:43 pm by rstofer »
 

Offline strawberryTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 1199
  • Country: lv
Re: undefined reference to 'xx'
« Reply #10 on: February 07, 2021, 12:57:09 pm »
fonts code is bricked after changing int8_t to unsigned char and back again
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11530
  • Country: us
    • Personal site
Re: undefined reference to 'xx'
« Reply #11 on: February 07, 2021, 06:43:52 pm »
Change where exactly?
Alex
 

Offline strawberryTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 1199
  • Country: lv
Re: undefined reference to 'xx'
« Reply #12 on: February 07, 2021, 07:36:41 pm »
 inside fonts.h file
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 11530
  • Country: us
    • Personal site
Re: undefined reference to 'xx'
« Reply #13 on: February 07, 2021, 07:39:56 pm »
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.
Alex
 

Offline strawberryTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 1199
  • Country: lv
Re: undefined reference to 'xx'
« Reply #14 on: February 07, 2021, 08:38:26 pm »
This library do not work.
 

Offline JohnnyMalaria

  • Super Contributor
  • ***
  • Posts: 1154
  • Country: us
    • Enlighten Scientific LLC
Re: undefined reference to 'xx'
« Reply #15 on: February 07, 2021, 08:51:12 pm »
fonts code is bricked after changing int8_t to unsigned char and back again

Why 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.
 

Offline strawberryTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 1199
  • Country: lv
Re: undefined reference to 'xx'
« Reply #16 on: February 07, 2021, 09:32:00 pm »
fonts code is bricked after changing int8_t to unsigned char and back again

Why 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.
try & error, no clue on how this library works
 

Offline JohnnyMalaria

  • Super Contributor
  • ***
  • Posts: 1154
  • Country: us
    • Enlighten Scientific LLC
Re: undefined reference to 'xx'
« Reply #17 on: February 07, 2021, 09:34:36 pm »
fonts code is bricked after changing int8_t to unsigned char and back again

Explain. What did you change and why?

No-one can help if you do not provide clear information.
 

Offline strawberryTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 1199
  • Country: lv
Re: undefined reference to 'xx'
« Reply #18 on: February 07, 2021, 10:20:16 pm »
https://github.com/adafruit/Adafruit-GFX-Library + https://github.com/Bodmer/TFT_eSPI + maybe some other library => my tft library for stm32 cube ide
there could be fundamental error in theory how it should read data from flash on ARM CPU and scrap it
or one bug in anywhere in library in one line of code
found something like this https://www.educative.io/edpresso/how-to-use-the-typedef-struct-in-c
and some other general info witch do not help much



 

Offline JohnnyMalaria

  • Super Contributor
  • ***
  • Posts: 1154
  • Country: us
    • Enlighten Scientific LLC
Re: undefined reference to 'xx'
« Reply #19 on: February 07, 2021, 10:32:26 pm »
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.
« Last Edit: February 07, 2021, 10:49:26 pm by JohnnyMalaria »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf