- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm trying to bring some existing code into a program that relies on the GCC compiler finding include files in other project include directories For example x/x.c says: # include "myinclude.h" To include the file include_dir/myinclude.h When I bring the code into eclipse it initially reports "unresolved inclusion: myinclude.h" at the line where the file is included - which is completely reasonable as I haven't told eclipse where to find myinclude.h. Then I went into the project properties to c/c++ general --> paths and symbols ->includes and added include_dir (export, for all languages, workspace directory). This resolves the 'unresolved inclusion' message but when I try to build the code the include file isn't found by the compiler. Looking at the compiler command line there is no '-I' option on the compiler command line to tell the compiler about the directories I added. Any suggestions on how to get the GCC to look in additional directories for its include files? Thanks, Darren.Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What version of the tools are you using? If you are using the Nios II IDE, you can simply add the -I option to the compiler flags. Open the software project's properties then click "C/C++ Build" on the left. Then under "Nios II Compiler" click the "General" section. The top entry is for compiler flags. Here you can put in any gcc compiler flags (like -I)
Jake- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Jake,
I've just moved from the NIOS 9.0 IDE to NIOS 9.1 Software Built Tools for Eclipse (a decision I'm quickly regretting ). It seems there's an entry in the generated Makefile (ALT_INCLUDE_DIRS) that looks right but I'm not sure if Eclipse will ever overwrite it. Thanks, Darren.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Let me first say that I believe moving to the software build tools flow is a good choice. You just need to work through the transition. Once you do I think you'll be glad you did. Essentially Eclipse has very limited interaction. You must do everything under the NIOS II section of the project's properties. These settings in turn make modifications to the project's makefile. With the build tools it's a makefile you are maintaining and configuring rather than eclipse project settings.
Jake- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Jake. Unfortunately there doesn't seem to be anything in the NiosII entry for the project to help me with this issue but it does seem like changing this data in Makefile directly is safe amd gets the job done
It's just a shame that setting the directory path in eclipse doesn't push the changes into the Makefile but I guess I'll have to live with that :) Thanks again, Darren.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the 9.1 tools, you open the project properties then expand the "Nios II Application Properties" and click on the "Nios II Application Paths" subsection. Then you add your include folders to the "Application include directories" area. These will become "-I" statements in the makefile.
Jake- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- In the 9.1 tools, you open the project properties then expand the "Nios II Application Properties" and click on the "Nios II Application Paths" subsection. Then you add your include folders to the "Application include directories" area. These will become "-I" statements in the makefile. Jake --- Quote End --- I see what you were getting at now - sorry for being slow. I guess I need to look at the NIOS Application properties first and only then resort to the more-general Eclipse ones. Do you know if there's documentation for the Altera-specific Eclipse features available? I grabbed the one-click documentation for Nios 9.1 but there didn't seem to be anything applicable. Thanks, Darren.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm pretty sure this is what you need:
http://www.altera.com/literature/hb/nios2/n2sw_nii5v2_01.pdf Jake- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks. I skimmed the full version and didn't notice anything appropriate - the text seem mostly tutorial rather than references.
I didn't see any references to the properties screen you directed me to but I'll keep looking. Darren.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It's on page 2-8.
Jake- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- "Nios II Application Paths" subsection. --- Quote End --- Yep - that worked for me; I had the same problem, and was a bit confused because the indexer worked but the compiler didn't!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is exactly the same problem I am having. I added my include paths under C/C++ General -> Paths and Symbols. This did not let the compiler find my include paths other than the default ones and I could see the gcc lines did not mention my paths. Project Explorer DID display the paths under Includes. I then added the paths under Nios II Application Properties. I selected Convert Relative Path and hit Apply and Close. Nothing changed in the project explorer, i.e. the new paths weren't listed. I opened the project properties again and went to the Nios II Application Properties section, and the relative paths were gone, as if I had never added them. I added them as absolute paths and they appeared in the project explorer AND under the C/C++ General -> Paths and Symbols section. It seems that C/C++ General -> Paths and Symbols is only for displaying the defaults and what is added, not for actually adding anything despite the fact the interface makes you think you can.
There is something wrong here. The C/C++ General -> Paths and Symbols section and the Nios II Application Properties seem to do the same thing, even though only the latter really works. Also, the relative paths do not appear to work or even be saved.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Strange. I've been using Nios II project properties to set the application include paths w/ the relative paths option and it seems to work perfectly.
It also survives bring checked in via CVS and being checked out somewhere else which has proved to be handy. I wish that relative paths could be added directly (rather than selecting the whole path) but it's a very minor thing.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
basafran, I had the same problem as you - after entering the include path in Properties -> Nios II Application Properties -> Nios II Application Paths they where gone when the settings opened again.
I think there is a problem with the access rights of file system. After I chaged they with chmod -R +w <application_dir> in the Nios command shell the settings maintains. (the rights for the bsp dir I have also changed) Jens- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Alternatively I changed the Makefile in the application directory. There is an APP_INCLUDE_DIRS variable which I have set:
# List of application specific include directories, library directories and library names APP_INCLUDE_DIRS += <path1> APP_INCLUDE_DIRS += <path2> The Eclipse IDE recognizes the changes and shows the paths in Properties -> Nios II Application Properties -> Nios II Application Paths Jens- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page