Home AMX Design Tools

Weird NetLinx Compile Error

Brooks WhitefordBrooks Whiteford Whiteford SystemsPosts: 37
Hello all!
I've been working in Netlinx Studio all day, and randomly on a compile I got this:

ERROR: C:\Program Files\Common Files\AMXShare\AXIs\NetLinx.axi(250): C10516: Cannot have constant on left hand side of assignment

I'm not editing this file (obviously) so i'm not sure why it would suddenly not compile. Plus, I opened up that file and there isn't any code on that line anyway.

Any idea what's going on here?

Thanks so much,
Brooks

Comments

  • DHawthorneDHawthorne Junior Member Posts: 4,584
    Ah, one of those annoying non-helpful error pointers.

    Your code is somewhere using a keyword defined in NetLinx.axi as a constant, and attempting to assign a value to it. Instead of pointing at your code error, it's pointed at where the keyword is defined. You are just going to have to hunt it down. When writing a program, I compile a lot along the way, just to limit where I have to search for such errors when they crop up. When I can't isolate the general area in terms of what I recently changed, I start commenting out blocks until it goes away, then looking in the block for the problem.
  • ericmedleyericmedley Senior Member - 4000+ posts Posts: 4,177
    This kind of error is tough.

    I would venture that you have some kind of typo that in and of itself is making it through compile but it throwing everything else off.

    I ran into this with a program once and it baffled me for days.

    In my case I eneded up having a wrong keyword in the DEFINE_START section. I don't remember exactly what it was, but what it did was make all my non volatile and persistent variables not work during run time.

    these things can be very difficult to ferret out.

    I'd start by commenting out large sections of code and go through it methodically, compiling and testing. Then uncomment a section and home in on the error. (If indeed it is the problem I'm describing.)
  • Brooks WhitefordBrooks Whiteford Whiteford Systems Posts: 37
    Thanks very much guys, found the issue.

    I actually was trying to assign a value to a variable I had created that had the same name as a constant. I suppose because the constant was declared higher up in the code, It got stuck there. Thanks for your help as always!
Sign In or Register to comment.