Altera_Forum
Honored Contributor
20 years agohello_world makefile
Hi people
I have made the standard hello world as a test app for my custom board. Makefileinclude Rules.mak
ECLIPSE_WORKSPACE := /cygdrive/c/altera/kits/nios2/bin/eclipse/workspace
KERNEL_PROJECT := hello_world
BUILDDIR := $(ECLIPSE_WORKSPACE)/$(KERNEL_PROJECT)/build/include
CFLAGS += -O0 -g -I$(BUILDDIR)
all: hello.exe hello.gdb Rules.mak is the standard file and has not been modified. When I try to compile the code shown here below the error below the code is shown. Code: hello.cpp #include "stdio.h"
int main(int argc, char *argv)
{
printf("Hello world test app!!!\n");
return 1;
} console : compiler/linker make -k all
no emulation specific options.
nios2-elf-gcc -nostdinc -D__linux__ -O2 -I"c:/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.uClibc_1.4.0"/include -I/cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.1//include -fno-optimize-sibling-calls -mhw-mul -mhw-mulx -O0 -g -I/cygdrive/c/altera/kits/nios2/bin/eclipse/workspace/hello_world/build/include -Wall -o hello.o hello.cpp
nios2-elf-gcc -r -d -L"c:/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.uClibc_1.4.0"/lib -o hello.bin hello.o /cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.1/../../../../nios2-elf/lib/libm.a /cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.1/libgcc.a "c:/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.uClibc_1.4.0"/lib/libc.a
hello.o(.text+0x0): In function `_start':
: multiple definition of `_start'
/cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.1/../../../../nios2-elf/lib/crt0.o(.text+0x0): first defined here
collect2: ld returned 1 exit status
make: *** Error 1
make: Target `all' not remade because of errors. Hope some of you can tell me what I am missing here. thx upfront. Regards Michael E