Error in example code or something else ??

Old programmer, but new to arduino, and in deep need of help
Cant figure this out, Using a Teensy, and picking a code from the examples.
Flightsim Framerate,
But the only thing i get is the error :
FrameRateDisplay:32: error: ‘frameCount’ was not declared in this scope
‘frameCount’ was not declared in this scope

Can someone please tell me what I do wrong …

Here is the original example code

#include <DogLcd.h>

DogLcd lcd = DogLcd(10, 9, 7, 8); // DogM LCD on pins 7, 8, 9, 10

// variables
FlightSimElapsedFrames frameCount; // increases each simulation frame
elapsedMillis milliSeconds; // increases 1000 per second
int frameCount

// setup runs once, when Teensy boots.
void setup() {

// loop runs repetitively, as long as Teensy is powered up
void loop() {
int frameCount
// receive any incoming X-Plane data (necessary for frame update)

// the LED shows if X-Plane is running and plugin is enabled
if (FlightSim.isEnabled()) {
digitalWrite(LED_BUILTIN, HIGH);
} else {
digitalWrite(LED_BUILTIN, LOW);

// every 10 frames, update the display with frame rate
if (frameCount >= 10) {
// read the elapsed frames and elapsed time
int frames = frameCount;
int ms = milliSeconds;
// reset both to zero (immediately after reading)
milliSeconds = 0;
frameCount = 0;
// compute and show the frames per second
float fps = (float)frames / (float)ms * 1000.0;
lcd.setCursor(0, 0);
lcd.print(" fsp ");

Why do you have two "int frameCount"

The int frameCount does not have a ; at the end of the line.

FlightSimElapsedFrames frameCount; // increases each simulation frame

at global scope

int frameCount

in loop()

int frameCount

You have no less than three variables with the same name. That's a really bad idea. Each variable should have a unique name.

The two lines declaring ints by this name are missing their semicolons.

The error you report doesn't really make sense with this code. I would think it would complain about the missing semicolons first. Were there other errors that accompanied this one?

FlightSimElapsedFrames frameCount; // increases each simulation frame

And this one uses a type (FlightSimElapsedFrames) that is not native to Arduino. Was there supposed to be a library included for this?

In the future attach your code using the </> icon on the left side of the posting menu.

Why not ask in the Teensy forums? You have made modifications to the example code which make it fail to compile. Use the original code.