[En-Nut-Discussion] Error compiling the simplest program

Lorenzo Verniani lorenzoverniani at gmail.com
Wed Mar 7 17:24:09 CET 2007


Hi!
I get an error when I compile this very simple program I wrote.
Could you help me, please?
Thanks for your cooperation.
Best regards,
Lorenzo.

---------------------------------------------Here is file named
mine.c--------------------------------------------------------------
#include <string.h>
#include <stdio.h>
#include <io.h>
#include <dev/board.h>
#include <sys/timer.h>
#include <cfg/arch.h>
#include <dev/board.h>
#include <sys/thread.h>
#include <sys/event.h>
#include <sys/heap.h>

void main (void)
{
  printf ("Hello world!");
}
--------------------------------------------------------------------------------------------------------------------------------------------

---------------------------------------------------Here is
Makefile-------------------------------------------------------------------
PROJ = threads

include ../Makedefs

SRCS =  $(PROJ).c
OBJS =  $(SRCS:.c=.o)
LIBS =  $(LIBDIR)/nutinit.o -lnutos -lnutarch -lnutdev -lnutos -lnutcrt
$(ADDLIBS)
TARG =  $(PROJ).hex

all: $(OBJS) $(TARG)

include ../Makerules

clean:
	-rm -f $(OBJS)
	-rm -f $(TARG)
	-rm -f $(PROJ).eep
	-rm -f $(PROJ).obj
	-rm -f $(PROJ).map
	-rm -f $(SRCS:.c=.lst)
	-rm -f $(SRCS:.c=.bak)
	-rm -f $(SRCS:.c=.i)
-----------------------------------------------------------------------------------------------------------------------------------------------------

-----------------------------Finally, the error generated by make command
--------------------------------------------------------
lorenzo at Belva:~/ethernut-4.0.3/nutapp/stampa$ make
avr-gcc mine.o -mmcu=atmega128 -Wl,--defsym=main=0,-Map=mine.map,--cref
-L/home/lorenzo/ethernut-4.0.3-bld/lib
/home/lorenzo/ethernut-4.0.3-bld/lib/nutinit.o -lnutos -lnutarch -lnutdev
-lnutcrt  -o mine.elf
/home/lorenzo/ethernut-4.0.3-bld/lib/libnutcrt.a(open.o)(.text+0x5a): In
function `_open':
: undefined reference to `NutDeviceLookup'
make: *** [mine.elf] Error 1
---------------------------------------------------------------------------------------------------------------------------------------------------
-- 
View this message in context: http://www.nabble.com/Error-compiling-the-simplest-program-tf3363164.html#a9356324
Sent from the MicroControllers - Ethernut mailing list archive at Nabble.com.




More information about the En-Nut-Discussion mailing list