Altera_Forum
Honored Contributor
20 years agobuilt program in nios2 IDE 5.0
Hi all:
I make ncurses 5.5 and cdk source code by RED HAT LINUX 8.0. After make I got the include files and the interrelated libcdk.a , libncurses.a .Then I edit my application program use Microtronix Nios II LINUX Application Project module in nios2 IDE 5.0. My source code as follows: # include "cdkscreen.h" int main(void) { initCDKColor(); return 0; } My makefile as follows: # # configurable options# - set DEBUG = 1 to turn on debugging support# DEBUG = 1 PROJ_NAME = testcdkc LIBNETDIR := cdk_lib INSTALL_DIR = PROGS := $(PROJ_NAME).exe CFLAGS += # # You should not need to modify anything beyond this point# include Rules.mak ifeq '$(DEBUG)' '1' PROGS += $(PROGS:.exe=.gdb) endif CFLAGS += -I include -I ncurses_include -I$(LIBNETDIR) LDLIBS += $(LIBNETDIR)/libncurses.a $(LIBNETDIR)/libcdk.a all: $(PROGS) .PHONY: clean clean: -rm -f *.[oad] *.elf *.gdb *.bin *.exe .PHONY: install install: all ifeq "$(INSTALL_DIR)" "" $(error No installation directory specified) endif mkdir -p $(INSTALL_DIR)/bin install -v $(filter %.exe, $(PROGS)) $(INSTALL_DIR)/bin But I build the program fail. The fail information as follows: make -k all no emulation specific options. nios2-elf-gcc -nostdinc -D__linux__ -O0 -g -I"d:/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.uClibc_1.4.0"/include -I/cygdrive/d/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 -I include -I ncurses_include -Icdk_lib -Wall -c -o testcdkc.o testcdkc.c nios2-elf-gcc -msys-crt0="d:/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.uClibc_1.4.0"/lib/crt0.o -r -d -L"d:/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.uClibc_1.4.0"/lib -o testcdkc.bin testcdkc.o /cygdrive/d/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.1/../../../../nios2-elf/lib/libm.a /cygdrive/d/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.1/libgcc.a "d:/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.uClibc_1.4.0"/lib/libc.a cdk_lib/libncurses.a cdk_lib/libcdk.a cdk_lib/libnet.a /cygdrive/d/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.1/../../../../nios2-elf/bin/ld: cdk_lib/libcdk.a(draw.o): Relocations in generic ELF (EM: 3) cdk_lib/libcdk.a: could not read symbols: File in wrong format collect2: ld returned 1 exit status make: *** [testcdkc.bin] Error 1 make: Target `all' not remade because of errors. rm testcdkc.o I think the reason of my failure is cygwin/bin/../lib/gcc/nios2-elf/3.4.1/../../../../nios2-elf/bin/ld: cdk_lib/libcdk.a(draw.o): Relocations in generic ELF (EM: 3) cdk_lib/libcdk.a: could not read symbols: File in wrong format collect2: ld returned 1 exit status make: *** [testcdkc.bin] Error 1 Who can tell me resolvent? I think it cause to libcdk.a through RAD HAT LINUCX turn into, it is fail to compile to lead to the fact. Thanks a lot