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

Includes

Altera_Forum
Honored Contributor II
1,035 Views

Hello! 

 

I include some headers in one c-file of a project. 

These headers are in other directories as the c-file. 

 

I can't use absolute paths to include the header files, 

because the headers include files in there own directory. 

 

So I open in system properties "C/C++ Inclde Paths & Symbols". 

Here I add via button "Add External Include Path..." the 

directory of the header-files and their includes. 

But when I compile again the compiler can't still find headers. 

 

What is going wrong? 

 

Bye, Lothar.
0 Kudos
6 Replies
Altera_Forum
Honored Contributor II
320 Views

include "../../a.h" //as an example

0 Kudos
Altera_Forum
Honored Contributor II
320 Views

Hi Mountain! 

 

Sorry, I didn't mention that I don't want to use relative paths too. 

I'm searching for a possibility to set include paths for the compiler 

for a project in Nios II. 

 

 

Bye, Lothar.
0 Kudos
Altera_Forum
Honored Contributor II
320 Views

 

--- Quote Start ---  

originally posted by maico@Oct 11 2005, 07:39 AM 

hi mountain! 

 

sorry, i didn't mention that i don't want to use relative paths too. 

i'm searching for a possibility to set include paths for the compiler 

for a project in nios ii. 

 

 

bye, lothar. 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=10295) 

--- quote end ---  

 

--- Quote End ---  

 

 

Edit your Makefile and add -I<path-to-include-dir> to your CFGLAGS (Note: -I is a capital i not an L). 

After that you can include the files with# include <file> 

The path you give with the -I flag can be either absolute or relative. 

 

Hop this helps
0 Kudos
Altera_Forum
Honored Contributor II
320 Views

I ran into the same problem. The project properties setting doesn&#39;t seem to do anything with regards to the path settings.

0 Kudos
Altera_Forum
Honored Contributor II
320 Views

Could you post your makefile?

0 Kudos
Altera_Forum
Honored Contributor II
320 Views

Hi Mountain! 

 

My makefile is: 

ifneq ($(KERNELRELEASE),)# kbuild part of makefile obj-m := hello.o else# Normal Makefile KERNEL_PLUGIN:= /cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0 KERNELDIR := $(KERNEL_PLUGIN)/linux-2.6.x BUILDDIR := /cygdrive/c/Entwicklung/NIOS/workspace3/hello_driver_linux all::     $(MAKE) -C $(KERNELDIR) M=`pwd` O=$(BUILDDIR) -o $@ endif 

 

And it&#39;s making a lot of compiler errors, which caused by path problems. 

 

 

Bye, Lothar.
0 Kudos
Reply