Problem with extern

I’ve first time problem with extern. I’m using FT800 driver for LCD/TFT from FTDI.
Library is here:
http://www.ftdichip.com/Support/SoftwareExamples/EVE/FTDI_V1.2.0_09072014(FT800).zip

I’ve 3 files:

  1. INO:
#define __PROG_TYPES_COMPAT__
#include "SPI.h"
#include "Wire.h"
#include "FT_VM800P43_50.h"
#include "TouchLcd.h"

FT800IMPL_SPI tlcd(FT_CS_PIN,FT_PDN_PIN,FT_INT_PIN);
TouchLcd myTouchLcd;

void setup(){}
void loop(){}
  1. TouchLcd.h:
#ifndef TouchLcd_h
#define TouchLcd_h
#include "Arduino.h"

class FT_VM800P43_50;
extern FT800IMPL_SPI tlcd;

class TouchLcd {};
#endif;

3)TouchLcd.cpp

#include <SPI.h>
#include <Wire.h>
#include <FT_VM800P43_50.h>
#include "TouchLcd.h"

I can’t compile, because of long list of errors like this:

TouchLcd.cpp.o*:In function `FT_RTC::DecToBcd(unsigned char)'
FT_SD.h*:FT_SD()'
myTouch.cpp.o*:Arduino\libraries\FTDI\libraries\FT_SD\FT_SD.h:159: first defined here
TouchLcd.cpp.o*:In function `FT_RTC::DecToBcd(unsigned char)'
FT_SD.h*:FT_SD()'
myTouch.cpp.o*:Arduino\libraries\FTDI\libraries\FT_SD\FT_SD.h:159: first defined here
TouchLcd.cpp.o*:In function `FT_RTC::BcdToDec(unsigned char)'
FT_SD.h*:FT_SD(unsigned char)'
myTouch.cpp.o*:Arduino\libraries\FTDI\libraries\FT_SD\FT_SD.h:164: first defined here
TouchLcd.cpp.o*:In function `FT_RTC::BcdToDec(unsigned char)'
FT_SD.h*:FT_SD(unsigned char)'
myTouch.cpp.o*:Arduino\libraries\FTDI\libraries\FT_SD\FT_SD.h:164: first defined here
TouchLcd.cpp.o*:In function `FT_SD::Init()'
FT_SD.h*:~FT_SD()'

Could you please tell me what I’m doing wrong?


Seems like the first part of that error message didn't get copied. It just sort of starts in the middle of an error.

The includes in the sketch that are libraries (either core, or ones added to the libraries folder) should be surrounded in ‘<>’. Might not make any difference, but give it a try.

I can’t compile, because of long list of errors like this:

Are the errors you posted the first ones in the output?
They also look like you’ve removed information…
Do all the headers included in multiple places have include guards?

Whole list of errors (I removed only full path to libraries):

Compiling 'myTouch' for 'Arduino Uno'
TouchLcd.cpp.o*:In function `FT_RTC::DecToBcd(unsigned char)'
FT_SD.h*:FT_SD()'
myTouch.cpp.o*:\FT_SD\FT_SD.h:159: first defined here
TouchLcd.cpp.o*:In function `FT_RTC::DecToBcd(unsigned char)'
FT_SD.h*:FT_SD()'
myTouch.cpp.o*:\FT_SD\FT_SD.h:159: first defined here
TouchLcd.cpp.o*:In function `FT_RTC::BcdToDec(unsigned char)'
FT_SD.h*:FT_SD(unsigned char)'
myTouch.cpp.o*:\FT_SD\FT_SD.h:164: first defined here
TouchLcd.cpp.o*:In function `FT_RTC::BcdToDec(unsigned char)'
FT_SD.h*:FT_SD(unsigned char)'
myTouch.cpp.o*:\FT_SD\FT_SD.h:164: first defined here
TouchLcd.cpp.o*:In function `FT_SD::Init()'
FT_SD.h*:~FT_SD()'
myTouch.cpp.o*:\FT_SD\FT_SD.h:171: first defined here
TouchLcd.cpp.o*:In function `FT_SD::Init()'
FT_SD.h*:~FT_SD()'
myTouch.cpp.o*:\FT_SD\FT_SD.h:171: first defined here
TouchLcd.cpp.o*:In function `FT_SD::Init()'
FT_SD.h*:Sel()'
myTouch.cpp.o*:\FT_SD\FT_SD.h:177: first defined here
TouchLcd.cpp.o*:In function `FT_SD::DeSel()'
FT_SD.h*:DeSel()'
myTouch.cpp.o*:\FT_SD\FT_SD.h:183: first defined here
TouchLcd.cpp.o*:In function `FT_SD::SDDelay(unsigned char)'
FT_SD.h*:SDDelay(unsigned char)'
myTouch.cpp.o*:\FT_SD\FT_SD.h:187: first defined here
TouchLcd.cpp.o*:In function `FT_SD::Cmd(unsigned char, unsigned long, unsigned char)'
FT_SD.h*:Cmd(unsigned char, unsigned long, unsigned char)'
myTouch.cpp.o*:\FT_SD\FT_SD.h:194: first defined here
TouchLcd.cpp.o*:In function `FT_SD::R1(unsigned char&)'
FT_SD.h*:R1(unsigned char&)'
myTouch.cpp.o*:\FT_SD\FT_SD.h:208: first defined here
TouchLcd.cpp.o*:In function `FT_SD::SDR3(unsigned long&, unsigned char&)'
FT_SD.h*:SDR3(unsigned long&, unsigned char&)'
myTouch.cpp.o*:\FT_SD\FT_SD.h:228: first defined here
TouchLcd.cpp.o*:In function `FT_SD::SDR7(unsigned char&)'
FT_SD.h*:SDR7(unsigned char&)'
myTouch.cpp.o*:\FT_SD\FT_SD.h:248: first defined here
TouchLcd.cpp.o*:In function `FT_SD::AppCmd(unsigned char, unsigned long)'
FT_SD.h*:AppCmd(unsigned char, unsigned long)'
myTouch.cpp.o*:\FT_SD\FT_SD.h:273: first defined here
TouchLcd.cpp.o*:In function `FT_SD::Cmd17(unsigned long)'
FT_SD.h*:Cmd17(unsigned long)'
myTouch.cpp.o*:\FT_SD\FT_SD.h:442: first defined here
TouchLcd.cpp.o*:In function `FT_SD::ReadN(unsigned char*, unsigned long, unsigned int)'
FT_SD.h*:ReadN(unsigned char*, unsigned long, unsigned int)'
myTouch.cpp.o*:\FT_SD\FT_SD.h:454: first defined here
TouchLcd.cpp.o*:In function `FT_SD::Read32(unsigned long)'
FT_SD.h*:Read32(unsigned long)'
myTouch.cpp.o*:\FT_SD\FT_SD.h:467: first defined here
TouchLcd.cpp.o*:In function `FT_SD::Read16(unsigned long)'
FT_SD.h*:Read16(unsigned long)'
myTouch.cpp.o*:\FT_SD\FT_SD.h:473: first defined here
TouchLcd.cpp.o*:In function `FT_SD::Read(unsigned long)'
FT_SD.h*:Read(unsigned long)'
myTouch.cpp.o*:\FT_SD\FT_SD.h:479: first defined here
TouchLcd.cpp.o*:In function `FT_SD::Init()'
FT_SD.h*:Init()'
myTouch.cpp.o*:\FT_SD\FT_SD.h:280: first defined here
TouchLcd.cpp.o*:In function `FT_SDFile::FileStart(FT_DirEnt&)'
FT_SD.h*:FileStart(FT_DirEnt&)'
myTouch.cpp.o*:\FT_SD\FT_SD.h:524: first defined here
TouchLcd.cpp.o*:In function `FT_SD::OpenFile(FT_SDFile&, char const*)'
FT_SD.h*:OpenFile(FT_SDFile&, char const*)'
myTouch.cpp.o*:\FT_SD\FT_SD.h:503: first defined here
TouchLcd.cpp.o*:In function `FT_SDFile::NextCluster()'
FT_SD.h*:NextCluster()'
myTouch.cpp.o*:\FT_SD\FT_SD.h:533: first defined here
TouchLcd.cpp.o*:In function `FT_SDFile::SkipCluster()'
FT_SD.h*:SkipCluster()'
myTouch.cpp.o*:\FT_SD\FT_SD.h:541: first defined here
TouchLcd.cpp.o*:In function `FT_SDFile::SkipSector()'
FT_SD.h*:SkipSector()'
myTouch.cpp.o*:\FT_SD\FT_SD.h:546: first defined here
TouchLcd.cpp.o*:In function `FT_SDFile::SeekSector(unsigned long)'
FT_SD.h*:SeekSector(unsigned long)'
myTouch.cpp.o*:\FT_SD\FT_SD.h:555: first defined here
TouchLcd.cpp.o*:In function `FT_SDFile::ReadSector()'
FT_SD.h*:ReadSector()'
myTouch.cpp.o*:\FT_SD\FT_SD.h:564: first defined here
TouchLcd.cpp.o*:In function `FT_SDFile::ReadSector(unsigned char*)'
FT_SD.h*:ReadSector(unsigned char*)'
myTouch.cpp.o*:\FT_SD\FT_SD.h:577: first defined here
TouchLcd.cpp.o*:In function `FT_RTC::FT_RTC()'
FT_RTC.h*:FT_RTC()'
myTouch.cpp.o*:\FT_RTC\FT_RTC.h:131: first defined here
TouchLcd.cpp.o*:In function `FT_RTC::FT_RTC()'
FT_RTC.h*:FT_RTC()'
myTouch.cpp.o*:\FT_RTC\FT_RTC.h:131: first defined here
TouchLcd.cpp.o*:In function `FT_RTC::FT_RTC(unsigned char)'
FT_RTC.h*:FT_RTC(unsigned char)'
myTouch.cpp.o*:\FT_RTC\FT_RTC.h:147: first defined here
TouchLcd.cpp.o*:In function `FT_RTC::FT_RTC(unsigned char)'
FT_RTC.h*:FT_RTC(unsigned char)'
myTouch.cpp.o*:\FT_RTC\FT_RTC.h:147: first defined here
TouchLcd.cpp.o*:In function `FT_RTC::~FT_RTC()'
FT_RTC.h*:~FT_RTC()'
myTouch.cpp.o*:\FT_RTC\FT_RTC.h:150: first defined here
TouchLcd.cpp.o*:In function `FT_RTC::~FT_RTC()'
FT_RTC.h*:~FT_RTC()'
myTouch.cpp.o*:\FT_RTC\FT_RTC.h:150: first defined here
TouchLcd.cpp.o*:In function `FT_RTC::Init()'
FT_RTC.h*:Init()'
myTouch.cpp.o*:\FT_RTC\FT_RTC.h:158: first defined here
TouchLcd.cpp.o*:In function `FT_RTC::DecToBcd(unsigned char)'
FT_RTC.h*:DecToBcd(unsigned char)'
myTouch.cpp.o*:\FT_RTC\FT_RTC.h:377: first defined here
TouchLcd.cpp.o*:In function `FT_RTC::BcdToDec(unsigned char)'
FT_RTC.h*:BcdToDec(unsigned char)'
myTouch.cpp.o*:\FT_RTC\FT_RTC.h:383: first defined here
TouchLcd.cpp.o*:In function `FT_RTC::Exit()'
FT_RTC.h*:Exit()'
myTouch.cpp.o*:\FT_RTC\FT_RTC.h:512: first defined here
TouchLcd.cpp.o*:In function `FT_RTC::Read(unsigned long, unsigned char&)'
FT_RTC.h*:Read(unsigned long, unsigned char&)'
myTouch.cpp.o*:\FT_RTC\FT_RTC.h:197: first defined here
TouchLcd.cpp.o*:In function `FT_RTC::IsRunning()'
FT_RTC.h*:IsRunning()'
myTouch.cpp.o*:\FT_RTC\FT_RTC.h:175: first defined here
TouchLcd.cpp.o*:In function `FT_RTC::Read(unsigned long, unsigned char*, unsigned char)'
FT_RTC.h*:Read(unsigned long, unsigned char*, unsigned char)'
myTouch.cpp.o*:\FT_RTC\FT_RTC.h:281: first defined here
TouchLcd.cpp.o*:In function `FT_RTC::GetDateTime(DateTime&)'
FT_RTC.h*:GetDateTime(DateTime&)'
myTouch.cpp.o*:\FT_RTC\FT_RTC.h:388: first defined here
TouchLcd.cpp.o*:In function `FT_RTC::GetTime(unsigned char&, unsigned char&, unsigned char&, unsigned char&)'
FT_RTC.h*:GetTime(unsigned char&, unsigned char&, unsigned char&, unsigned char&)'
myTouch.cpp.o*:\FT_RTC\FT_RTC.h:487: first defined here
TouchLcd.cpp.o*:In function `FT_RTC::Write(unsigned long, unsigned char)'
FT_RTC.h*:Write(unsigned long, unsigned char)'
myTouch.cpp.o*:\FT_RTC\FT_RTC.h:328: first defined here
TouchLcd.cpp.o*:In function `FT_RTC::SetFormat(unsigned char)'
FT_RTC.h*:SetFormat(unsigned char)'
myTouch.cpp.o*:\FT_RTC\FT_RTC.h:452: first defined here
TouchLcd.cpp.o*:In function `FT_RTC::Write(unsigned long, unsigned char*, unsigned char)'
FT_RTC.h*:Write(unsigned long, unsigned char*, unsigned char)'
myTouch.cpp.o*:\FT_RTC\FT_RTC.h:347: first defined here
TouchLcd.cpp.o*:In function `FT_RTC::SetDateTime(DateTime const&)'
FT_RTC.h*:SetDateTime(DateTime const&)'
myTouch.cpp.o*:\FT_RTC\FT_RTC.h:424: first defined here
collect2*:error: ld returned 1 exit status
Error creating .elf

The includes in the sketch that are libraries (either core, or ones added to the libraries folder) should be surrounded in ‘<>’. Might not make any difference, but give it a try.

Changed TouchLcd.cpp:

#include <SPI.h>
#include <Wire.h>
#include <FT_VM800P43_50.h>
#include "TouchLcd.h"

Still the same.

I think, the problem could be in library. I’ve made extern variables many times, for LCD, SD Card, etc.

I guess we might as well ask.

The first errors mention lines 159 to 177, post at least these lines of code, feel free to post more. A look at the header and source for TouchLcd would be nice too.

Source of TouchLcd.h and TouchLcd.cpp I attached completely.
Once again:

TouchLcd.h:

#ifndef TouchLcd_h
#define TouchLcd_h
#include "Arduino.h"

class FT_VM800P43_50;
extern FT800IMPL_SPI tlcd;

class TouchLcd { };
#endif;

TouchLcd.cpp:

#include <SPI.h>
#include <Wire.h>
#include <FT_VM800P43_50.h>
#include "TouchLcd.h"

I can remove completly TouchLcd.cpp and change TouchLcd.h to:

#ifndef TouchLcd_h
#define TouchLcd_h
#include "Arduino.h"
#include <FT_VM800P43_50.h>

class FT_VM800P43_50;
extern FT800IMPL_SPI tlcd;

class TouchLcd { };
#endif;

Still the same.

FT_SD\FT_SD.h lines from 156 to 172:

FT_SD::FT_SD(void)
{
	/* assign default pin assignment */
	CSPin = FT_SD_CSPIN;
}
FT_SD::FT_SD(uint8_t Pin)
{
	/* assign CS pin */
	CSPin = Pin;
}

FT_SD::~FT_SD(void)
{
	/* Close the SPI channel */
	/* Make sure the other modules are not using the SPI channel */
	SPI.end();
}

You code layout seems strange.

Where is FT_SD included?
Also what is FT_VM800P43_50?

The reason I ask the last question is because you include it, then forward declare a class with a similar name.

One of the headers may be including something incorrectly as the error says something is declared in a file with only includes.


Edit: really? can't be bothered any more.

I only noticed after spending time trying to decipher you code, you have still failed to post the errors correctly. You are including stuff in places you haven't mentioned. You have an error in your code and it probably has nothing to do with extern.

myTouch.cpp.o*:\FT_SD\FT_SD.h:159: first defined here

Where is 'here'... the errors are important, considering you do not include the file which the line is mentioning.

Hope you solve your troubles.

Where is FT_SD included?
Also what is FT_VM800P43_50?

FT_VM800P43_50 library is written by FTDI for FT800 driver (desribed here).

Link to library (as in first post):
http://www.ftdichip.com/Support/SoftwareExamples/EVE/FTDI_V1.2.0_09072014(FT800).zip

And now. First situation. I’ve only one sketch myTouch.ino:

#define __PROG_TYPES_COMPAT__
#include <SPI.h>
#include <Wire.h>
#include <FT_VM800P43_50.h>

FT800IMPL_SPI tlcd(FT_CS_PIN,FT_PDN_PIN,FT_INT_PIN);

void setup(){}
void loop(){}

This code is compiled well. In this code is created only one object.

Next I’d like to share this object / variable with custom classes. So I created header file:
TouchLcd.h

#ifndef TouchLcd_h
#define TouchLcd_h
#include "Arduino.h"

class FT_VM800P43_50;
extern FT800IMPL_SPI tlcd;

class TouchLcd { };
#endif;

And TouchLcd.cpp:

#include <SPI.h>
#include <Wire.h>
#include <FT_VM800P43_50.h>
#include "TouchLcd.h"

Sketch was changed to:

#define __PROG_TYPES_COMPAT__
#include <SPI.h>
#include <Wire.h>
#include <FT_VM800P43_50.h>
#include "TouchLcd.h"

FT800IMPL_SPI tlcd(FT_CS_PIN,FT_PDN_PIN,FT_INT_PIN);
TouchLcd myTouchLcd;

void setup(){}
void loop(){}

About errors. You’re absolutely right. Now I tried to compile in Arduino IDE, not in AtmelStudio. And… strange. Error description is more clear :slight_smile: Everywhere the same: multiple definition.
Tried once again in AtmelStudio - less description.
Part of error list:

TouchLcd.cpp.o: In function `FT_RTC::DecToBcd(unsigned char)':
C:\Users\BĹ‚aĹĽek\Documents\Arduino\libraries\FTDI/libraries/FT_SD/FT_SD.h:159: multiple definition of `FT_SD::FT_SD()'
myTouch.cpp.o:C:\Users\BĹ‚aĹĽek\Documents\Arduino\libraries\FTDI/libraries/FT_SD/FT_SD.h:159: first defined here
TouchLcd.cpp.o: In function `FT_RTC::DecToBcd(unsigned char)':
C:\Users\BĹ‚aĹĽek\Documents\Arduino\libraries\FTDI/libraries/FT_SD/FT_SD.h:159: multiple definition of `FT_SD::FT_SD()'
myTouch.cpp.o:C:\Users\BĹ‚aĹĽek\Documents\Arduino\libraries\FTDI/libraries/FT_SD/FT_SD.h:159: first defined here
TouchLcd.cpp.o: In function `FT_RTC::BcdToDec(unsigned char)':
C:\Users\BĹ‚aĹĽek\Documents\Arduino\libraries\FTDI/libraries/FT_SD/FT_SD.h:164: multiple definition of `FT_SD::FT_SD(unsigned char)'
myTouch.cpp.o:C:\Users\BĹ‚aĹĽek\Documents\Arduino\libraries\FTDI/libraries/FT_SD/FT_SD.h:164: first defined here
TouchLcd.cpp.o: In function `FT_RTC::BcdToDec(unsigned char)':
C:\Users\BĹ‚aĹĽek\Documents\Arduino\libraries\FTDI/libraries/FT_SD/FT_SD.h:164: multiple definition of `FT_SD::FT_SD(unsigned char)'
myTouch.cpp.o:C:\Users\BĹ‚aĹĽek\Documents\Arduino\libraries\FTDI/libraries/FT_SD/FT_SD.h:164: first defined here
TouchLcd.cpp.o: In function `FT_SD::Init()':
C:\Users\BĹ‚aĹĽek\Documents\Arduino\libraries\FTDI/libraries/FT_SD/FT_SD.h:171: multiple definition of `FT_SD::~FT_SD()'
myTouch.cpp.o:C:\Users\BĹ‚aĹĽek\Documents\Arduino\libraries\FTDI/libraries/FT_SD/FT_SD.h:171: first defined here
TouchLcd.cpp.o: In function `FT_SD::Init()':
C:\Users\BĹ‚aĹĽek\Documents\Arduino\libraries\FTDI/libraries/FT_SD/FT_SD.h:171: multiple definition of `FT_SD::~FT_SD()'
myTouch.cpp.o:C:\Users\BĹ‚aĹĽek\Documents\Arduino\libraries\FTDI/libraries/FT_SD/FT_SD.h:171: first defined here
TouchLcd.cpp.o: In function `FT_SD::Init()':
C:\Users\BĹ‚aĹĽek\Documents\Arduino\libraries\FTDI/libraries/FT_SD/FT_SD.h:177: multiple definition of `FT_SD::Sel()'
myTouch.cpp.o:C:\Users\BĹ‚aĹĽek\Documents\Arduino\libraries\FTDI/libraries/FT_SD/FT_SD.h:177: first defined here
TouchLcd.cpp.o: In function `FT_SD::DeSel()':
C:\Users\BĹ‚aĹĽek\Documents\Arduino\libraries\FTDI/libraries/FT_SD/FT_SD.h:183: multiple definition of `FT_SD::DeSel()'
myTouch.cpp.o:C:\Users\BĹ‚aĹĽek\Documents\Arduino\libraries\FTDI/libraries/FT_SD/FT_SD.h:183: first defined here
TouchLcd.cpp.o: In function `FT_SD::SDDelay(unsigned char)':
C:\Users\BĹ‚aĹĽek\Documents\Arduino\libraries\FTDI/libraries/FT_SD/FT_SD.h:187: multiple definition of `FT_SD::SDDelay(unsigned char)'
myTouch.cpp.o:C:\Users\BĹ‚aĹĽek\Documents\Arduino\libraries\FTDI/libraries/FT_SD/FT_SD.h:187: first defined here
TouchLcd.cpp.o: In function `FT_SD::Cmd(unsigned char, unsigned long, unsigned char)':
C:\Users\BĹ‚aĹĽek\Documents\Arduino\libraries\FTDI/libraries/FT_SD/FT_SD.h:194: multiple definition of `FT_SD::Cmd(unsigned char, unsigned long, unsigned char)'
myTouch.cpp.o:C:\Users\BĹ‚aĹĽek\Documents\Arduino\libraries\FTDI/libraries/FT_SD/FT_SD.h:194: first defined here
TouchLcd.cpp.o: In function `FT_SD::R1(unsigned char&)':

I can put more errors, but all are the same: “multiple definition of…”.
Sorry for wasting your time with incomplete error description, first time I see other description in AtmelStudio then in Arduino IDE.

I can't make out what you are doing. Can you zip up the entire folder, one that reproduces the issue, so I can just compile it and get the errors? From all those snippets it is anyone's guess what is happening.

http://snippets-r-us.com/

http://www.ftdichip.com/Support/SoftwareExamples/EVE/FTDI_V1.2.0_09072014(FT800).zip → library
myTouch.zip → sketch

Thanks in advance

myTouch.zip (6.54 KB)

I noticed that:

  1. I can remove two includes in FT_VM800p43_50.h - lines 65 and 66:
#include "libraries/FT_SD/FT_SD.h"
#include "libraries/FT_RTC/FT_RTC.h"

Now I can compile without errors.

  1. I can make in FT_SD.h some functions inline, I mean move from 156… to 110:
	FT_SD(void) { CSPin = FT_SD_CSPIN;}	/* assign default pin assignment */
	FT_SD(uint8_t Pin) { CSPin = Pin;}	/* assign CS pin */
	~FT_SD(void) {SPI.end();}	/* Close the SPI channel */

And now I have less errors. Should I make all functions inline???
Btw - Arduino IDE 1.6.0

I don’t need SD and RTC for now, so I can work. But I am dismayed situation…

To get all the errors in AtmelStudio, you need to go to Tools->Options->VisualMicro, and set Verbose to true.

Regards,
Ray L.

First, their examples compile without error (the ones I tried) which is interesting.

Second, in FT_SD.h (which is where I got errors) they are implementing functions in a .h file, which you shouldn’t normally do.

I got rid of the errors by editing FT_SD.h and moving the lines which implement functions (rather than define them) namely:

FT_SD::FT_SD(void)
{
 /* assign default pin assignment */
 CSPin = FT_SD_CSPIN;
}

...  > down to ... >

void FT_SDFile::ReadSector(uint8_t *dst) 
{
 ReadSector();
 for (uint8_t i = 0; i < 64; i++) {
 /* Read 8 bytes one shot */
  *dst++ = SPI.transfer(0xff);
  *dst++ = SPI.transfer(0xff);
  *dst++ = SPI.transfer(0xff);
  *dst++ = SPI.transfer(0xff);
  *dst++ = SPI.transfer(0xff);
  *dst++ = SPI.transfer(0xff);
  *dst++ = SPI.transfer(0xff);
  *dst++ = SPI.transfer(0xff);
 }
 SPI.transfer(0xff);   // consume CRC
 SPI.transfer(0xff);
 FTSD->DeSel();
}

… into a separate file FT_SD.cpp.

Also in file FT_RTC.h, I moved the implementation stuff, from:

FT_RTC::FT_RTC(void)
{
 /* Assign the I2C address to the global */
 I2CAddr = FT_RTC_I2C_ADDRESS; 
}

...  > down to ... >

/* do nothing as of now. free up any context which was allocated during Init api */
FT_RTCStatus FT_RTC::Exit(void)
{ 
 return FT_RTC_OK;
}

… into FT_RTC.cpp.

Then it compiled OK. You aren’t supposed to implement functions in .h files.

Thank you all for issues and help.

Nick - few hours after midnight I've made the same - I've splitted FT_SD.h (and also FT_RTC.h) to two files: header file and implementaion file. And project can be compiled without errors. I don't know why they made in this way.

Ray - verboses to true shows much more info, this is true. My problem was, that Atmel Studio showed error but with shorter description.

Problem solved. Thank you all, once again.