problem compiling code trying to add sscanf function

n f yazhi_1@yahoo.com
Wed Mar 24 21:38:00 GMT 2004


I'm programming a 68hc11e1 microprocessor, using c.
Does anyone know if it's possible to use stdio
functions from c, to program a 68hc11e1. Everytime I
compile it gives me an error when I try to use sscanf
function. I'm trying to convert a string to float. I
have inserted "#include <stdio.h>", but it still does
not work.

here are my files:
Here's my memory.x file:

OUTPUT_FORMAT("elf32-m68hc11", "elf32-m68hc11",
"elf32-m68hc11")
OUTPUT_ARCH(m68hc11)
ENTRY(_start)
SEARCH_DIR(C:\usr\lib\gcc-lib\m6811-elf\3.3.1-m68hc1x-20031004
\mshort)

MEMORY
{
ioports (!x) : org = 0x1000, l = 0x500
eeprom (!i) : org = 0xB600, l = 0x300
data (rwx) : org = 0x8800, l = 0x1000
text (rx) : org = 0x9000, l = 0x6000
}

PROVIDE (_stack = 0x01ff-1);

-------------------------------------------------------------
here's my project.mak file:

OC = c:/usr/bin/m6811-elf-objcopy
CC = c:/usr/bin/m6811-elf-gcc
RM = C:/embeddedGNU/rm.exe

CFLAGS = -m68hc11 -O3 -fno-ident -fno-common
-fomit-frame-pointer -
mshort -fsigned-char
LDFLAGS = -Wl,-u,-mm68hc11elfb
OCFLAGS = -O srec

CSRCS=main.c

OBJS=$(CSRCS:.c=.o)

all: ourProject.elf ourProject.s19

$(OBJS): %.o: %.c
$(CC) $(CFLAGS) -c $<

ourProject.elf: $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) -o ourProject.elf $(OBJS)

ourProject.s19: ourProject.elf
$(OC) $(OCFLAGS) ourProject.elf ourProject.s19

clean:
$(RM) -f ourProject.elf
$(RM) -f ourProject.s19
$(RM) -f ourProject.dmp
$(RM) -f $(OBJS)


---------------------------------------
basically this is what i'm adding:

#include<stdio.h>

UINT x;
char *out = "1234.4213"; // this is what what the data

                         //looks like
float fnum;
x = sscanf(out, "%lf", &fnum);


__________________________________
Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.
http://taxes.yahoo.com/filing.html



More information about the Gcc-help mailing list