ATtiny45 region text' overflowed by 5852 bytes`

I am getting attiny45 compilation error, what is its source?
other atmel168p does not give this error

I copied all

c:/users/my/appdata/local/arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld.exe: C:\Users\my\AppData\Local\arduino\sketches\D6C9FAF9C18B11EEC6DB25636B99D2E1/sketch_dec8b.ino.elf section `.text' will not fit in region `text'
c:/users/my/appdata/local/arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/../lib/gcc/avr/7.3.0/../../../../avr/bin/ld.exe: region `text' overflowed by 5852 bytes
collect2.exe: error: ld returned 1 exit status
Multiple libraries were found for "SPI.h"
  Used: C:\Users\my\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.5.2\libraries\SPI
  Not used: C:\Users\my\Documents\Arduino\libraries\SPI
Using library Adafruit GFX Library at version 1.10.12 in folder: C:\Users\my\Documents\Arduino\libraries\Adafruit_GFX_Library 
Using library Adafruit SSD1306 at version 2.5.0 in folder: C:\Users\my\Documents\Arduino\libraries\Adafruit_SSD1306 
Using library SPI at version 2.0.0 in folder: C:\Users\my\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.5.2\libraries\SPI 
Using library Wire at version 2.0.0 in folder: C:\Users\my\AppData\Local\Arduino15\packages\ATTinyCore\hardware\avr\1.5.2\libraries\Wire 
exit status 1

@nzmxp

Why do you hijack a topic? You should start your own topic because it might become messy as people might no longer know who is replying to who.

Topic split.

Did you read the error message?

thanks

Well, I didn't think these codes took up so much memory.
There doesn't seem to be anything that much in this code.
read known current and voltage

You did not post your code (unless it was exactly the same code as in the other topic). So please post it here to keep the topic self-contained.

You did not mention which board package you use and which exact options you selected.

I posted the code but it didn't work, now I uploaded it again,
The source I got the code from is attiny45/85 adaptation test


#include <Adafruit_GFX.h> //add libbrarry
#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 display; 

const int currentSensor = A1;
const int voltageSensor = A2;
float vOUT = 0.0;
float vIN = 0.0;
float R1 = 10000.0;
float R2 = 1980.0;
float Vdata = 0;
float V,I,I1;
float Cdata;
float value;

void setup(){ 

  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  
  display.clearDisplay();
  display.setTextColor(WHITE);
  display.setTextSize(1);
  display.display();

}
void loop(){

//float vIN = 0.0;

   for(int i = 0; i < 300; i++) // Read 300 times to get a more stable average result
   {
     Cdata = Cdata + analogRead(currentSensor);
     Vdata = Vdata + analogRead(voltageSensor);
     delay(1);
   }

 Cdata=Cdata/300;           
 V=(Cdata/1024.0)*5000;                       
 I=((V - 2500)/ 96);

 Vdata=Vdata/300;
 vOUT = (Vdata * 5.0) / 1024.0;
 vIN = (vOUT / (R2/(R1+R2)));

// OLED Ekrana Yazma
  display.setTextColor(WHITE);
  
  // Watt calculate and write on the screen
  display.setTextSize(1);
  display.setCursor(58,8);
  display.print(" Watt");
  display.setCursor(0,0);
  display.setTextSize(2);
  value=(I * vIN);
  if (value<0){display.println("0.0");} else {display.println(value);} 
  
  // Amper value write on the screen
  display.setTextSize(1);
  display.setCursor(58,23);
  display.print(" Amper");
  display.setCursor(0,16);
  display.setTextSize(2);
  if (I<0) {display.println("0.0");} else {display.println(I);}
  
  // Voltage value write on the screen
  display.setTextSize(1);
  display.setCursor(58,39);
  display.print(" Volt");
  display.setCursor(0,32);
  display.setTextSize(2);
  display.println(vIN);
  
display.display();
display.clearDisplay();

// Resetting values
  Cdata=0;
  I=0;
  V=0;
  Vdata=0;
  vIN=0;
  value;
}

That library allocates 1K of RAM at runtime for a screen buffer.

The ATtiny45 has 256 bytes of RAM, I believe.

Even if you could get the library to fit in the 3K of Flash memory that remains after the non display part of your program, the program still wouldn't run because the RAM allocation for the screen buffer would fail.

You need to look for a library that:

  1. doesn't use a screen buffer
  2. is written with extreme program memory efficiency in mind

I'm sure I chose the cards correctly, they are all installed in my library.
Normally attiny45 works after compiling and installing the ISP editor Blink. As you said, no problem, it may have exceeded the size.

Well, I didn't think these codes took up so much memory.

Now you know. I think that the Adafruit graphics library alone is too large for the ATtiny45. The project you linked in post #5 used the Classic Nano, which has 8X the program memory.