Error compiling for board Arduino/Genuino Mega or Mega 2560

any1 can help me?? why my coding said

compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.

how to solve this…

Many reasons, misplaced bracket or other character, incorrect board setting in IDE, bad library, bad code, bad dog…

/*  DHT11/ DHT22 Sensor Temperature and Humidity Tutorial
 *  Program made by Dejan Nedelkovski,
 * You can find the DHT Library from Arduino official website
#include <LiquidCrystal.h> // includes the LiquidCrystal Library
#include <DHT.h>
#define dataPin 10

LiquidCrystal lcd(8, 9, 4, 5, 6, 7); // Creates an LCD object. Parameters: (rs, enable, d4, d5, d6, d7)
dht DHT;

void setup() {
  lcd.begin(16,2); // Initializes the interface to the LCD screen, and specifies the dimensions (width and height) of the display
void loop() {
  int readData = DHT.read11(dataPin);
  float t = DHT.temperature;
  float h = DHT.humidity;
  lcd.setCursor(0,0); // Sets the location at which subsequent text written to the LCD will be displayed
  lcd.print("Temp.: "); // Prints string "Temp." on the LCD
  lcd.print(t); // Prints the temperature value from the sensor
  lcd.print(" C");
  lcd.print("Humi.: ");
  lcd.print(" %");

PS, that isn’t even a Blynk sketch… are you in the correct forum?

1 Like

Ask Google something like “set Arduino compiler verbosity”.

Once you have increased verbosity you well get more meaningful compiler errors. In this case something like:
'dht' does not name a type

Translated to “English” this means, “eh numpty you forgot to install the DHT libraries, install them and try compiling again”.

maybe should be just DHT dht;

How to install dht libraries

Just type that into Google.