Moxa W325A-LX [20/74] Compiling hello c

Moxa W406-CE [20/74] Compiling hello c
W315A/325A Linux User's Manual Getting Started
2-12
If there isnt enough Availablespace for your application, you will need to delete some existing files. To do
this, connect your PC to the W315A/325A with the console cable, and then use the console utility to delete the
files from the W315A/325As flash memory. To check the amount of free space available, look at the directories
in the read/write directory /dev/mtdblock3. Note that the directories /home and /etc are both mounted in
the directory /dev/mtdblock3.
NOTE If the flash memory is full, you will need to free up some memory space before
saving files to the Flash ROM.
Compiling Hello.c
The package CD contains several example programs. Here we use Hello.c as an example to show you how to
compile and run your applications. Type the following commands from your PC to copy the files used for this
example from the CD to your computers hard drive:
# cd /tmp/
# mkdir example
# cp –r
/mnt/cdrom/examples/W321.341.315.325.345_IA240.241_UC-7112PLUS_W315A.W325A/*
/tmp/example
To compile the program, go to the Hello subdirectory and issue the following commands:
#cd example/hello
#make
You should receive the following response:
[root@localhost hello]# make
/usr/local/arm-linux/bin/arm-linux-gcc –o hello-release hello.c
/usr/local/arm-linux/bin/arm-linux-strip –s hello-release
/usr/local/arm-linux/bin/arm-linux-gcc –ggdb -o hello-debug hello.c
[root@localhost hello]# _
Next, execute hello.exe to generate hello-release and hello-debug, which are described below:
hello-releasean ARM platform execution file (created specifically to run on the W315A/325A)
hello-debugan ARM platform GDB debug server execution file (see Chapter 5 for details about the GDB
debug tool).

Содержание

Похожие устройства

Скачать