As was foretold, we've added advertisements to the forums! If you have questions, or if you encounter any bugs, please visit this thread: https://forums.penny-arcade.com/discussion/240191/forum-advertisement-faq-and-reports-thread/
Options

C compiler

DeswaDeswa Registered User regular
edited December 2006 in Help / Advice Forum
So I have to become competent in C before the next semester starts and I already have a guide. Where can I get a free C compiler?

gobassgo wrote:
"It ain't rape, it's surprise sex!"
wii : 3788 3264 2419 8070
Deswa on

Posts

  • Options
    jclastjclast Registered User regular
    edited December 2006
    Deswa wrote:
    So I have to become competent in C before the next semester starts and I already have a guide. Where can I get a free C compiler?

    Two solutions, neither of them particularly convenient.

    1.) If you're doing this as a college course and have access to the computer science labs, they should have computers with the same compiler you'll use in class installed on them.

    2.) Build a Linux box. Every distro I've ever run comes with gcc.

    jclast on
    camo_sig2.png
  • Options
    DeswaDeswa Registered User regular
    edited December 2006
    The problem is I do not have access to the school computers until the semester starts. Im back home for the break.

    Deswa on
    gobassgo wrote:
    "It ain't rape, it's surprise sex!"
    wii : 3788 3264 2419 8070
  • Options
    Bob SappBob Sapp Registered User regular
    edited December 2006
    There is a gcc port for windows. Google it.

    Other options:

    - Download Dev-C++, a free C/C++ IDE. It comes with the gcc port.
    - I believe there is a free version of Microsoft Visual C++ IDE (which comes with Microsoft's compiler) that you can download from their site. It's meant for learning purposes. Not 100% sure though.

    Bob Sapp on
    fizzatar.jpg
  • Options
    Jimmy KingJimmy King Registered User regular
    edited December 2006
    Borland and MS both offer free versions of their C++ compilers. Most C++ compilers also handle C just fine (as C++ is really just an extension of C) and I imagine this goes the same for the Borland and MS offerings.

    There is also a windows version of gcc which you could use. Alternatively, you could install Cygwin and I'd bet that has gcc, too (I don't use Cygwin to know for sure).

    Jimmy King on
  • Options
    curbycurby Registered User regular
    edited December 2006
    Can't you get Visual Studio Express? It's free and stuff. I'm not sure if they have C, though. They have C# and C++.

    http://msdn.microsoft.com/vstudio/express/

    curby on
    linktous.gif
  • Options
    DeswaDeswa Registered User regular
    edited December 2006
    Okay, thanks for the info. I grabbed Visual Studio Express.

    Deswa on
    gobassgo wrote:
    "It ain't rape, it's surprise sex!"
    wii : 3788 3264 2419 8070
  • Options
    DrFrylockDrFrylock Registered User regular
    edited December 2006
    You can indeed download Cygwin and install gcc; it works very well on Windows for basic programming tasks.

    DrFrylock on
  • Options
    iTunesIsEviliTunesIsEvil Cornfield? Cornfield.Registered User regular
    edited December 2006
    DrFrylock wrote:
    You can indeed download Cygwin and install gcc; it works very well on Windows for basic programming tasks.
    Do it. Cygwin is a god-send for those of us that have used a linux terminal before.

    iTunesIsEvil on
  • Options
    Joseph StalinJoseph Stalin Registered User regular
    edited December 2006
    DrFrylock wrote:
    You can indeed download Cygwin and install gcc; it works very well on Windows for basic programming tasks.
    Do it. Cygwin is a god-send for those of us that have used a linux terminal before.

    I have found Cygwin code doesn't always port to Linux well. As in, it runs in Windows and crashes when compiled on a Linux machine. This hasn't happened to me, however, and I believe it happened to friends when they fucked up allocating memory. I guess Windows is a bit more forgiving.

    Joseph Stalin on
    Let the ruling classes tremble at a Communist revolution. The proletarians have nothing to lose but their chains. They have a world to win.

    Workingmen of all countries, unite!
  • Options
    DrFrylockDrFrylock Registered User regular
    edited December 2006
    I have found Cygwin code doesn't always port to Linux well. As in, it runs in Windows and crashes when compiled on a Linux machine. This hasn't happened to me, however, and I believe it happened to friends when they fucked up allocating memory. I guess Windows is a bit more forgiving.

    If you screw up in allocating, accessing, and de-allocating memory in C or C++, then the results are undefined. The fact that it "works" on Windows and not Linux is just a fluke - this is not a porting problem or a deficiency in GCC. It's like saying "There must be something wrong with this intersection, because I never run anybody over when I breeze through the red light on the other side of town..."

    I do recall one specific case where you can have a porting problem, and that has to do with word alignment of variables. On some platforms, you're allowed to have a variable, say an integer, span across machine word boundaries. On others, this causes a bus error (I don't remember if this situation is compiler-specific, OS-specific, platform-specific, or some combination of the above). As usual, Wikipedia has an article on this.

    DrFrylock on
  • Options
    MasterDebaterMasterDebater Registered User regular
    edited December 2006
    Even better, install Cygwin and Eclipse, then download the CDT (C/C++ dev tools) for Eclipse.

    You'll wonder how you ever got stuff done before.

    MasterDebater on
  • Options
    JaninJanin Registered User regular
    edited December 2006
    I have found Cygwin code doesn't always port to Linux well. As in, it runs in Windows and crashes when compiled on a Linux machine. This hasn't happened to me, however, and I believe it happened to friends when they fucked up allocating memory. I guess Windows is a bit more forgiving.

    Show your friends Valgrind. It's an extremely useful set of training wheels, until they become good enough not to munge memory.

    Janin on
    [SIGPIC][/SIGPIC]
  • Options
    itylusitylus Registered User regular
    edited December 2006
    djgpp?

    itylus on
  • Options
    PiRaTe!!!PiRaTe!!! Registered User regular
    edited December 2006
    I use Cygwin for compiling and Visual C++ as an editor, as I hate doing programming in the built-in editors like emacs or pico but I like the quick compiling in Cygwin.

    I also used Dev C++ for awhile, but stopped using it as code that is produced in Dev C++ didn't always translate great in a Unix environment.

    PiRaTe!!! on
    PiRaTe001.png
  • Options
    ffordefforde Registered User regular
    edited December 2006
    Even better, install Cygwin and Eclipse, then download the CDT (C/C++ dev tools) for Eclipse.

    You'll wonder how you ever got stuff done before.

    Eh... I love Eclipse for Java development, but in my personally opinion CDT is not up to the same level of quality as it's Java counterpart. It's not bad but once I got it set up and had used it for a while, I ultimately ended up switching back to Visual Studio. This is one of those "check back in 6 months" projects for me. I desperately want to embrace Eclipse/CDT, but it is not quite there yet for me. Of course everyone is looking for something different though.

    fforde on
Sign In or Register to comment.