Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13
i want to lean using debian to develop C language, but i am a newbie, i don't know where to write the C programme and what tool to be used ...
  1. #1
    Just Joined!
    Join Date
    Mar 2010
    Posts
    14

    [SOLVED] develope C on debian

    i want to lean using debian to develop C language, but i am a newbie, i don't know where to write the C programme and what tool to be used to compile it. any tips would be appreciated. the more detail, the better.

  2. #2
    Just Joined!
    Join Date
    Mar 2010
    Posts
    7
    use gcc:

    Code:
    gcc helloworld.c -o helloworld
    use man to find out more.

    Code:
    man gcc

  3. #3
    Just Joined!
    Join Date
    Mar 2010
    Posts
    14
    thank you for you reply, but i don't know how to install gcc. could you tell me how to set it up,

  4. #4
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,568
    Open a terminal from menu, run following command
    sudo apt-get install build-essential
    If you logged in normal user,it'll prompt you for root password.
    After installing gcc,open any text editor , gedit , kwrite etc
    write the program and save it and then use
    gcc file.c -o file
    and run it as
    ./file
    - Lakshmipathi.G
    -------------------
    FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
    First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -------------------

  5. #5
    Just Joined!
    Join Date
    Mar 2010
    Posts
    14
    many thanks, Lakshmipathi. i have installed the gcc, what a good text editor for write c code, i won't want to use an IDE. i am a newbie, sorry to have lots of problems. i also want to know how to install a text editor , and how to open it, when i finished my code,how to save it and excute it.

  6. #6
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    A lot of text editors available in sources and a few are pre-installed by default.
    My first preference is nano. A simple, user friendly text edit.
    You can use pico, vi or vim too.
    Code:
    nano mycode.c
    Press Ctrl+X, Y and hit Enter key to save file.

    In case its not pre-installed, install it using apt-get.
    Code:
    su -c 'apt-get install nano'
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  7. #7
    Just Joined!
    Join Date
    Mar 2010
    Posts
    14
    thank you! sometimes, i see there is also a command of aptitude, what is the difference between 'apt-get and aptitude.

  8. #8
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    There is no difference now. aptitude had a few more features than apt-get earlier. New features have been included in latest version of apt-get and both are same now.

    Synaptic Package Manager is Graphical Interface of apt-get only.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  9. #9
    Just Joined!
    Join Date
    Mar 2010
    Posts
    14
    why i use {ctrl} x can't exit the editor ? thanks in advance.

  10. #10
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,316
    Ctrl+X is for exit but if you change anything in file or create new file, it will ask for saving. If you press Y and hit Enter key it will exit.

    Ctrl+X , exit file unmodified file.
    Ctrl+W, write changes. You have to press Ctrl+X to exit.
    Ctrl+X, Y and Enter to save and exit.

    More details are here.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

Page 1 of 2 1 2 LastLast

Posting Permissions

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