Thread: Using GCC

  1. #1
    Registered User
    Join Date
    Oct 2003
    Posts
    33

    Using GCC

    I need some help with GCC compiler. I downloaded and extracted the files. After that I'm not really sure what to do.


    I need to use GCC to run C applications

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    GCC doesn't run applications, it takes source code and gives you a binary that you can then run (depending on the arguments you give). Have you read the man pages for it yet?
    My best code is written with the delete key.

  3. #3
    Registered User
    Join Date
    Oct 2003
    Posts
    33
    i need to run the following commands...

    gcc file1.c -o file1
    gcc file2.c -o file2
    /file1
    /file2


    how do i do that?

  4. #4
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >how do i do that?
    I don't know, probably with a keyboard. If you don't know how to run an executable file, you shouldn't be using GCC. Go with something that holds your hand more.
    My best code is written with the delete key.

  5. #5
    Registered User Dante Shamest's Avatar
    Join Date
    Apr 2003
    Posts
    970
    >> I don't know, probably with a keyboard.

    Ouch.

    Hi Mak, you've got to explain yourself clearer. Help us help you.

    To run those commands, you need a terminal of some kind.
    Do you know how to use the command line?

  6. #6
    Registered User
    Join Date
    Oct 2003
    Posts
    33
    okay...for example when using JDK when you compile java files...you go to JDK/BIN/
    and there you use javac to compile


    I'm not sure how this works with GCC

    i have the folder itself

    when I just type gcc file1.c -o file1


    C:\gcc-3.3.3>gcc file1.c -o file1
    'gcc' is not recognized as an internal or external command,
    operable program or batch file.

  7. #7
    Registered User Dante Shamest's Avatar
    Join Date
    Apr 2003
    Posts
    970
    Is GCC in that directory?
    Isn't it in the BIN directory?

    If you just want to program C applications on Windows without worrying about all this command-line stuff, just download Dev-C++. It uses a version of GCC and it will save you alot of trouble.

  8. #8
    Registered User
    Join Date
    Oct 2003
    Posts
    33
    thats the problem..i could not find the GCC file itself or BIN directory

    but i'll try Dev-C++

  9. #9
    Registered User Dante Shamest's Avatar
    Join Date
    Apr 2003
    Posts
    970
    Wait. I think to compile C++ programs using GCC, you use g++.exe. Not gcc.exe?

  10. #10
    Registered User
    Join Date
    Oct 2003
    Posts
    33
    okay...i think i got it figured out now

    thanks

  11. #11
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    Originally posted by Dante Shamest
    Wait. I think to compile C++ programs using GCC, you use g++.exe. Not gcc.exe?
    yes, you would use G++, or sometimes C++ (the .EXE is a windows thing) for C++ code, but he's writing C code... I suggest using Dev C++ as well... you can take a little more deep look at the switches and programs it's using (just poke through the options for a while) and eventually you'll get the hang of it and you might be able to start using GCC on it's own...
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Profiler Valgrind
    By afflictedd2 in forum C++ Programming
    Replies: 4
    Last Post: 07-18-2008, 09:38 AM
  2. Replies: 4
    Last Post: 09-02-2007, 08:47 PM
  3. Compiles on gcc 3.3 but not on gcc 4.0.3
    By cunnus88 in forum C++ Programming
    Replies: 5
    Last Post: 03-29-2007, 12:24 PM
  4. gcc
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 21
    Last Post: 10-22-2003, 03:46 PM
  5. Mixing gcc 2.9* with gcc 3.*
    By rotis23 in forum Linux Programming
    Replies: 1
    Last Post: 07-19-2003, 12:21 AM