Results 1 to 6 of 6

Thread: help regarding c programming

  1. #1
    Join Date
    Feb 2008
    Location
    Hyderabad/Baltimore
    Beans
    15

    help regarding c programming

    hi,

    i've just started out doing c programs in ubuntu, but i am facing problems while executing them.the compiler is not detecting any of the header files i.e <stdio.h>, <conio.h> n so on.i want to know if there is any particular package to be installed for this particular problem or is there any alternative.

    thanx in advance.

  2. #2
    Join Date
    Jan 2006
    Beans
    961

    Re: help regarding c programming

    Code:
    sudo aptitude install build-essential
    ..conio.h is an old non-standrad Borland header.. a similar library is ncurses

    Code:
    sudo aptitude install libncurses5-dev
    Last edited by lnostdal; February 22nd, 2008 at 07:45 AM.

  3. #3
    Join Date
    Nov 2004
    Location
    Portland, Or, USA
    Beans
    289
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: help regarding c programming

    I think you might want build-eesentials to include everything you might need...

    Look in /usr/include for them andif they're not there then you still need soemthing...

    ls -l /usr/include/stdio.h

    Code:
    $ ls -l /usr/include/stdio.h
    -rw-r--r-- 1 root root 28517 2007-10-24 17:42 /usr/include/stdio.h
    Z.

  4. #4
    Join Date
    Jun 2006
    Location
    CT, USA
    Beans
    5,267
    Distro
    Ubuntu 6.10 Edgy

    Re: help regarding c programming

    Sticky explain this issue, and many more. Just read it. Answer is 3 mouseclicks away

  5. #5
    Join Date
    Feb 2008
    Location
    Hyderabad/Baltimore
    Beans
    15

    Re: help regarding c programming

    @Inostdal n Zwack

    thnx for the replies, i got the answer.i had to install build-essential from the ubuntu installation cd because terminal was giving an error when i gave the command "sudo aptitude build-essential".it said "unknown command build-essential".So i had to search n install it from the cd.

    thnx zwack, the path u were mentioning wasnt present at first, but its there now after installing build-essential.

    One more thing, Inostdal u were mentioning about ncurses, but when i tried to install it some packages got installed n some didnt, it was saying tht some of the packages were not being installed(it gave a big list).

    finally when i put tht header file(the way i gave was #include<ncurses.h>, i suppose its right if not correct me), it did not detect the header file

  6. #6
    Join Date
    Jan 2006
    Beans
    961

    Re: help regarding c programming

    ah, that should have been
    Code:
    sudo aptitude install build-essential
    One more thing, Inostdal u were mentioning about ncurses, but when i tried to install it some packages got installed n some didnt, it was saying tht some of the packages were not being installed(it gave a big list).
    don't worry about it .. it is just informing you about new versions of packages you might be interested in

    finally when i put tht header file(the way i gave was #include<ncurses.h>, i suppose its right if not correct me), it did not detect the header file
    i don't think you understand .. you can't just add that to the code that previously used conio.h etc. and expect it to work by itself .. you must port the code/software ( http://en.wikipedia.org/wiki/Porting ) since the original authors have chosen to write code that is non-portable
    Last edited by lnostdal; February 22nd, 2008 at 07:54 AM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •