Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 How do I setup, and use MinGW with Code::Blocks for C-99?
Index -> Programming, C -> C Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
php111




PostPosted: Tue Aug 30, 2011 8:26 pm   Post subject: How do I setup, and use MinGW with Code::Blocks for C-99?

Hey everyone,

I am back trying to learn C again using the book of C Primer Plus. I have just been rude over at the cboard forums. I don't like that. Are they even a official C programming forum? Idiots.

I am interested in learning ISO C-99. How do I setup, and use the MinGW with Code::Blocks compiler? Would it be command line driven, or just a GUI? I understand it's a IDE. I am not understanding. I thought an IDE was GUI? I asked over on the forum if Code::Blocks was based on GUI, or command line. They said no. It's a IDE. That's the part that confuses me. I want to learn C, but I don't even have MinGW on my PC, let alone the Code::Blocks part. Would Code::Blocks be another download then MinGW? I don't even know where to start. Could anyone help me?
Sponsor
Sponsor
Sponsor
sponsor
Amit




PostPosted: Mon Sep 05, 2011 2:33 pm   Post subject: Re: How do I setup, and use MinGW with Code::Blocks for C-99?

Go to this link: http://www.codeblocks.org/downloads/26 and download "codeblocks-10.05mingw-setup.exe"

Pretty simple.
crossley7




PostPosted: Mon Sep 05, 2011 6:39 pm   Post subject: RE:How do I setup, and use MinGW with Code::Blocks for C-99?

MinGW would be the compiler and Code::Blocks is the IDE. They are 2 separate things you need to download individually.

IDE is the what you develop in with another example being Dev C++.

GUI is a separate add on library you can get to later once you start dealing with graphics programs. For GUI there are a bunch of options out there but I'm not the one to give advice on that.

Bottom line is
Download Code::Blocks
Download MinGW
Command line will work, not sure if there is a built in compile option for code::blocks.
php111




PostPosted: Tue Sep 06, 2011 3:36 pm   Post subject: Re: How do I setup, and use MinGW with Code::Blocks for C-99?

I'm sorry, but I truly have to admit, I still don't understand. I'm really confused at this point. I don't want this thread to turn into the thread over at cboard.cprogramming.com

That thread got locked, because it turned from being an ANSI C thread into way off topic, just because I didn't understand.

Will someone that knows all types of C that has patiences, and jump into this thread, and explain it better? I have no clue what an IDE is. I still don't understand. It's like speaking to me in a non-English language, where I only know English.
DemonWasp




PostPosted: Tue Sep 06, 2011 6:01 pm   Post subject: RE:How do I setup, and use MinGW with Code::Blocks for C-99?

C is the "language".

MinGW is the "compiler". A compiler translates the relatively human-friendly language of C into the machine-friendly language of object files, assembly and executables. Don't worry too much about how it works -- right now, it's a black box that takes in C code and spits out executable files.

Code::Blocks is the "integrated development environment", or IDE. That actually means "set of tools you use to develop". In particular, these tools work well together, hence "integrated".

An IDE is built so that you can edit, compile, link, debug and profile your code, all from within the same program. Therefore, it needs several components: an editor, a compiler, a linker, a debugger and a profiler. The IDE itself usually provides an editor, and some supply their own (default) compilers / linkers / debuggers / profilers. Many IDEs let you change their configuration to use other compilers / linkers / debuggers / profilers.

Most of the time, a "compiler" will come with a "linker". Similarly, "debuggers" and "profilers" are usually packaged together. Sometimes, you get all four together. Don't worry about it too much.


In this particular case, people are advising you that:

1) Code::Blocks does not come with a compiler.

2) You will need to install your own compiler, then tell Code::Blocks how to use it.

3) MinGW is a good compiler to start with.

4) Amit linked a setup program that should do all the setup stuff for you.
php111




PostPosted: Tue Sep 06, 2011 6:19 pm   Post subject: Re: How do I setup, and use MinGW with Code::Blocks for C-99?

Thank you so much! I wish people over the capital of C could of explained in English instead of writing aberrations of using the F word. I suppose they know C, and C++? are they actually the official forum where all the C programmers go?

1. Would C Primer Plus cover ANSI C for beginners, or C Programming Language, 2nd edition? I have been told the second edition because it covers the ANSI part that I'm looking for.

2. Am I ready for C, since I didn't understand what IDE was, and I was hoping that someone would break it down?

Thank you again!
DemonWasp




PostPosted: Wed Sep 07, 2011 7:55 am   Post subject: RE:How do I setup, and use MinGW with Code::Blocks for C-99?

A lot of the people on those boards are used to dealing with newbies thinking programming is a simple, quick hobby. Said newbies are usually really hard to teach because they're unwilling to put in time and effort, and treat the whole endeavour with an attitude that could be summarized as "whatever". There's a reason they're unwelcoming to newcomers and novices.

There is no official C anything, except the specification and the standard library. Any C forums, help, FAQs are all community efforts. "C" just refers to a language specification, and as those go, C's is extremely short and sparse (C leaves a lot of things as 'undefined behaviour'). The "C Standard Library" is a set of standard functions made available on all platforms C can be compiled for, and it provides things everyone needs -- open a file, read from standard input, print to standard output, etc. Even then, the C standards committee only specifies the methods that must appear and how they must work, they don't actually supply code for any platform; that's up to the compiler writers.

1. I have never read a book on any language, so I can't really say.

2. That depends:

2.1. Have you ever programmed before, in a different language? You should, most are way easier than C. Don't choose C++ or D either.

2.2. How well do you understand the hardware in a computer? Did you know, for example, that a stream of bytes could be handled as either big-endian or little-endian, and the choice is system-dependent? Do you know what happens when you try to access data past the end of your arrays?

2.3. How well do you know the OS you're intending to write programs for? Windows, in particular, is very different from the other popular operating systems.
php111




PostPosted: Wed Sep 07, 2011 12:15 pm   Post subject: Re: How do I setup, and use MinGW with Code::Blocks for C-99?

2.1. Never programmed before.

2.2. I don't know my hardware.

2.3. I don't know how any OS operates. I honestly think it would be a cool thing to do something similar to MS.

Does it cost money to build everything from ground and up?

Based on my answers. Where, and what level should I start at?
Sponsor
Sponsor
Sponsor
sponsor
DemonWasp




PostPosted: Wed Sep 07, 2011 1:07 pm   Post subject: RE:How do I setup, and use MinGW with Code::Blocks for C-99?

If you've never programmed before then chances are good that C is not the language for you (there are exceptions). C is a relatively "low-level" language, meaning you need to pay a lot more attention to the machine, the operating system, and your own code than you would in "high-level" languages. There are, of course, plenty of people who learned to program on C, it's just that it isn't as easy as other languages.

On the other hand, building an operating system (which is what I assume you mean by "do something similar to MS") is generally done in either C or C++ (though there are exceptions -- there are operating systems written in Java, assembly, and probably a lot of other languages). Still, you won't be getting to building an operating system for a LONG time; you need to know a LOT about programming, hardware, and computer science before you get there.


Depending on which language and tools you choose, programming can be either extremely expensive or totally free. Most languages and many tools are free, or have limited-capability free versions (Microsoft in particular likes to sell half of the product as the "student edition"). The biggest expense you are likely to encounter is getting a university education in computer science or a related field, which you can estimate at around $50,000 and 5 years (in Canada). You can program without a formal education, but if you want to write an operating system, you will need considerable education (at least a Bachelor's in Computer Science, Computer Engineering, or Software Engineering). Even then, an operating system is usually developed by a team of hundreds or thousands of engineers and programmers working together; working alone, it will be impossible to keep up.


Based on your answers, I would suggest you start with a friendlier language. Python is a good example: Python is a high-level language, and is relatively simple to learn and use. The tools to write Python are friendly, powerful, and free. Fortunately, MIT has a fun system called OpenCourseWare, which offers some of their course material online. Here's a brief how-to for one of their first-year Python courses:

1. Go to the MIT OpenCourseWare site here: http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-189-a-gentle-introduction-to-programming-using-python-january-iap-2011/ .

2. The notes for the first lecture tell you how to set up your environment for working with Python. Follow the instructions carefully!

3. Read the Readings and the Lectures, and do the Assignments. Make sure you get everything right. If you get stuck, post back here with the specific problem you're having.
php111




PostPosted: Wed Sep 07, 2011 3:19 pm   Post subject: Re: How do I setup, and use MinGW with Code::Blocks for C-99?

I did took a quick look at the readings, and I saw the chapters. I stopped, because I rather not to get a degree. I prefer trying to build an OS by myself without the degree only if possible. If you, or someone else tells me that I might be able to get it done then I'll go back to that site to learn.

What would be the next language to learn that comes after Python?
DemonWasp




PostPosted: Wed Sep 07, 2011 3:41 pm   Post subject: RE:How do I setup, and use MinGW with Code::Blocks for C-99?

Those readings are just one course. You would have to do about 20-40 times that amount of work to get a degree.

A degree is pretty much the bare minimum for developing anything approaching an OS. It's possible to do it without a degree, but the level of dedication required is nothing short of phenomenal, and the time investment would probably be better spent getting an actual degree. You will almost certainly not be able to write an OS without several years of learning, whether in university or on your own.

The degree of difficulty can be visualized as follows. Writing a "Hello World" program is equivalent to stepping onto a step-stool. Writing a small example program to calculate something is like climbing a short ladder. Writing a program to actually do anything substantial is the equivalent of climbing a mountain. Writing an operating system is more like climbing to the Moon.

What I'm saying is: don't start on an OS. Learn to program, and you'll eventually get an idea of how much work goes into an operating system.


After you've learned Python, you should understand the fundamentals well enough to pick up any other language you want relatively quickly. There's a mode of thinking that you will need to learn to master writing code and debugging problems in that code, but once you learn that (with Python) learning other languages (C, C++, Java, whatever) is relatively simple. A professional computer programmer should be able to pick up a new language in a couple of weeks, though true mastery of the language could conceivably take as much as a year -- especially for harder languages, like C++.
php111




PostPosted: Wed Sep 07, 2011 8:25 pm   Post subject: Re: How do I setup, and use MinGW with Code::Blocks for C-99?

What book/tutorial that I can learn from to learn enough Python, so I can learn C, and then ASM?

Where can I find out what would would be the best C book for beginners between C Primer Plus, C Programming Language, 2nd Edition?
DemonWasp




PostPosted: Wed Sep 07, 2011 8:29 pm   Post subject: RE:How do I setup, and use MinGW with Code::Blocks for C-99?

The MIT OpenCourseWare stuff is actually probably the quickest, cheapest route to learning Python (and programming techniques in general).

I can't help with your other question.
QuantumPhysics




PostPosted: Wed May 30, 2012 9:04 am   Post subject: RE:How do I setup, and use MinGW with Code::Blocks for C-99?

@php i recommend that you should learn Lisp and possibly if you are familiar with lambda calculas you could try Scheme but that is only for those of advanced knowledge and accessibility to how the computer works and how much bits it recieves and sends for each other and how much time it takes to execute a conmmand
Display posts from previous:   
   Index -> Programming, C -> C Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 14 Posts ]
Jump to:   


Style:  
Search: