Options

Red Hat 9.0 C/C++ compiler

/usr/usr Member Posts: 1,768
Where can I get one and what's it called? I thought one was included with the install but I don't see it. Thanks.

Comments

  • Options
    WebmasterWebmaster Admin Posts: 10,292 Admin
    That would be the gcc command, and is indeed probably already installed.

    Check the following site for the documentation:
    http://gcc.gnu.org/onlinedocs/
  • Options
    Ricka182Ricka182 Member Posts: 3,359
  • Options
    /usr/usr Member Posts: 1,768
    I found GCC on a site last night to download. I was just looking under the Programming section of the menu, assuming it would be there.

    What's the easiest way to find out if it's installed?
  • Options
    methoselahmethoselah Member Posts: 49 ■■□□□□□□□□
    1. write your program using a text editor,
    2. save with extension ".c", (example: programname.c)
    3. open up your console/command line interface ("konsole" if your using the KDE gui)
    4. navigate to where your file is
    5. to compile type gcc -o programname programname.c
    6. to run the program type ./programname
  • Options
    WebmasterWebmaster Admin Posts: 10,292 Admin
    What's the easiest way to find out if it's installed?
    By running the command gcc without options, as root.
  • Options
    /usr/usr Member Posts: 1,768
    Im copying some sample C programs from a book and cant get them to comple. Im looking at some sample programs online and see something at the beginning that looks like the

    #include < stdio.h>

    I have nothing like this as the samples in the book Im looking at just jump right in to the code. I'm new to C, but know java. Just need to know what Im leaving out. Thanks a lot.
  • Options
    /usr/usr Member Posts: 1,768
  • Options
    /usr/usr Member Posts: 1,768
    code
    int main(int argc, char, *argv[])
    {

    char buffer[500];
    strcopy(buffer, argv[1]);
    return 0;

    }




    error
    /tmp/cc61kvbw.o(.test+0x26): In function 'main':
    : undefined reference to 'strcopy'
    collect2: ld returned 1 exit status



    I'm stumped. I've followed examples exactly as is but with no luck. I'm running Red Hat 9.0
    Any help would be much appreciated. I'm getting relatively the same error in every program. That is the "undefined reference" error
  • Options
    /usr/usr Member Posts: 1,768
    Got it, nevermind. icon_wink.gif
Sign In or Register to comment.