Altera_Forum
Honored Contributor
11 years agoLinking error. Problem on "undefined reference to...." in NIOS II IDE 11sp1
hello!
I am new in quartus 11 and NIOS II IDE 11sp1 for development. The project concludes four source files. the main() function is in my_file_for_blank_project_0.cpp the other three source files all have their corsponding H files included in my_file_for_blank_project_0.cpp. But when I build project, the console shows : **** Build of configuration Debug for project my_blank_project_0 **** make -s all includes Compiling file_sys.c... Compiling hal.c... Compiling host.c... Compiling my_file_for_blank_project_0.cpp... Linking my_blank_project_0.elf... obj/my_file_for_blank_project_0.o(.text+0x1c4): In function `main': ../my_file_for_blank_project_0.cpp:46: undefined reference to `host()' collect2: ld returned 1 exit status make: *** [my_blank_project_0.elf] Error 1 the host() function is in host.c and also declared in host.h. the corresponding four *.o files can also be produced. I do not know how to solve it. Can anyone with kindness help me?