Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
19 years ago

Problems with the header <iostream.h>

Hello, I need help with the inclusion of the header file <iostream.h> because I&#39;ve a following problem:

My application has two Include Paths Containers in the directories:

C:\altera\kits\nios2\bin\eclipse\plugins\com.microtronix.nios2linux.uClibc_1.4.0

C:\altera\kits\nios2\bin\nios2-gnutools\H-i686-pc-cygwin\lib\gcc\nios2-elf\3.4.1\include

but when I built project appeared the following message of error:

make -k all

no emulation specific options.

nios2-elf-gcc -nostdinc -D__linux__ -O2 -I"c:/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.uClibc_1.4.0"/include -I/cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.1//include -fno-optimize-sibling-calls -mhw-mul -mhw-mulx -Wall -c -o mytest2.o mytest2.c

mytest2.c:5:22: iostream.h: no such file or directory

mytest2.c:10: error: `cout&#39; undeclared (first use in this function)

mytest2.c:10: error: (Each undeclared identifier is reported only once

mytest2.c:10: error: for each function it appears in.)

make: *** [mytest2.o] Error 1

make: Target `all&#39; not remade because of errors.

Then I found the file iostream.h but in this directory:

C:\altera\kits\nios2\bin\nios2-gnutools\include\c++\3.4.1\backward

I tried to include this path in the application properties with "Add External Include Path..." but this don&#39;t work either because it sent me the following message of error:

make -k all

no emulation specific options.

nios2-elf-gcc -nostdinc -D__linux__ -O2 -I"c:/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.uClibc_1.4.0"/include -I/cygdrive/c/altera/kits/nios2/bin/nios2-gnutools/H-i686-pc-cygwin/bin/../lib/gcc/nios2-elf/3.4.1//include -fno-optimize-sibling-calls -mhw-mul -mhw-mulx -Wall -c -o mytest2.o mytest2.c

mytest2.c:5:22: iostream.h: no such file or directory

mytest2.c:9: warning: return type defaults to `int&#39;

mytest2.c: In function `main&#39;:

mytest2.c:10: error: `cout&#39; undeclared (first use in this function)

mytest2.c:10: error: (Each undeclared identifier is reported only once

mytest2.c:10: error: for each function it appears in.)

make: *** [mytest2.o] Error 1

make: Target `all&#39; not remade because of errors.

somebody has an idea to solve this problem?

1 Reply

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Part of your issue, perhaps your whole problem, is that your filename has a .c extension. C++ code should have a .cpp extension, right?

    Cheers,

    - slacker