0
votes

I'm trying to make an actually not too complicated program for the Arduino UNO, where I log GPS output to an SD card.

The error says:

C:\Users\Marlo\AppData\Local\Temp\build51e9795045faa8d6f671223e5d050b6f.tmp\sketch\src\File.cpp:46:17: error: definition of implicitly-declared 'SDLib::File::~File()'

File::~File(void) {

             ^

Some libraries in folders are used some standard compile output lines here

exit status 1
Fehler beim Kompilieren.

^Last line says "compile error"

The pointed at File.cpp is a library used by SD.h, and it works when I make a simple "open SD -> make file -> write -> close file" program (including all the includes form my main program).

Includes:

#include <stdio.h>      
#include <SD.h>         //<- uses File.cpp
#include <stdint.h>     
#include <Adafruit_GPS.h>
#include <SPI.h>
#include "avr/interrupt.h"   

The portion of code the error refers to is:

File.cpp

File::File(void) {
  _file = 0;
  _name[0] = 0;
  //Serial.print("Created empty file object");
}

File::~File(void) {   //<- line 46
  //  Serial.print("Deleted file object");
}

// returns a pointer to the file name
char *File::name(void) {
  return _name;
}

I didn't change anything in the File.cpp.

What does this error even mean?

I will gladly share my code, I just don't want to paste the whole thing and make this post huge (but I will, if you say so), so let me know if you need anything :)

Greetings, Marlon

Update: To find the part of the code containing the error, I took one function after another and compiled it in a blank project - it worked. No error.

Then I took the first part, compiled, then added the next, compiled, and so on. I have now the complete program in another file (same directory), and it works without error.

Sorry if this is just my computers brainfart.

1
No need to post all of the code, but you should post a minimal reproducible example that we can take and run ourselves as is. For example, after playing around with things relating to that line, you might eventually create this MCVE. Often, creating such an MCVE will lead you to figure out the problem or at least let you better search for it. - chris
That's the thing - I tried to make it a small example program, only contianing the relevent code - but that one runs flawlessly. So either someone wants the whole code, or - which I'm hoping for - someone tells me what this could be refering to, so can find parts of the code which might be related to the error and post them instead of the whole thing, which is 190 lines. Nicely sorted lines, but still 190 lines. - Squirrelkiller
So there is no more question? You have fixed the problem you had? - Trevor
Well, it did go away. Just hoped there would be somebody who has the same problem and maybe knew what to do in case next time it doesn't solve itself. Should I just delete the question then? - Squirrelkiller

1 Answers

0
votes

error: definition of implicitly-declared 'SDLib::File::~File()'

This usually means the function is not declared in te class definition.

Do you have File.h present and included? And is the destructor declared there?

Also see this.