Odd OOP issues when migrating code to board with different chip

For a while I've been developing some code using an Arduino Nano Every (just because its convenient), with the intent of being able to basically upload the code to an Arduino Uno when it's all finished, thinking they were pretty much completely compatible.
Well, I've tried running the code on an Arduino Uno R3 and an Arduino R4 Wifi, and both of them give me some unexpected errors. The code I'm using is in a repository here, and here are some of the errors:

The error in the above is saying

Compilation error: invalid conversion from 'long unsigned int' to 'char*' [-fpermissive]
And I figured that was because I had to remove the Templates I added to have the print function handle any type of variable input, but even after overloading the print method, which seemed to fix the error in the screenshot, I started to run into other errors (eg: saying some methods aren't defined in the local scope, when they definitely are).

The thing that's throwing me off is that the code in the repository works perfectly fine on an Arduino Nano Every... But then I run into countless errors like this on the Uno R3 and R4. Not sure why.

Thank you,
-J

The "Copy Error Messages" isn't there, but the errors themselves are there, so here ya go:

/Users/jhyland/Documents/Arduino/SimpleUI/SimpleUI.ino: In function 'void loop()':
/Users/jhyland/Documents/Arduino/SimpleUI/SimpleUI.ino:154:31: error: invalid conversion from 'long unsigned int' to 'char*' [-fpermissive]
     Milliseconds->print(millis());
                         ~~~~~~^~
In file included from /Users/jhyland/Documents/Arduino/SimpleUI/SimpleUI.hpp:14:0,
                 from /Users/jhyland/Documents/Arduino/SimpleUI/SimpleUI.ino:10:
/Users/jhyland/Documents/Arduino/SimpleUI/TextAnchor.hpp:128:18: note:   initializing argument 1 of 'TextAnchor* TextAnchor::print(char*)'
     TextAnchor * print(char *charValue);
                  ^~~~~
/Users/jhyland/Documents/Arduino/SimpleUI/SimpleUI.ino:158:28: error: invalid conversion from 'long unsigned int' to 'char*' [-fpermissive]
     Minutes->print(millis()/60000);
                    ~~~~~~~~^~~~~~
In file included from /Users/jhyland/Documents/Arduino/SimpleUI/SimpleUI.hpp:14:0,
                 from /Users/jhyland/Documents/Arduino/SimpleUI/SimpleUI.ino:10:
/Users/jhyland/Documents/Arduino/SimpleUI/TextAnchor.hpp:128:18: note:   initializing argument 1 of 'TextAnchor* TextAnchor::print(char*)'
     TextAnchor * print(char *charValue);
                  ^~~~~
/Users/jhyland/Documents/Arduino/SimpleUI/SimpleUI.ino:162:27: error: invalid conversion from 'int32_t {aka long int}' to 'char*' [-fpermissive]
     Iterations->print(iter);
                           ^
In file included from /Users/jhyland/Documents/Arduino/SimpleUI/SimpleUI.hpp:14:0,
                 from /Users/jhyland/Documents/Arduino/SimpleUI/SimpleUI.ino:10:
/Users/jhyland/Documents/Arduino/SimpleUI/TextAnchor.hpp:128:18: note:   initializing argument 1 of 'TextAnchor* TextAnchor::print(char*)'
     TextAnchor * print(char *charValue);
                  ^~~~~
/Users/jhyland/Documents/Arduino/SimpleUI/SimpleUI.ino: In function 'void updateEncoder()':
/Users/jhyland/Documents/Arduino/SimpleUI/SimpleUI.ino:259:34: error: invalid conversion from 'int' to 'char*' [-fpermissive]
      EncoderPos->print(encoderPos);
                                  ^
In file included from /Users/jhyland/Documents/Arduino/SimpleUI/SimpleUI.hpp:14:0,
                 from /Users/jhyland/Documents/Arduino/SimpleUI/SimpleUI.ino:10:
/Users/jhyland/Documents/Arduino/SimpleUI/TextAnchor.hpp:128:18: note:   initializing argument 1 of 'TextAnchor* TextAnchor::print(char*)'
     TextAnchor * print(char *charValue);
                  ^~~~~

exit status 1

Compilation error: invalid conversion from 'long unsigned int' to 'char*' [-fpermissive]

Yeah, understood. I didn't initially include them because if I fixed them, some more errors popped up, then once I fixed those, more popped up. But here's the code it's referring to in the above error (where it says TextAnchor.hpp:128:18):

    TextAnchor * print(char *charValue);

That's in the header file. I know why that error is occurring, its because I was passing long variable type to it when it takes a char. This was caused by removing the ArduinoSTL library (since it seems its not supported on the Uno), which I was using to help with the templates. Using Overloading instead of making some templates seems to get past this one, but then it runs into some others that I couldn't fix.

Yeah, that's what I realize now. When I was googling differences between the Uno and Nano, I saw a lot about the memory, storage, pins, etc. But I guess I must have overlooked the fact the chip is totally different.

Tomorrow, I'll paste the error that I got really stuck on. But is there any advice or guides on how to write something that's compatible with most arduino boards? Or at the very least, the Uno, Mega and Nano?

P.S. If you're thinking "Why didn't he post the error he was actually stuck on? What a dummy", It's because I kept running into error after error, so I figured the current error was likely irrelevant and it was something deeper than just the code (eg: switching to a board with a totally different chip). Also, I closed out of the error I got stuck on and reverted to the code in the github, thinking it was just some mistake I made, but then when it worked fine on the Nano, I realized it wasn't just some stupid typo.

Yeah, I know that one is easy, that was one I said I could fix, but it just kept going to other errors.

ok, here's one I can't figure out (at least not thus far). I fixed the errors in the above code (and re-pushed to Git, if you wanted to see the full change in the link above). And this is the resulting error:

/Users/jhyland/Documents/Arduino/SimpleUI/TextAnchor.cpp:67:14: error: prototype for 'TextAnchor* TextAnchor::print(float)' does not match any in class 'TextAnchor'
 TextAnchor * TextAnchor::print(float intValue){
              ^~~~~~~~~~
In file included from /Users/jhyland/Documents/Arduino/SimpleUI/TextAnchor.cpp:3:0:
/Users/jhyland/Documents/Arduino/SimpleUI/TextAnchor.hpp:172:18: error: candidates are: TextAnchor* TextAnchor::print()
     TextAnchor * print( void );
                  ^~~~~
/Users/jhyland/Documents/Arduino/SimpleUI/TextAnchor.cpp:33:14: error:                 TextAnchor* TextAnchor::print(char*)
 TextAnchor * TextAnchor::print( char *charValue ) {
              ^~~~~~~~~~
/Users/jhyland/Documents/Arduino/SimpleUI/TextAnchor.cpp:62:14: error:                 TextAnchor* TextAnchor::print(long unsigned int)
 TextAnchor * TextAnchor::print(unsigned long intValue){
              ^~~~~~~~~~
/Users/jhyland/Documents/Arduino/SimpleUI/TextAnchor.cpp:57:14: error:                 TextAnchor* TextAnchor::print(long int)
 TextAnchor * TextAnchor::print(long intValue){
              ^~~~~~~~~~
/Users/jhyland/Documents/Arduino/SimpleUI/TextAnchor.cpp:52:14: error:                 TextAnchor* TextAnchor::print(unsigned int)
 TextAnchor * TextAnchor::print(unsigned int intValue){
              ^~~~~~~~~~
/Users/jhyland/Documents/Arduino/SimpleUI/TextAnchor.cpp:47:14: error:                 TextAnchor* TextAnchor::print(int)
 TextAnchor * TextAnchor::print(int intValue){
              ^~~~~~~~~~
/Users/jhyland/Documents/Arduino/SimpleUI/TextAnchor.cpp:72:47: error: 'signed' or 'unsigned' invalid for 'intValue'
 TextAnchor * TextAnchor::print(unsigned float intValue){
                                               ^~~~~~~~
/Users/jhyland/Documents/Arduino/SimpleUI/TextAnchor.cpp:72:14: error: prototype for 'TextAnchor* TextAnchor::print(float)' does not match any in class 'TextAnchor'
 TextAnchor * TextAnchor::print(unsigned float intValue){
              ^~~~~~~~~~
In file included from /Users/jhyland/Documents/Arduino/SimpleUI/TextAnchor.cpp:3:0:
/Users/jhyland/Documents/Arduino/SimpleUI/TextAnchor.hpp:172:18: error: candidates are: TextAnchor* TextAnchor::print()
     TextAnchor * print( void );
                  ^~~~~
/Users/jhyland/Documents/Arduino/SimpleUI/TextAnchor.cpp:33:14: error:                 TextAnchor* TextAnchor::print(char*)
 TextAnchor * TextAnchor::print( char *charValue ) {
              ^~~~~~~~~~
/Users/jhyland/Documents/Arduino/SimpleUI/TextAnchor.cpp:62:14: error:                 TextAnchor* TextAnchor::print(long unsigned int)
 TextAnchor * TextAnchor::print(unsigned long intValue){
              ^~~~~~~~~~
/Users/jhyland/Documents/Arduino/SimpleUI/TextAnchor.cpp:57:14: error:                 TextAnchor* TextAnchor::print(long int)
 TextAnchor * TextAnchor::print(long intValue){
              ^~~~~~~~~~
/Users/jhyland/Documents/Arduino/SimpleUI/TextAnchor.cpp:52:14: error:                 TextAnchor* TextAnchor::print(unsigned int)
 TextAnchor * TextAnchor::print(unsigned int intValue){
              ^~~~~~~~~~
/Users/jhyland/Documents/Arduino/SimpleUI/TextAnchor.cpp:47:14: error:                 TextAnchor* TextAnchor::print(int)
 TextAnchor * TextAnchor::print(int intValue){
              ^~~~~~~~~~

exit status 1

Compilation error: prototype for 'TextAnchor* TextAnchor::print(float)' does not match any in class 'TextAnchor'

Some of the lines it's referring to are in the TextAnchor.cpp file, and they are:

TextAnchor * TextAnchor::print(int intValue){
  _printInt(intValue);
  return this;
}

TextAnchor * TextAnchor::print(unsigned int intValue){
  _printInt(intValue);
  return this;
}

TextAnchor * TextAnchor::print(long intValue){
  _printLong(intValue);
  return this;
}

TextAnchor * TextAnchor::print(unsigned long intValue){
  _printLong(intValue);
  return this;
}

TextAnchor * TextAnchor::print(float intValue){
  _printFloat(intValue);
  return this;
}

TextAnchor * TextAnchor::print(unsigned float intValue){
  _printFloat(intValue);
  return this;
}

And the code in the TextAnchor.hpp file:

class TextAnchor {
  public: 

    TextAnchor(Adafruit_SSD1351 &GFXHandler);

    ~TextAnchor(void);

    // ... Truncated for forum post
    
    TextAnchor * print(int intValue);
    TextAnchor * print(unsigned int intValue);
    TextAnchor * print(long intValue);
    TextAnchor * print(unsigned long intValue);

    // ... Truncated for forum post

    // Set/update the print containers display value to a string, then display it
    TextAnchor * print(char *charValue);

    // ... Truncated for forum post

  private:

    Adafruit_SSD1351 * GFXHandler;

    // ... Truncated for forum post

    void _printInt( int intValue );
    void _printUInt( unsigned int intValue );
    void _printLong( long intValue );
    void _printULong( unsigned long intValue );
    void _printFloat( float intValue );
    void _printDouble( double intValue );

    void _appendInt( int intValue );
    void _appendDouble( double intValue );

    void _prependInt( int intValue );
    void _prependDouble( double intValue );
};

That code works fine on the Nano, it's just how I was defining the methods in the TextAnchor class.

Do you have the IDE preferences set to show all compiler warnings, and verbose output during compilation? Any possibility that the errors are being shown as warnings for the Nano Every and you are just not seeing them because of the preference settings?

Hello jhyland87

Post the sketch.

Yes, you're right. I actually did have them in there, but it was throwing a different error when I did.
I uncommented them and here's the error that arises after that:
EDIT: I forgot, you can't have an unsigned float... Removing that and trying again..

EDIT 2: Well, That got it working.... Thanks guys.

It's a shame I lost the error that made me initially want to post this, that was what I was kinda stuck on. But I guess it was something else very trivial.

Thanks @Delta_G! You're a champ.

@jhyland87
Perhaps you need to change the topic's title because your problem has nothing to do with porting code from Every to Uno R4