How to overcome on this problem?

I can't see either - but I'm new here and it could be my forum settings are wrong. All I can see are references to zip files

Yes, all the files are in the zips, because it was easier to upload the whole thing than uploading one by one

How am I assured that the zips do not contain malware or other harmful content?

Do you really think I would go this far in a conversation, and asking for help, and write every possible helping thing down just to give you a virus?

I don't know - you wouldn't believe the hoops I had to jump through just to get an account here with a gamer joke username.

Anyway, good luck.

The "All_code" compiles fine.

The Simhub code has two compile-time errors (no board connected). Two chunks of the error:

.../avr/1.8.5/cores/arduino/main.cpp:43: undefined reference to `setup'
.../avr/1.8.5/cores/arduino/main.cpp:46: undefined reference to `loop'

It is the same with the board connected, but for some reason it cannot compile to the leonardo, and I don't understand the problem here. It has the same code parts, it should be good.

This line is repeated ten times at the top of Simhub_code_test.ino:

// J revision sketch
#define VERSION 'j'

// ---------------------------------------------------- PLEASE USE SETUP ASSISTANT AVAILABLE IN SUB FOLDER !!!! -------------------------------------------
// ---------------------------------------------------- PLEASE USE SETUP ASSISTANT AVAILABLE IN SUB FOLDER !!!! -------------------------------------------
// ---------------------------------------------------- PLEASE USE SETUP ASSISTANT AVAILABLE IN SUB FOLDER !!!! -------------------------------------------
// ---------------------------------------------------- PLEASE USE SETUP ASSISTANT AVAILABLE IN SUB FOLDER !!!! -------------------------------------------
// ---------------------------------------------------- PLEASE USE SETUP ASSISTANT AVAILABLE IN SUB FOLDER !!!! -------------------------------------------
// ---------------------------------------------------- PLEASE USE SETUP ASSISTANT AVAILABLE IN SUB FOLDER !!!! -------------------------------------------
// ---------------------------------------------------- PLEASE USE SETUP ASSISTANT AVAILABLE IN SUB FOLDER !!!! -------------------------------------------
// ---------------------------------------------------- PLEASE USE SETUP ASSISTANT AVAILABLE IN SUB FOLDER !!!! -------------------------------------------
// ---------------------------------------------------- PLEASE USE SETUP ASSISTANT AVAILABLE IN SUB FOLDER !!!! -------------------------------------------
// ---------------------------------------------------- PLEASE USE SETUP ASSISTANT AVAILABLE IN SUB FOLDER !!!! -------------------------------------------
// ---------------------------------------------------- PLEASE USE SETUP ASSISTANT AVAILABLE IN SUB FOLDER !!!! -------------------------------------------
// ---------------------------------------------------- PLEASE USE SETUP ASSISTANT AVAILABLE IN SUB FOLDER !!!! -------------------------------------------

I think it means something.

I also found this (content, not context):

... and I do see neither void setup() nor void loop() in Simhub_code_test.ino

with

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

the Simhub_code_test compiles

the All_code_from_Simbuh.ino has a different problem

the file SHGamepadAxis.h
has an include

#include <Joystick.h>

This means the only Joystick-library known by the compiler is
Joystick.h but not
Joystick_.h

do you see the difference?
You are quoting the library-filename with a trailing underline
but the included library has no trailing underline

   //   |underline "_" here
Joystick_ Joystick(JOYSTICK_DEFAULT_REPORT_ID,

After correcting the filename by deleting the underline
another compiler error occurs
'class Joystick' has no member named 'setThrottle'

This indicates that a different joystick-library is used

I guess it is this one

which links to

The example code there

uses function-calls like

Joystick.setXAxis(xAxis);

This means you have to install the Joystick V2.0 library

best regards Stefan

I didn't find what it could be

I don't know what you mean by such a short sentence that specifies nothing

Where should I put the

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

lines?
Also, I don't have problems with the joystick library, I guess it is already installed for me from before. I only have problems with Adafruit_GFX.h but I don't need that part in my code.

That was an answer for xfpd about that line repetition.

Again. I don't understand what you want to say with that.
Solving your problems will be faster if you take MORE time to explain your problems in ONE posting instead of shooting multiple too short to be understandable postings.

I only have problems with Adafruit_GFX.h

saying You have a problem with Adafruit_GFX.h
but then
I don't need that part in my code

saying I don't need the Adafruit_GFX.h

Why do you have a problem with a library that you don't use???

You have to explain in detail what the problem is.
I assume you still have a problem that an compiler-error occurs
follow this tutorial to post the compiler-log that includes the errors

The All_code_from_simhub zip is all the codes that I got from the Simhub app. The Simhub_code_test zip is "my" (I will refer to it as my to understand more easily) code which is only the parts I need from the original code (I don't need displays, etc). But for some reason my code cannot compile due to something and you already figured out as you said:

with

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

the Simhub_code_test compiles

And that's why I'm asking where should I put it.

But then you also said:

the All_code_from_Simbuh.ino has a different problem

But I don't need that ino, that's just what I got from Simhub. I just responded to your answer about Joystick_ and stated I have problems with Adafruit_GFX in that code (but I don't use that part)

I hope it is more understandable now

only in parts understandable.
You should change to a style of clearly naming what you mean every time.

Here is the modified version of what you wrote

In my modification all "that"'s all "it"'s are replaced by the very specific name each "that" / each "it" has

If you read the modified version: Does this really make sense? To me it makes no sense.
.
.
.
.
To your question

You should re-read carefully what the users here post

What is the usual place to put the void setup() and void loop() functions?

You find the void setup() and void loop() in the *.ino-file
In your case it is the already mentioned Simhub_code_test.ino-file

The position where you put the void setup() and void loop() function usually is below the #include-commands and the variable declarations.

I doubt that inserting an empty setup()-function and an empty loop()-function will create a functional code that acts as a joystick.

But with adding an empty setup()-function and an empty loop()-function into your Simhub_code_test.ino-file the Simhub_code_test.ino-file compiles.

In the above text I have consequently named each thing by its name instead of using "this", "that", "it". This writing style eliminates the room for interpretations to almost zero.

This needs a little more time to write it down but it saves time because you don't have to ask back

"what does this "that" mean ?"

If you have added the empty setup()-function and an empty loop()-function like this

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

into your Simhub_code_test.ino-file and you still have a compiler-error

adjust your Arduino-IDE-settings like described in this tutorial

and then post the compiler-log

Yeah, sorry, I tend to speak like everyone is a mind-reader.
I'm just confused right now to be honest.
I put the

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

lines in the Simhub_code_test.ino and it is compiles now.

I didn't want to modify anything in the Simhub_code_test.ino because those lines are the copy pastes from All_code_from_simhub.ino.
The Simhub uploaded the All_code_from_simhub.ino to my leonardo, and worked.. I don't understand how can be that the same code wrong. Is it possible that Simhub has some lines in it's own code that helps working the All_code_from_simhub.ino?

I'm testing it right now, and I'm afraid it is not enough :frowning:

Who is "the Simhub"?

Is "the Simhub" a special software that is able to remotely control the arduino-IDE to upload a sketch?

Is "the Simhub" a person?

You write in a very confusing style
I suggest that you go to sleep until you can't sleep anymore and then do something that really relaxes you.
After that write a detailed description of what you have done.

I wrote somewhere above, Simhub is an application and it can upload sketches to the board. It is a big help because you don't need to code, just set everything (like button number and pin) in the program.
It is 10:11 am, I already woke up today. I cannot write a more detailed description than this. My English sucks but I think it is understandable.