To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 1838
1837  |  1839
Subject: 
error from makelx: address out of bounds
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Tue, 17 Apr 2001 08:15:57 GMT
Viewed: 
1290 times
  
Hallo!

My question again:

I tried to declare sensors global, out of main():

Motor motor(Motor::B);
LightSensor s(LightSensor::S3,false);

int main(){

...
}

make reports an error:

/home/micha/legOS/util/makelx test.ds1 test.ds2 test.lx
test.ds1: address out of bounds on line 311

If I declare the sensors within main(), it works.

It is remarkable, that the error seems not to come from the compiler.


Best regards.
Michael



Message has 1 Reply:
  Re: error from makelx: address out of bounds
 
I've found it. They must be declared as static: static LightSensor s(LightSensor::S3,false); int main(){ ... } Regards. Michael Wisse (...) (23 years ago, 20-Apr-01, to lugnet.robotics.rcx.legos)

2 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR