Forum

How do I compile C?

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

How do I compile C?

Postby Mexicouger » Thu Dec 09, 2010 2:56 am

Just wondering if there are any programs that are easy to setup so I can compile .c Files. I want to start learning the basics and test things (Try the exercises my book says to do)

But I fail to find one. Any links or helpful info?
User avatar
Mexicouger
 
Posts: 514
Joined: Sat May 01, 2010 10:12 pm

Postby revelator » Thu Dec 09, 2010 3:02 am

for starters and if your pockets deep :P

http://www.codeblocks.org/downloads/26

get the one with the included mingw compiler.

its not msvc but its damn good newer the less :)

and you get the added benefit that it works with several other compilers out there if gcc doesnt fit your style.
User avatar
revelator
 
Posts: 2567
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Postby Feared » Thu Dec 09, 2010 3:32 am

http://www.microsoft.com/express/Downloads/

I believe there are compile guides around here on the forums somewhere.
Visual Studio 2010, the best IDE out there known to man. (codeblocks sucks, ololol)
User avatar
Feared
 
Posts: 95
Joined: Fri Jun 11, 2010 11:58 pm
Location: Wylie, TX

Postby Mexicouger » Thu Dec 09, 2010 3:44 am

I am going to try Codeblocks for now.
User avatar
Mexicouger
 
Posts: 514
Joined: Sat May 01, 2010 10:12 pm

Postby frag.machine » Thu Dec 09, 2010 11:29 am

Feared wrote:http://www.microsoft.com/express/Downloads/

I believe there are compile guides around here on the forums somewhere.
Visual Studio 2010, the best IDE out there known to man. (codeblocks sucks, ololol)


I wish I could get rid of this POS called VS2010 in my work. :(
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2090
Joined: Sat Nov 25, 2006 1:49 pm

Postby goldenboy » Thu Dec 09, 2010 1:29 pm

with gcc and a makefile.

:twisted:
User avatar
goldenboy
 
Posts: 924
Joined: Fri Sep 05, 2008 11:04 pm
Location: Kiel

Postby Baker » Thu Dec 09, 2010 1:35 pm

What Code::Blocks has going for it:

1) It is small.
2) It can be installed quickly.
3) The IDE is great; it could use a couple of Visual Studio features though.

Just download the Code::Blocks + MinGW installer (75 MB) and you are immediately ready to go.

An IDE has the main purpose of being the interface to write code and the Code::Blocks IDE is very solid. I also like that the Code::Blocks project files are human editable XML.

The obvious additional pluses of Code::Blocks are that it is open source and multi-platform. [Although using Code::Blocks on Mac OS X is not really viable due to how OS X apps are actually a folder with a crapton of files in it and it virtually takes XCode to make an OS X app. Code::Blocks can compile an OS X binary fine, but unlike Windows/Linux a Mac OS X application isn't just a binary.]

goldenboy wrote:with gcc and a makefile.

:twisted:

Code::Blocks has a plug-in that can export makefiles. I've not used it.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby revelator » Thu Dec 09, 2010 4:29 pm

unzip this in your codeblocks folder for the latest stuff.

ftp://90.184.233.166:21/codeblocks-late ... plugins.7z

includes all plugins accepted into trunk.

help compiler using doxygen (can do pretty much any format including chm).

cscope support.

and since i built this using my own fork of the mingw64 runtime (no mingw dll dependancy :P).
User avatar
revelator
 
Posts: 2567
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Postby Sajt » Thu Dec 09, 2010 5:54 pm

MSVC2010 is clunky as can be (unsurprisingly), but although it's a lot slower and uglier than 2005 and 2008, at least its IntelliSense isn't nearly as buggy. If you want speed anyway, use MSVC 6, though it's pretty problematic.

Nothing is clearer than GCC with makefiles though. Except I never figured out the first thing about makefiles.
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Postby Feared » Thu Dec 09, 2010 7:22 pm

Oh you guys! ;)

It's okay, I see how it is. You just can't handle the man power Visual Studio has. No but seriously, I do agree that VS2010 is over bloated but these over bloated features don't get in the way and that's whats important. I guess Code blocks does the job but I mean, Visual studio can do the job so much better. If you have an hour to waste on installing it anyways.

@Sajt, Slower? What? Who? When? Where? Since when was VS2010 slow? It's nice and snappy/quick for me. The IntelliSense is wonderful now. Have you tried VS2010 outside of the beta? It's drastically improved since.
User avatar
Feared
 
Posts: 95
Joined: Fri Jun 11, 2010 11:58 pm
Location: Wylie, TX

Postby frag.machine » Thu Dec 09, 2010 7:51 pm

Under the risk of derailing the thread, I started learning C with Turbo C 3.1. It was really nice for a DOS based IDE. Then I found Watcom C++ 10.6 and it was my compiler of choice for years. I miss the uber-l33tness of being able to build the same program to DOS,DOS-32(with DOS4G/W),OS/2, Windows, Netware and my fridge with the same compiler. :)
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
User avatar
frag.machine
 
Posts: 2090
Joined: Sat Nov 25, 2006 1:49 pm

Postby Baker » Thu Dec 09, 2010 7:56 pm

Feared wrote:Oh you guys! ;)

It's okay, I see how it is.


My goals are different than yours.

I would like anyone with a computer to be able to compile my source code. Old computer, new computer, Windows, etc.

When I installed Visual Studio 2008 Express on this laptop, it took about 8 hours to download. I think I had to do 3 or 4 Windows updates too. Maybe someone on a bad internet connection that could take a very long time. And might need a computer to restart once or twice.

Code::Blocks installs in 30 seconds.

I plan on maintaining a Visual Studio project file, but Code::Blocks is a fast, free and easy solution and I can point anyone to that and it is easy.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Feared » Thu Dec 09, 2010 8:22 pm

Baker wrote:Code::Blocks installs in 30 seconds.

I plan on maintaining a Visual Studio project file, but Code::Blocks is a fast, free and easy solution and I can point anyone to that and it is easy.


I agree with you on this. It's a good idea for you to do this. I should probably manage a code blocks workspace on my project as well seeing as everyone seems to use it and it's so simple to install. I realize that Visual Studio's major flaw is not having the easy, quick, and fast install but it's still my number one choice for an IDE despite that major flaw.

Anyways, I'm glad this thread came up. I didn't realize so many people here used Code blocks.
User avatar
Feared
 
Posts: 95
Joined: Fri Jun 11, 2010 11:58 pm
Location: Wylie, TX

Postby Baker » Thu Dec 09, 2010 8:37 pm

Feared wrote:Anyways, I'm glad this thread came up. I didn't realize so many people here used Code blocks.


The main reasons I got into Code::Blocks:

1) When compiling for the PSP or for Linux using a makefile, I can't double-click on the error or warning immediately. This slowed me down in code modifications. So I needed a gcc capable IDE that would do this for me.

2) When I installed Ubuntu to continue working on the long neglected ProQuake Linux version stuck at version 3.60, I opened the makefile and thought .... this just isn't very user-friendly and isn't the kind of future that I want. If Linux has a mature IDE, I really should be providing the project in that instead of an archaic makefile.

I had looked at qbism's Code::Blocks project file and the one for FitzQuake SDL and thought ... yeah, this solves a problem for accessibility. I tried it on Ubuntu and was just as easy as on Windows.

It doesn't matter to me if someone prefers a different IDE, but Code::Blocks solves an accessibility problem for me and there isn't a good reason not to provide a couple of different options. DarkPlaces provides the project files for a few different IDEs plus a makefile.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Postby Sajt » Thu Dec 09, 2010 10:24 pm

Feared wrote:@Sajt, Slower? What? Who? When? Where? Since when was VS2010 slow? It's nice and snappy/quick for me. The IntelliSense is wonderful now. Have you tried VS2010 outside of the beta? It's drastically improved since.


Every version of Visual Studio compiles more slowly than the last. If I make a little change to one file and recompile my current project (which totals probably less than 30,000 lines of code), it takes three to five seconds to link it and everything. MSVC6 could probably rebuild the whole thing in that time. (Of course, MSVC6 didn't optimize nearly as well.)

You also have to deal with half-second lags everytime the IntelliSense is consulted. But I think this is worth it, because in MSVC2008 the Intellisense was totally broken. It could (aka it DID) get "corrupted" and only show stuff that was six months old, even if you deleted the .ncb file (there must have been another one hidden somewhere...) I read some Visual Studio dev team blog post that mentioned that they totally rewrote the intellisense system.

There was also a change in the auto-indenting which I find annoying. But, within a few weeks you get used to it (you forget that it could be better).

Other annoying things: you can't press Escape to get out of the auto-hiding output window, unless your mouse is in the right place, apparently. Also, sometimes the text of the output window gets painted on the source file window and you have to scroll up and down to fix it. And what was initially most annoying: you can't use the Terminal font anymore. Terminal was able to achieve very small font sizes without antialiasing or looking like crap, so you could see more on your screen. MSVC2010 forces me to use a relatively big Courier or Lucida Console based font as the smallest possible option. Maybe there are ttf Terminal variants out there, who knows. Also, there seems to be some problems with the debugger, but I'm not sure yet. I can't seem to look up locals in any other than the topmost stack frame.

So there are a handful of annoying glitches/features. But MSVC2008 also had roughly the same amount of such things. They just exchanged them for new ones. VC2010 is an upgrade though because the Intellisense works, and bad Intellisense is worse than no Intellisense... And to answer your question, I didn't try the beta.

I have no idea what Code::Blocks is so I can't comment on that.

Sorry, just realized this thread was about compilers and not IDEs. Or maybe it was just worded badly and it was actually about IDEs. I don't know.

edit: A question. Those red squiggly lines are cool, but do you know how to make them not report C++ errors in C code? I know it's good practice to occasionally compile your C code as C++ and get rid of the warnings, but for the time being it's annoying that all boolean expressions that are assigned to my "bool" enum are squigglized.
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Next

Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest