Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12589 Discussions

Nios II Eclipse "undefined reference to"

Altera_Forum
Honored Contributor II
3,448 Views

Hi all, 

 

I've just downloaded Quartus 13Sp1. I'm having a 3 day issue with eclipse and I was hoping the support pack may have provided the solution, unfortunately it did not! The problem is when i compile my project in Eclipse I get the following error. 

 

https://www.alteraforum.com/forum/attachment.php?attachmentid=8605  

 

I've searched high and low, tried the linker fix where I added -lm to 'project'\niosII application properties\Linker flags - perhaps I'm doing it wrong. 

I've examined my code, it compiles when I do not include [ //xxxx ] the lines of code causing the error. 

I appreciate this may be a stupid question to the more experienced members, but I'm at my wits end with it. 

Eclipse is quirky so I'm always sure to, save all changes. Then regenerate/clean build and finally build the bsp. 

And again, clean build and build the project. 

 

If I go project properties/C/C++ General/Paths and Symbols - the included directories are shown below 

 

https://www.alteraforum.com/forum/attachment.php?attachmentid=8606  

 

The next tab Symbols is populated. A possible issue may be the Libaries and Library Paths tabs are both empty.  

Source Location conatain folder /'project' 

 

The code itself: I have my main.c program and included two header files. The functions causing the issue is contained in a header file. The main.c has include"xxxxx.h" for both header files but I keep getting the errors. 

 

The following article seems to be well on the buck but no joy again http://stackoverflow.com/questions/5005363/undefined-reference-to-sin-in-c 

Perhaps I'm overlooking or doing something wrong, any help or tips would be much appreciated. 

 

Cian
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
1,826 Views

Hi, try : right click on your project, "rebuild index"

0 Kudos
Altera_Forum
Honored Contributor II
1,826 Views

Thanks for taking the time to reply. 

No joy with that I'm afraid :/
0 Kudos
MMejo
Beginner
1,826 Views

Hello,Did you figure this problem out?

0 Kudos
Reply