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++
12590 Discussions

Adding project root directory to include paths does not work

jackhab
New Contributor I
1,398 Views

I was trying to add project root directory to include search path in Project > Properties > Nios II Application Paths > Application include directories.

(This is needed in case Project/somedir/file.c needs to include Project/file.h using #include "file.h" instead of #include "../file.h")

When I select current project it is converted to relative path and added as "./", which adds "-I./" switch to compilation command.

This breaks compilation because gcc does accept "-I./" - the correct syntax should be "-I." without slash.

The issue can be solved by manually removing the slash in APP_INCLUDE_DIRS in the Makefile.

IMO,  looks like EDS bug.

0 Kudos
4 Replies
BoonBengT_Intel
Moderator
1,385 Views

Hi @jackhab,

Thank you for posting in Intel community forum, hope this message find you well.
Much appreciated your help in pointing this out to us, we would surely look into this and apologies for the inconvenient faced.
Further clarification on the situation, do you mind to share with us what quartus version that you faced the problem in? And after adding the 'Application include directories', I presume that the Application library directories and Library name are also being added yes? If possible, it would be a great help to get a screenshot of the paths added from your end to investigate further.

Warm regards.
BB

0 Kudos
jackhab
New Contributor I
1,381 Views

Hi @BoonBengT_Intel 

I'm using Quartus 18.1 on Windows.

Application library directories and Library name are not added since the issue I'm describing is not related to library (I'm not using libraries at all, except, of course the BSP) rather than compiling C sources inside the same NIOS application project.

In the attached screenshots you can see I added top-level application project directory (called Nios) to include search paths.

Despite "-I./" being passed to gcc the file Nios/Drivers/gps.c cannot include Nios/logger.h.

As I said above, manually changing APP_INCLUDE_DIRS from "./" to "." in the Makefile fixes the compilation.

0 Kudos
BoonBengT_Intel
Moderator
1,293 Views

Hi @jackhab,

Apologies for the late response and noted with thanks on the details of the issues.
This might be a bug for an older version of Nios, allow us to confirm if issues are still persisting in the newer version, and will files a bug to the development team to ensure this is worked on.
As well as creating a knowledge base article for this workaround mentioned.

Will proceed to close this thread as no further clarification, if there is still any thing that we can help with please do post a response in the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support

Thank you.

Warm regards
BB

0 Kudos
jackhab
New Contributor I
1,284 Views

I use Quartus 18.1 and can confirm the bug exists in this version.

0 Kudos
Reply