Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Compile error when including SPIFF.h (Read 1578 times)
Veliferums
Newbies
*
Offline


Posts: 8
Joined: Aug 20th, 2023
Compile error when including SPIFF.h
Aug 21st, 2023 at 7:58pm
Print Post  
When including SPIFF.h de compiler encounters an error:
undefined reference to vtable for fs::FileImpl
Same include in Arduino 2.x and Visual Code PlatformIO OK

Sample code:

#include <SPIFFS.h>

int myFunction(int, int);

int delayTime = 500;

void setup() {
  pinMode(2, OUTPUT);           // Green
  pinMode(0, OUTPUT);           // Red
  pinMode(4, OUTPUT);           // Blue
  Serial.begin(115200);
}

void loop() {
  digitalWrite( 2, HIGH);
  delay( delayTime );
  digitalWrite( 0, HIGH);
  delay( delayTime );
  digitalWrite( 4, HIGH);
  delay( delayTime );
  digitalWrite( 2, LOW);
  delay( delayTime );
  digitalWrite( 0, LOW);
  delay( delayTime );
  digitalWrite( 4, LOW);
  delay( delayTime );
  Serial.println("TSP - This is main.\n");
}
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Veliferums
Newbies
*
Offline


Posts: 8
Joined: Aug 20th, 2023
Re: Compile error when including SPIFF.h
Reply #1 - Aug 21st, 2023 at 8:12pm
Print Post  
When setting "Default optimization" instead of "No optimization" compiles OK???
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compile error when including SPIFF.h
Reply #2 - Aug 21st, 2023 at 8:16pm
Print Post  
It is not a bug, you need to leave the optimization at the default level to compare with arduino 2 or platformio. Some cores and some libraries can not compile with optimization entirely disabled. 

You can either select a different optimization option or read about using #pragma to push and pop gcc optimization for certain code parts.
« Last Edit: Aug 21st, 2023 at 8:18pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint