hi all,
I have been trying to port an executable on floppy through minirtl. I have started with a basic application hello.c. Now the Makefile I have used for it is attached with this mail.
I have used the glibc version 2.0.7 from thinkingnerds.com, and get the following as output:
--------Output------------
cc -mcpu = i386 -msoft -float -nostdlib -I/usr/include -I/usr/lib/gcc -lib/i386 -redhat -linux
/egcs-2.91.68/include -s -nodefaultlibs -L/tmp/glibc-2.0.7 -Wl, -rpath-link, /tmp/glibc-2.0.7 -lc
-hello.c -o hello
/lib/libc.so.6: undefined reference to '[EMAIL PROTECTED]
/lib/libc.so.6: undefined reference to '[EMAIL PROTECTED]
/lib/libc.so.6: undefined reference to '[EMAIL PROTECTED]
and linking failes to produce hello.
--------------------------
Why I am getting these undefined reference messages.
For your reference this is my Makefile.
--------------Makefile --------------
all: hello
#
# Set this to your glibc-2.0.7 copy or pass it on the command line
#
#ifndef GLIBC_DEVEL
GLIBC_DEVEL=/tmp/glibc-2.0.7
#endif
#
# exlicildy list libraries required
#
LIBRARIES = -lc
GCCINCDIR = $(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
GLIBC_CFLAGS+=-nostdinc -I/usr/include -I$(GCCINCDIR) -s
#
# set this to fit your target system
#
CFLAGS = -mcpu=i386 \
-msoft-float \
$(GLIBC_CFLAGS)
LDFLAGS+= -nodefaultlibs \
-L$(GLIBC_DEVEL) \
-Wl,-rpath-link,$(GLIBC_DEVEL) \
$(LIBRARIES)
hello: hello.c
clean:
rm -f core *.o hello
hello.c:
$(CC) -Wall $(CFLAGS) $(LDFLAGS) -o $@ -c $<
------------------------------------------
Regards,
Nidhi Mishra.
mail: [EMAIL PROTECTED], [EMAIL PROTECTED]
Do You Yahoo!?
Sign-up for Video Highlights of 2002 FIFA World Cup
all: hello # # Set this to your glibc-2.0.7 copy or pass it on the command line # #ifndef GLIBC_DEVEL GLIBC_DEVEL=/tmp/glibc-2.0.7 #endif
#
# exlicildy list libraries required
#
LIBRARIES = -lc
GCCINCDIR = $(shell gcc -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp")
GLIBC_CFLAGS+=-nostdinc -I/usr/include -I$(GCCINCDIR) -s
#
# set this to fit your target system
#
CFLAGS = -mcpu=i386 \
-msoft-float \
$(GLIBC_CFLAGS)
LDFLAGS+= -nodefaultlibs \
-L$(GLIBC_DEVEL) \
-Wl,-rpath-link,$(GLIBC_DEVEL) \
$(LIBRARIES)
hello: hello.c
clean:
rm -f core *.o hello
hello.c:
$(CC) -Wall $(CFLAGS) $(LDFLAGS) -o $@ -c $<
