Compiler question

(Is this the right place?)

Sorry folks, but it is to do with programming - but more the actual compiler than the programs.

I don't get it:
I run the compiler and get an error.

It tells me the "file name" and the line number.

That's kind of insulting when the program doesn't show line numbers.

What am I missing?

You're missing the fact that the Arduino "IDE" is complete and utter rubbish.

I had a good old whine about it here: http://hacking.majenko.co.uk/scrap-the-arduino-ide

It helps to bitch and moan once in a while.

I guess my newness to this environment makes me "green" to what to expect.

I byte my lip (pun) and try to not complain too much because I admit I know NOTHING about C and am in it feet first.

I run the compiler and get an error.

I don't understand that sentence.

I read here once that the compiler sent them "messages"; I think they were delusional. :stuck_out_tongue_closed_eyes:

Word.. Don't nibble that lip too hard :wink:

I have been programming since the age of 8 - that's about 30 years - and I haven't yet found a "professional" IDE quite as bad as the Arduino/Processing one. Even MPLAB-X, which is pretty bad IMHO, is tolerable in comparison.

My personal favourite is Anjuta.

The IDE is independant of the compiler, it simply echos the output from it.

Hopefully the error message is enough to find the location, otherwise you can guesstimate the line and look for an error near by.
A more advanced IDE will jump straight to the line, or at least have line numbers. Some people have set up code-blocks, vc++, eclipse and a few others for use with arduino.

AWOL:

I run the compiler and get an error.

I don't understand that sentence.

I read here once that the compiler sent them "messages"; I think they were delusional. :stuck_out_tongue_closed_eyes:

I am doing something and have made a mistake - which I don't know about yet.

I click/press the "compile" button.

The IDE (now I know the name) displays an error at the bottom (in red) with the file name and a number which I am guessing to be the line of the code.
Example:
V2:81: error: variable or field 'loop' declared void
V2:230: error: variable or field 'loop' declared void
Yeah, terrific. 81, 230.

If it won't give me line numbers on the screen, why quote line numbers with errors?

maybe you have an un closed '{, }' combo, make sure all your functions have matching '{, }' brackets, and not extras lying around ( above 'void loop' )

although 'variable or field 'loop' declared void' seems like an incomplete struct or class has the loop function in scope ( still a missing closing bracket ).

pYro_65:
maybe you have an un closed '{, }' combo, make sure all your functions have matching '{, }' brackets, and not extras lying around ( above 'void loop' )

although 'variable or field 'loop' declared void' seems like an incomplete struct or class has the loop function in scope.

The error itself isn't the issue here.

This thread is about the uselessness of the IDE when reporting errors.

Oh, and the IDE does actually tell you which line you are on - a little white number in the extreme bottom left of the window (if you look close enough). Nothing to say that that's what it is, of course...

Pyro,

Well what causes this "error" completely defys my understanding.

In the code:

void loop()
{
top_menu(); // See Example_menu.pde
}

If I want to call "top_menu" with a paramater/value of 1, I change it to:
top_menu(1)

That's it.

Then the whole thing falls apart.


NOTE TO ALL READERS HERE AFTER.

I have worked out "another way" (or maybe the right way) to do what I wanted, so this is no longer a problem itself.
But the IDE is still problematic with how it shows errors.

If I want to call "top_menu" with a paramater/value of 1, I change it to: top_menu(1)

But the example shows that top_menu appears to take no parameters.

Majenko,

Thanks for that pointer.

I didn't notice it.

And usually I am more observant than that.

Thanks much.

AWOL:

If I want to call "top_menu" with a paramater/value of 1, I change it to: top_menu(1)

But the example shows that top_menu appears to take no parameters.

AWOL,

Yes, I appreciate that, and I tried to make it accept one. (Another problem). I would appreciate more help on these but here is not the right place.

lost_and_confused:
Majenko,

Thanks for that pointer.

I didn't notice it.

And usually I am more observant than that.

Thanks much.

It's ok, I always forget it's there too and start counting lines to find my place :wink:

I would appreciate more help on these but here is not the right place.

This is probably the perfect place, you can modify the name of your thread and post a new question or just start a completely new thread.

Pyro,

I meant in THIS thread.

That is why I said you can modify the name of the thread with your new question, which will appear in the forum listing. XD

(See new topic.)

:wink:

The IDE doesn't number each line, but it does show the line number that the cursor is currently on. Click somewhere in the code. Check the line number. If if is higher than the line with the error, move up. Otherwise move down.

Keep in mind that the line number and column number are only approximate, in any case.

Paul,

Yes, but now I know where to look when I get an error message with a line number to find which line it is in the code.