Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
12452 Discussions

NIOS II linker cannot find function that is referenced in the main source file

Altera_Forum
Honored Contributor II
825 Views

Hello, 

 

Quite strange error appears while building project: 

 

undefined reference to `function1(unsigned long, unsigned long) 

 

function1 is located in one of the project source files and corresponding# include directive does present in the source file where function1 is referenced. 

 

Did someone experience such issues ? 

 

Thanks
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
136 Views

Problem is resolved but the cause of problem remains obscure. 

I changed extension of the file where function1 is defined ... from .c to .cpp

And it worked ... perhaps because the main source file (i.e. where is main function) is .cpp

Apparently, the g++ linker "doesn't like" mixing .c and .cpp sources.
Reply