Understanding compiling error responses.

Maybe its just me, but it strikes me as logical, that when you get an error code back from trying to compile the sketch, ie:

"Turret5.cpp:50:41: error: expected identifier before ‘(’ token"

the address "50:41" should refer to the location of the error.
except on mine it doesn't, the first figure is several lines out, and i have no idea what the 41 means....

could someone enlighten me please?

Thanks!

Unfortunately, the compilation errors are generated after the IDE makes its additions to your sketch, so the line numbers are a bit out. The second number probably (I haven't looked at it closely) relates to the error message.

OllyR:
Maybe its just me, but it strikes me as logical, that when you get an error code back from trying to compile the sketch, ie:

The IDE adds a couple of lines to your code before the compiler gets it. However, it generally backs out number from the error before printing it in the status window.

Also, keep in mind the compiler doesn't always identify the line that is the actual problem. It is just the line where the compiler ran into a problem. This complicates the issue of identifying where the issue occurred.

OllyR:
"Turret5.cpp:50:41: error: expected identifier before ‘(’ token"

I have not seen an error message like that before. Since you have an example, you might want to post your code.

i sorted that one, i had put brackets around something that didnt need them.
Thanks for the update though. I was convinced i was being dim, but its not just me that struggles to make use of the returns.

Could 50:41 be row:column ?

Thats what i suspected, but it isnt. you can almost get the row, but it is 3 or 4 above/below the error normally

I have been using Arduino since a month. A week ago it was all good with all the necessary libraries. But one day it cant even compile the program it did a week ago. I have tried various versions of Arduino IDE since.

Error -
{

C:\Users\x\Documents\Arduino\libraries\PS2X_lib\PS2X_lib.cpp: In member function 'void PS2X::read_gamepad(boolean, byte)':

C:\Users\x\Documents\Arduino\libraries\PS2X_lib\PS2X_lib.cpp:104:53: warning: narrowing conversion of 'motor2' from 'byte {aka unsigned char}' to 'char' inside { } [-Wnarrowing]

char dword[9] = {0x01,0x42,0,motor1,motor2,0,0,0,0};

^

c:\program files (x86)\arduino\hardware\tools\avr\bin../lib/gcc/avr/4.9.2/../../../../avr/bin/ar.exe: unable to rename 'core\core.a'; reason: Permission denied

exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.
Invalid library found in C:\Users\x\Documents\Arduino\libraries\Ultrasonic-HC-SR04-master: C:\Users\x\Documents\Arduino\libraries\Ultrasonic-HC-SR04-master
Invalid library found in C:\Users\x\Documents\Arduino\libraries__MACOSX: C:\Users\x\Documents\Arduino\libraries__MACOSX

}

Could someone guide me about this please ?

Could someone explain me this error message generated while uploading the code using arduino ide:

"Sketch uses 11038 bytes (38%) of program storage space. Maximum is 28672 bytes.
Global variables use 580 bytes of dynamic memory.
Found programmer: Id = "€"; type = …
Software Version = €.; Hardware Version = "

I guess we could if it was an error message. That is the standard message you get when everything is fine.

Oops..
This is the error message attached

Capture.PNG