error "was not declared in this scope"

This may be a very simple problem, but I am just a starter of Arduino. Could anyone give me a hint please…

When I want to compile this following code, the following error appears

mbs_system.h:34:error:“MAX17043” does not name a type
base_station:55:error: “time_t” does not name a type
.
.
.

the code is as following

#include <SPI.h>
#include <WiFi.h>
#include <SD.h>

#include <Wire.h>
#include <Time.h>
#include <Cosm.h>
#include <HttpClient.h>
#include <SoftwareSerial.h>

#include <Adafruit_MCP23017.h>
#include <Adafruit_RGBLCDShield.h>
#include <BGLib.h>
#include <MAX17043.h>

#include "pitches.h"
#include "mbs_defs.h"
#include "mbs_stringtable.h"
#include "mbs_wifi.h"
#include "mbs_sd.h"
#include "mbs_ble.h"
#include "mbs_piezo.h"
#include "mbs_system.h"
#include "mbs_menu.h"


/*************************** Global Variables  ***************************/
char compiledate[] = __DATE__;
char compiletime[] = __TIME__;


/*Wifi Shield*/
//TODO: replace with parameters read from SD card
char ssid[] = "DanHowePhone";      //  your network SSID (name) 
char pass[] = "sMt52dSp";   // your network password
//char ssid[] = "CaseGuest";      //  your network SSID (name) 
//char pass[] = "sMt52dSp";   // your network password

//float baseVolts;
//float baseSOC;
//float devVolt[6];
float devSOC[12];

long loopTime; //
long loopProcessStart; // used for testing loop processing time
extern time_t systemTime;
extern char months[12][4];
extern int status;
uint8 loopSecs;

/* LCD Shield */
Adafruit_RGBLCDShield lcd = Adafruit_RGBLCDShield();
//mbsLcdMenu lcdMenu = mbsLcdMenu(); //need instantiation of virtual class?
mbsTopMenu topMenu = mbsTopMenu();



/*****************************************************
SETUP
*****************************************************/
void setup() {

	//Initialize serial and wait for port to open:
	Serial.begin(115200); 
	while (!Serial) {
		; // wait for serial port to connect. Needed for Leonardo only
	}
		

    //Initialize LCD
	lcd.begin(16, 2);
	lcd.setBacklight(LCD_BL_WHITE);

	
	//Display splash screen on LCD and banner on terminal
	displaySeparator('#',30);
	DisplayStringSerial(MBS_STR_MSS_BASESTATION,true);
	Serial.print(compiledate);
	Serial.print(" ");
	Serial.println(compiletime);
	displaySeparator('#',30);
	
	DisplayStringLCD(MBS_STR_MSS_BASESTATION,0,0);
	lcd.setCursor(0,1);
	lcd.print(compiledate);
	lcd.setCursor(7,1);
	lcd.print(" "); //remove year
	lcd.setCursor(8,1);
	lcd.print(compiletime);

	//mbsPiezoStartTone(); //Start-up tone
	
	delay(1500); //make sure screen has time to display
	lcd.setBacklight(LCD_BL_TEAL);

	
	//Initialize hardware
	MbsSdInit(); //Initialize SD card
	MbsWifiInit(); //Initialize WiFi connection
	//mbsCreateTimestamp();//testing!
	MbsBleInit(); //Initialize BLE shield
	
	//Check to see if fuel gauge is present
	//mbsFuelGaugeQuickStart();
	//mbsCheckFuelGauge();
	

	loopTime = millis();
	displaySeparator('#',30);
	Serial.println("Initialization complete");
	displaySeparator('#',30);

	//Display date and time on LCD
	
	//Update time displayed on LCD
	mbsLcdShowDate();
	
	lcd.setCursor(8,0);
	if(hour()<10) lcd.print("0");
	lcd.print(hour());
	lcd.print(":");
	if(minute()<10) lcd.print("0");
	lcd.print(minute());
	lcd.print(":");
	if(second()<10)lcd.print("0");
	lcd.print(second());
	lcd.setBacklight(0);
	
	}//End setup()

uint8_t cnt= 0x80;
/*****************************************************
* Loop                                               *
*****************************************************/
void loop() {
	
	if(second() != loopSecs) {
		loopSecs = second();	//only execute once per second
		
		
		if(second() == 0 ){//1 minute tasks
		
			if(minute() == 3){ //hourly tasks (staggered from startup)
		
				if(hour() == 0){ //daily tasks
					//Update time displayed on LCD
					lcd.clear();
					mbsLcdShowDate();
					//MbsGetTimeWifi(); // update time 1 time per day
				}//hour == 0
		
			}//minute == 0
		
			//if(minute() % 5 == 1){ //check devices every 5 minutes
			if(1){
				lcd.clear();
				lcd.setCursor(0,0);
				lcd.print("Listening for");
				lcd.setCursor(0,1);
				lcd.print("MSS3 devices");	
				mbsBleDeviceScan(10);
				lcd.clear();
				mbsLcdShowDate();
				lcd.setBacklight(0); //turn off
			}
		
			if(minute() % 10 == 0){ //upload data every 10 minutes

				status = WiFi.begin(ssid);//Turn on WiFi and upload
				if( strcmp(ssid,WiFi.SSID()) == 0){
					lcd.clear();
					lcd.setCursor(0,0);
					lcd.print("Uploading data");
					lcd.setCursor(0,1);
					lcd.print("to Cosm server");
					sendCosmBaseData();//Sending data to cosm
					lcd.clear();
					mbsLcdShowDate();
					lcd.setBacklight(0); //turn off BL
					for(uint8_t i=0;i<12;i++) devSOC[i]=0; //clear values
					
					
				}
				WiFi.disconnect();//Turn off WiFi
				
				
			}//minute % 10 = 0
			
			

		
		} //second == 0 (1 minute tasks)
		
		//1s tasks
		lcd.setCursor(8,0);
		if(hour()<10) lcd.print("0");
		lcd.print(hour());
		lcd.print(":");
		if(minute()<10) lcd.print("0");
		lcd.print(minute());
		lcd.print(":");
		if(second()<10)lcd.print("0");
		lcd.print(second());
	}//loopSecs
	
}//End loop()

Thank you for anyone help me

That code uses a lot of libraries that you have not identified the source of.

In some versions of the IDE, if you #include a file in your sketch which the compiler cannot find then the compiler silently ignores it. Have you confirmed that all the files you're #including are either in your sketch directory or provided by libraries which are available in the IDE?

That's a huge number of includes. Do you actually need them ?

You need to look in mbs_system.h to see which bit it is complaining about. Where is that defined.

mbs_system.h appears to be refering to MAX17043 which seems to be the name of another .h file Check that file is actually present.