Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: problem compiling c program

  1. #11
    Senior Member
    Join Date
    Oct 2001
    Posts
    107
    Yes, it did it automatically when I installed linux. Also, I copied a program from CD, but when I
    tried to run the sucker it didn't work. The green files. What the hell am I doing wrong?

  2. #12
    Banned
    Join Date
    Nov 2001
    Posts
    188
    i always liked the c++ way of doing things


    #include <iostream.h>

    int main (){
    cout>>"Hello world\n";
    return 0;}

    i haven't tried it in linux so i don't even know if i'm right!

  3. #13
    Junior Member
    Join Date
    Jan 2002
    Posts
    5

    Angry

    Why the hell is this so complicated?

    The question I believe was simple. The answers were many and yet misguiding....
    Damn you lamers!

  4. #14
    Junior Member
    Join Date
    Dec 2001
    Posts
    11

    In the end

    [color=blue]I try to explain how to do a C program and compiler in Linux step by step, I hope that with this you can compile a program in C.
    1) First use editor to write the program for example pico
    pico hello.c
    2) Write the program:
    #include<stdio.h>
    main ()
    {
    system("cls");
    printf("\nHello world");
    }
    3) Compile the program:
    gcc hello.c -o hello
    4) Execute the program
    ./hello
    This is all the steps you have to do I hope you compile your program by and good luck [color=blue]
    Hide your face forever
    dream and search forever
    night and night you feel nothing
    there\'s no way outside of my land

    Open your eyes, open your mind ...



  5. #15
    Check if all ur library files are in your include folder

Posting Permissions

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