Menu

#1 Link error

open
nobody
None
5
2003-10-16
2003-10-16
Anonymous
No

hello,
i compiled a program, "competition.cpp", in windows xp
with cygwin.
brickos-0.2.6.10
gcc (GCC) 3.2 20020927
h8300-hms-gcc 2.96-h8300-000821

this is what happened:

pobetiger@ben65535a /home/rcx-test1
$ make competition.lx
/bin/h8300-hms-ld -T /brickos/boot/brickOS.lds -relax -
L/brickos/lib competition
.o -lc -lmint -lfloat -lc++ -o competition.dc1 --oformat
coff-h8300 -Ttext
0xb000
/bin/h8300-hms-ld: address 0x10a2e of competition.dc1
section .text is not
within region ram
/bin/h8300-hms-ld: address 0x10a2e of competition.dc1
section .tors is not
within region ram
/bin/h8300-hms-ld: address 0x10a2e of competition.dc1
section .data is not
within region ram
/bin/h8300-hms-ld: address 0x10a32 of competition.dc1
section .bss is not within
region ram
/bin/h8300-hms-ld: address 0x108f8 of competition.dc1
section .text is not
within region ram
/bin/h8300-hms-ld: address 0x108f8 of competition.dc1
section .tors is not
within region ram
/bin/h8300-hms-ld: address 0x108f8 of competition.dc1
section .data is not
within region ram
/bin/h8300-hms-ld: address 0x108fc of competition.dc1
section .bss is not within
region ram
make: *** [competition.dc1] Error 1

I have no idea what this means...could somebody help
explain this?

also, competition.cpp looks like:
--- file starts: competition.cpp ---

// Sung Hsu, Mike McCoy, & Boaz Mell
// University of Texas @ Austin
// EE302 Robotics Lab
// qualification program
// just do what is needed...no crazy stuff

#include <config.h>
#include <c++/MotorPair.H>
#include <c++/Sensor.h>
#include <c++/LightSensor.h>
#include <c++/TouchSensor.h>
#include <c++/Sound.H>
#include <dsound.h>
#include <time.h>
#include <conio.h>
#include <unistd.h>
#include <rom/lcd.h>

typedef enum direction {d_fwd, d_rev, d_left, d_right,
d_pivleft, d_pivright,

d_halt};

bool event_timer(time_t length); // length in mSec,
returns false when timeout
void seek_blackline(MotorPair m,
LightSensor light_1,
time_t time,
direction seek_dir=d_right); // well,
seek line..tehe =)

int main()
{
Sound::beep();
MotorPair m(Motor::A,Motor::B);
LightSensor light_1((Sensor::Port)0); // there
is a bug with this also...
TouchSensor ts1((Sensor::Port)1), ts2
((Sensor::Port)2);
light_1.active();
ts1.off();
ts2.off();

do
{
m.forward(255);
} while ((light_1.get()>=35));

//m.brake();

Sound::beep();

do
{
m.forward(255);
} while (event_timer(225));

m.brake();
Sound::beep();

do
{
m.right(255);
} while ( light_1.get() >35 );
m.brake();
seek_blackline(m, light_1, 5000, d_right);

Sound::beep();

// segment 2

do
{
m.left(255);
} while (event_timer(500));

do
{
m.forward(255);
} while ((light_1.get()>=35));

Sound::beep();

do
{
m.forward(255);
} while (event_timer(225));

m.brake();
Sound::beep();

do
{
m.right(255);
} while ( light_1.get() >35 );
m.brake();
seek_blackline(m, light_1, 5000, d_right);

Sound::beep();
Sound::beep();
Sound::beep();

return 0;
}

void seek_blackline(MotorPair m,

LightSensor light_1,
time_t
time,
direction
seek_dir)
{

Sound::beep();
bool needtoseek=false;
do
{
if (needtoseek) // right-
rotational seek
{
if (seek_dir==d_right)
{
while (light_1.get
() <=35 && event_timer(100))
m.right
();
m.off();
while (light_1.get
() <=35)
m.left();
m.brake();

needtoseek=false;
}
else // left-
rotational seek
{
while (light_1.get
() <=35 && event_timer(100))
m.left();
m.off();
while (light_1.get
() <=35)
m.right
();
m.brake();

needtoseek=false;
}
}
m.forward(255);
// default action: fwd
if (light_1.get() <=35)
{
// means robot not inline
anymores
needtoseek=true;
Sound::beep();
Sound::beep();
Sound::beep();
}
} while (event_timer(time));
Sound::beep();
}

// a little buggy, no nested timer...!
bool event_timer(time_t length)
{
static time_t start_t; //
allocate the space for initial time
if (start_t==0)
// if initial time is 0
start_t=get_system_up_time();
// means we need to init it
time_t current_t=get_system_up_time();
// set the current time
if (current_t-start_t>length)
// find the difference
{
// timeout, set the initial time back
to 0
start_t=0;
return false; // return false, so
the loop will stop
}
return true; // there is still
time, continue
}
--- file ends ---

thanks.

Discussion


Log in to post a comment.