Ubuntu GCC compiling problem at a simple c++ program

2012-02-23  Source: Original Site  Category:Ubuntu  Views:7 

Advertisement

I try to compile the simplest c++ program, called hello.c by gcc hello.c and the errors are: hello.c:1:21: error: iostream.h: No such file or directory
hello.c: In function ‘main’:
hello.c:3: error: ‘cout’ undeclared (first use in this function)
hello.c:3: error: (Each undeclared identifier is reported only once
hello.c:3: error: for each function it appears in.)
hello.c:3: warning: return type of ‘main’ is not ‘int’
. I have gcc installed. There is no error if I use stdio.h and print but i'd like to use iostream too.

Related articles
  • Ubuntu GCC compiling problem at a simple c++ program 2012-02-23

    I try to compile the simplest c++ program, called hello.c by gcc hello.c and the errors are: hello.c:1:21: error: iostream.h: No such file or directory hello.c: In function ‘main’: hello.c:3: error: ‘cout’ undeclared (first use in this function) hell

  • Ubuntu gcc compiler problem (no include path) 2013-08-24

    I am unable to compile simple c program. I have installed gcc, g++, libc6-dev and build-essential without success. the program: #include <stdio.h> main() { printf ("Hello World!\n"); } the error: gcc main.c main.c:1:19: error: no include path i

  • Ubuntu gcc compiler problem 2013-07-24

    I am getting a error like stdio:library not found,whenever i compile using a gcc compiler,may i please know the reason and also some steps to go forward to the program...............

  • Ubuntu gcc compile problem 2012-12-14

    I am having some trouble compiling a file : / [email protected]:~/Desktop/aula4.rar_FILES/Matriz$ gcc matriz.c /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crt1.o: In function `_start': (.text+0x18): referência indefinida a `main' collect2: ld

  • Ubuntu GCC compiler problems 2014-07-09

    Hello, I've recently started out with the C language and I'm currently learning it from http://beej.us/guide/bgc/ and I got a question with a error message produced by GCC on my Ubuntu 7.04 box. Consider this code from a tutorial at it's site: #inclu

  • Ubuntu gcc compilation problem on Feisty 2014-09-24

    there, while I had Edgy installed on my laptop I used it a lot to compile C programs and never had any problems. Now, under a newly Feisty installation I get the same error over and over, even with a "hello world"... This is it: $ gcc wtv.c wtv.c:1:

  • Ubuntu GCC compilation problem 2015-01-06

    I am relatively new to ubuntu and am trying to install Maq sequence alignment program and I have run into a snag. I try to run ./configure and i end up with an error that it can't find ANSI C header files...and make then fails. I can't figure out was

  • Ubuntu GCC compilation problems 2015-04-21

    I recently installed Kubuntu. I tried to gcc some c code.. and I get this error: /usr/bin/ld: crt1.o: No such file: No such file or directory collect2: ld returned 1 exit status Do I need more packages? Currently I have these gcc related packages: gc

  • Ubuntu C compile problem with gcc 2012-05-18

    i cannot compile c files with gcc from the command-line, when i try the error message is: first.c:1:19: error: stdio.h: No such file or directory it is most probably because the gcc compiler cannot find any C libraries, i actually do not know even on

  • Ubuntu gcc compiling.... bugs 2014-12-22

    Error lines, Makefile nad source code (hw.cpp) Hi guys I am ubuntu user but for some reason out of my control I am using fedora core 6 I believe. I have been trying to compile a simple c++ program but I got the following error: ----------------------

  • Ubuntu GCC compiler needing.... 2012-07-08

    I have a little problem.... :) I've downloaded the image Ubuntu-7.04-desktop-i386 so I can run Ubuntu through VMware Player. The image I downloaded is ready to play with the VMware Player. Everything is working fine until this: I'm trying to install

  • Ubuntu gcc compiler instal 2013-09-23

    Hallo to everybody, I’m trying to install gcc compiler. After I wrote apt-get install gcc. In the beginning everything is OK and in the middle I get that the following packages cannot be authenticated. It seems that I don’t have this packages. I was

  • Ubuntu gcc compiler and recognizing standard libraries 2014-01-11

    So i couldn't find a fix for this on the forums, hopefully you can help. I'm pretty sure this should be an easy thing to fix, but i can't quite figure it out. I'm doing some basic C programming, and i was doing it all in windows, but i wanted to try

  • Ubuntu Another compiling problem 2014-04-08

    again, a compiling problem. I know it is not an ubuntu problem, but as there is no support for compiling the program I'm talking about, as it is comercial, I dont know where to get help. It is about QCad, which is in available in the USC. The problem

  • Ubuntu gcc compiler install 2014-05-20

    Hallo to everybody, I’m trying to install gcc compiler. After I wrote apt-get install gcc. In the beginning everything is OK and in the middle I get that the following packages cannot be authenticated. It seems that I don’t have this packages. I was

  • Ubuntu GCC compiler error 2014-10-02

    I have just install Ubuntu, and when I try to compile a simple C program using gcc, I get the following error. gcc <sourcefile.c> -o <outputfile.exe> hello.c:1:19: error: stdio.h: No such file or directory hello.c: In function ‘main’: hel

  • Ubuntu help -- compiler problem with driver source 2014-10-11

    I met a compiler problem with driver source as below: 1. uname -r is 2.6.31-17-generic and put kernel source linux-2.6.31 into /usr/src/ 2. make a link with linux/linux-2.6.31/include/linux/ 3. compiler simple code with usb driver using Anjuta 4. get

  • Ubuntu GCC Compiler does not work? 2015-03-31

    Hi, I'm fairly new to ubuntu, linux and unix but I have done a little C programming before. My problem is this, when I try to use ./configure for a new program I have downloaded it checks for a few things. Among those things is a GCC compiler which i

  • Ubuntu GCC compiler for edgy 2013-04-23

    peeps im new 2 ubuntu could some1 temme how 2 install gcc compiler for ubuntu edgy thnx in advance

  • Ubuntu GCC compiler is broken in my Kubutu 5.10 2014-07-15

    I just installed Kubutu 5.10 and everything had been working fine until I tried to compile a basic C program and it doesn't work. Here is the test program: #include <stdio.h> int main(void) { printf("Howdy out there!\n"); return 0; } I saved it