VolosR / TTGOAlienAttack

26 stars 21 forks source link

Error on compiling #4

Open jimthedj65 opened 2 years ago

jimthedj65 commented 2 years ago

Hi Volos,

Thanks for your code. When I load into Arduino and try to compile I get the following error

In file included from Documents/Arduino/TTGOAlienAttack-main/TTGOAlienAttack/TTGOAlienAttack.ino:5:0: Documents/Arduino/TTGOAlienAttack-main/TTGOAlienAttack/enemy.h:1:1: error: stray '\357' in program int frames=4; ^ Documents/Arduino/TTGOAlienAttack-main/TTGOAlienAttack/enemy.h:1:1: error: stray '\273' in program Documents/Arduino/TTGOAlienAttack-main/TTGOAlienAttack/enemy.h:1:1: error: stray '\277' in program Compilation error: exit status 1}

Any idea, I downloaded just a few minutes ago and have the correct board.

brianmiller1956 commented 2 years ago

Hi. I too had this error it is a bit of a strange one, I ended up deleting the first few lines from the enemy.h file and re typing the lines, do not copy and paste them back in. I think that something is not visible in the first couple of lines. Sorry to be vague, I did this a long while ago, I had the same problem with a couple of other Volos projects.

Sent from my iPad Pro

On 21 Apr 2022, at 20:59, jimthedj65 @.***> wrote:

 Hi Volos,

Thanks for your code. When I load into Arduino and try to compile I get the following error

In file included from Documents/Arduino/TTGOAlienAttack-main/TTGOAlienAttack/TTGOAlienAttack.ino:5:0: Documents/Arduino/TTGOAlienAttack-main/TTGOAlienAttack/enemy.h:1:1: error: stray '\357' in program int frames=4; ^ Documents/Arduino/TTGOAlienAttack-main/TTGOAlienAttack/enemy.h:1:1: error: stray '\273' in program Documents/Arduino/TTGOAlienAttack-main/TTGOAlienAttack/enemy.h:1:1: error: stray '\277' in program Compilation error: exit status 1}

Any idea, I downloaded just a few minutes ago and have the correct board.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.

brianmiller1956 commented 2 years ago

I have just checked this, if you go to the enemy.h tab, line one is, int frames=4; If you look at the “int” it is black not blue like the lines 2 and 3 are Re type line one and ” int “ should be blue, delete the original line 1 and it should compile.

Sent from my iPad Pro

On 21 Apr 2022, at 20:59, jimthedj65 @.***> wrote:

 Hi Volos,

Thanks for your code. When I load into Arduino and try to compile I get the following error

In file included from Documents/Arduino/TTGOAlienAttack-main/TTGOAlienAttack/TTGOAlienAttack.ino:5:0: Documents/Arduino/TTGOAlienAttack-main/TTGOAlienAttack/enemy.h:1:1: error: stray '\357' in program int frames=4; ^ Documents/Arduino/TTGOAlienAttack-main/TTGOAlienAttack/enemy.h:1:1: error: stray '\273' in program Documents/Arduino/TTGOAlienAttack-main/TTGOAlienAttack/enemy.h:1:1: error: stray '\277' in program Compilation error: exit status 1}

Any idea, I downloaded just a few minutes ago and have the correct board.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.

jimthedj65 commented 2 years ago

Thanks for the heads up and it makes total sense. I will give it a try

jimthedj65 commented 2 years ago

I tried what you suggested and I still get the compile error, I do notice a bizarre character ? in front of the int frames=4; line error on compiler https://ibb.co/MkxRLXv

thanks for your help

jimthedj65 commented 2 years ago

ok i rewrote all three top lines and it compiled now, the weird character seems to be in one of those lines.... thanks for your help.

brianmiller1956 commented 2 years ago

Glad this helped, I have found this a couple of times in VolosR projects, I don’t know where it comes from.

Sent from my iPad Pro

On 22 Apr 2022, at 13:08, jimthedj65 @.***> wrote:

 ok i rewrote all three top lines and it compiled now, the weird character seems to be in one of those lines.... thanks for your help.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.

Jerry2840 commented 1 year ago

I pulled the files into Visual Studio Code and the format of the file enemy.h showed as UTF-8 with BOM. I clicked on the format at the bottom of the screen and selected "Save with Encoding" and then select UTF-8 and then it would compile just fine. All of the other files are UTF-8.

jimthedj65 commented 1 year ago

Hi Guys,

This is exactly the fix for it, @Jerry2840 thanks for the confirmation the same happens in his weather application in the ani.h you have to rewrite the first two lines and then it compiles ok.

valiunas commented 6 months ago

The issue is clear if you open it in any hex editor (notepad++, ultraedit, HxD etc). As indicated above, the first 3 characters prior to INT on the first line of enemy.h simply need to be removed.