Jump to content

what is wrong here?

Recommended Posts

every line of code after a certain point in my program gives an error. it is all valid code, as there are several sections in a row that are just several copies of the same thing, but with different variables.  everything compiles just fine up to this certain point, and then every line it encounters generates an error.  if i put '//' before any of the lines generating an error, it just gives an error for the next line it encounters...  no matter how many lines I turn into comments, it keeps giving errors on the next ones.  

the errors it gives are either:

general error (in the case of brackets, else statements, etc)

redefinition error (when trying to set a variable equal to a number, ie- a=0;)

or error in function definition (when trying to call a function, ie- delay_ms(100);


I am using the program in the evaluation period, is there some sort of code limit that I have hit that is causing this?

I'm using 5.1.1 here, I have also tried it with 5.1.2, that didn't work either.


just for an example, here is the section of code that it starts screwing up on:



here are the errors:


line  352: General error

line  353: General error

line  354: Redefinition of 'recock'


Line 352 is the line with a bracket on it, above the else statement.

Link to post
Share on other sites

Please try to compile your code with the compiler version 5.1.2 There is a chance that the compiler you use reports errors on wrong lines. The new compiler has this problem fixed so you can get more precise error location.




Link to post
Share on other sites

I have encountered problems similar to the one you describe,

and it usually turned out that the problem was really

somewhere before the indicated error line.  That is why

commenting lines simply moves the indicated error line.


The compiler reports the error where it does because it is

the first place that it _notices_ the error, not always on the

line that is actually causing the error.


Usually it is some difficult-to-find, silly mistake that I made.


One place to look is inside any "asm{}" blocks that you have.

I have sometimes had syntax problems inside these.


I don't know how long this program is, but I suggest printing

it out and go over it very carefully, line-by-line.  If you are

using c++ classes, and/or multiple source files it gets a little

more difficult, but the process is the same...


BTW: I don't know of anything in the evaluation version that

       would be causing your problem.


P.S.  If you want me to look over the code and look for

      problems you can send it to JJHawg@aol.com


P.P.S. You might also try running it through a LINT program...

        I never use lint, but there must be some freeware

        out there you could try.

Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...