IDE debugging?

Is there a way to use the #'s after the error messages to determine the location of the referenced bug?

What do you mean - give us an example!. Most C/C++ error messages mean just what they say and the line numbers given are almost always correct.

Mark

and the line numbers given are almost always correct

except when a missing ) or } affects something many lines away. Have done that to myself - had tabbed out the code, and the error was in a different tab! That was fun to find.

I'm getting this error. What does it mean?

Post the code could be a lot of things. ; ← needed.

Mark

I've scanned through the program line by line several times now, and I can't find any open '(){}'. I'm wondering if it's got something to do with the IDE settings or something, as I don't remember having to declare functions before setup, and in the reference section of this website it's showing functions at the end of the program, after the main loop, which is where I always put them - but if I do it now it compains about them being 'not declared in this scope'.

It means your code is syntactially incorrect.

For the third time POST YOUR CODE and a copy (use cut and paste) of your error messages.

Mark

Crow:
I've scanned through the program line by line several times now, and I can't find any open '(){}'. I'm wondering if it's got something to do with the IDE settings or something, as I don't remember having to declare functions before setup, and in the reference section of this website it's showing functions at the end of the program, after the main loop, which is where I always put them - but if I do it now it compains about them being 'not declared in this scope'.

The arduino preprocessor handles declaring any needed function prototypes for functions you write later in your sketch. The error "not declared in this scope' in the arduino IDE world is most commonly a missing user library file that you are trying to include into your sketch. So that is where I would say to look if you are indeed including anything at the start of your sketch.

When I pop up the sketch-import library tab, and click on the relevant libraries, it adds the same include lines that I've already got there. (I'm sorry, I can't post my code) I've compiled an example program with the subroutines at the end of the program and that worked fine, so it's not my IDE settings.

I've scanned through the program line by line several times now, and I can't find any open '(){}'. I

Well if you put your cursor just after the opening ( or { then the matching closing ) or } is outlined. If it is not then there isn't one and you need to add one in the appropriate place.

Have you some sort of aversion to posting your code?

(I'm sorry, I can't post my code)

Why?

I'd normally post my code, but this particular code is unique in structure. I realize the boldness of this statement, and the possible response of millions of programmers along the lines of "believe me, it's been done before", but it actually hasn't. I can't be more specific yet, but I'll be starting a Kickstarter project soon & I promise I'll post a link here to satisfy anyone's curiosity.

Is it legal to call a user-defined subroutine inside the setup subroutine? I'm trying to compile the code with the subroutines at the end, as I normally do.

You can call a subroutine from anywhere you like.
You can't define it inside another function.
If your next post isn't code, I'm going to lock this thread to prevent further time-wasting

Crow:
I'd normally post my code, but this particular code is unique in structure. I realize the boldness of this statement, and the possible response of millions of programmers along the lines of "believe me, it's been done before", but it actually hasn't. I can't be more specific yet, but I'll be starting a Kickstarter project soon & I promise I'll post a link here to satisfy anyone's curiosity.

That's not really in the spirit of the Arduino Open Source philosophy.
Are we going to get a share of the Kickstarter profits?

...R

I think that Duff's Device is about the weirdest thing I've seen that still compiles.

Crow:
this particular code is unique in structure

Is it legal to call a user-defined subroutine inside the setup subroutine?

Given that question, it seems unlikely that you're competent to judge whether the code you're trying to compile is using a unique structure.

If your code is secret that's no problem, but don't then expect people to help you fix it.

@AWOL - Ye Gods - that would never pass a code review!

By the way did this post move from programming questions?

@OP I don’t think that someone who can’t find a simple syntax error is as good as this Duff guy.

Mark

PS

@PaulS - A useful do - while loop!

M

Why did it move here?
Because I have a rule-of-thumb “if it don’t got code, it don’t belong in programming”

AWOL:
I think that Duff’s Device is about the weirdest thing I’ve seen that still compiles.

Some C code obfuscation examples are truly mind bending.

#include <stdio.h>
main(t,_,a)char *a;{return!0<t?t<3?main(-79,-13,a+main(-87,1-_,
main(-86,0,a+1)+a)):1,t<_?main(t+1,_,a):3,main(-94,-27+t,a)&&t==2?_<13?
main(2,_+1,"%s %d %d\n"):9:16:t<0?t<-72?main(_,t,
"@n'+,#'/*{}w+/w#cdnr/+,{}r/*de}+,/*{*+,/w{%+,/w#q#n+,/#{l,+,/n{n+,/+#n+,/#\
;#q#n+,/+k#;*+,/'r :'d*'3,}{w+K w'K:'+}e#';dq#'l \
q#'+d'K#!/+k#;q#'r}eKK#}w'r}eKK{nl]'/#;#q#n'){)#}w'){){nl]'/+#n';d}rw' i;# \
){nl]!/n{n#'; r{#w'r nc{nl]'/#{l,+'K {rw' iK{;[{nl]'/w#q#n'wk nw' \
iwk{KK{nl]!/w{%'l##w#' i; :{nl]'/*{q#'ld;r'}{nlwb!/*de}'c \
;;{nl'-{}rw]'/+,}##'*}#nc,',#nw]'/+kd'+e}+;#'rdq#w! nr'/ ') }+}{rl#'{n' ')# \
}'+}##(!!/")
:t<-50?_==*a?putchar(31[a]):main(-65,_,a+1):main((*a=='/')+t,_,a+1)
  :0<t?main(2,2,"%s"):*a=='/'||main(0,main(-61,*a,
"!ek;dc i@bK'(q)-[w]*%n+r3#l,{}:\nuwloca-O;m .vpbks,fxntdCeghiry"),a+1);}

Compile using

gcc twelve.c -o twelve

and here is the output

On the first day of Christmas my true love gave to me
a partridge in a pear tree.

On the second day of Christmas my true love gave to me
two turtle doves
and a partridge in a pear tree.

On the third day of Christmas my true love gave to me
three french hens, two turtle doves
and a partridge in a pear tree.

On the fourth day of Christmas my true love gave to me
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the fifth day of Christmas my true love gave to me
five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the sixth day of Christmas my true love gave to me
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the seventh day of Christmas my true love gave to me
seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the eighth day of Christmas my true love gave to me
eight maids a-milking, seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the ninth day of Christmas my true love gave to me
nine ladies dancing, eight maids a-milking, seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the tenth day of Christmas my true love gave to me
ten lords a-leaping,
nine ladies dancing, eight maids a-milking, seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the eleventh day of Christmas my true love gave to me
eleven pipers piping, ten lords a-leaping,
nine ladies dancing, eight maids a-milking, seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

On the twelfth day of Christmas my true love gave to me
twelve drummers drumming, eleven pipers piping, ten lords a-leaping,
nine ladies dancing, eight maids a-milking, seven swans a-swimming,
six geese a-laying, five gold rings;
four calling birds, three french hens, two turtle doves
and a partridge in a pear tree.

pico:
and here is the output

That simply has no business working.