Thread: CodeBlocks preprocessor file

  1. #16
    Registered User
    Join Date
    Dec 2010
    Posts
    48
    Sorry to 'bump' a somewhat oldish topic but I'm getting back onto the command line stuff again in this sites tutorials..

    I figured that I can browse to the path of my .exe (that I compiled in codeblocks) in the cmd line and run it from there by typing the name and specifying parameters.

    I cannot figure out how to specify these parameters within the codeblocks IDE, is this even possible?

    Is there built in commands for preprocssing, compiling and such within ms DOS without the need for downloading anything?

    If so where can I find documentation on this?

    With regard to the g++ compiler I tried to download it but it took 6 hours only to fail at the very end. I had a choice of mirrors does anyone know of a faster way to download it?

  2. #17
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    I think the command-line parameter choice thingy only appears if you have specified a project (as opposed to just compiling a single file).

    There is no native compiler to MS-DOS. (To the best of my knowledge, there's no "native" compiler in any operating system although my understanding is a lot of linux distributions these days come with gcc already installed by default.)

    If you have Code::Blocks then you should have the MinGW C++ compiler (called g++, with an option for some outrageous name like mingw-c++.exe) already there.

  3. #18
    Registered User
    Join Date
    Feb 2003
    Posts
    596
    Quote Originally Posted by MattJ812 View Post
    I cannot figure out how to specify these parameters within the codeblocks IDE, is this even possible?
    Look for Set programs' arguments... under Project

    Is there built in commands for preprocssing, compiling and such within ms DOS without the need for downloading anything?
    No - you need a compiler. Once you have that, a single command will take care of preprocessing, compiling and linking.

    With regard to the g++ compiler I tried to download it but it took 6 hours only to fail at the very end. I had a choice of mirrors does anyone know of a faster way to download it?
    You should have gotten that along with CodeBlocks. If you didn't, you downloaded the wrong package. You want the one called codeblocks-10.05mingw-setup.exe. Here:
    BerliOS Download - The Open Source Mediator

  4. #19
    Registered User
    Join Date
    Dec 2010
    Posts
    48
    Sorry this compiling stuff really threw me from the beginning. Yes I have the 10.05mingw package.

    I just noticed a setup file in the mingw folder... tdm-mingw-1.908.0-4.4.1-2.exe

    Do i have to run this or is g++ already installed? I see no g++ reference anywhere, heck I don't even know what it is I'm just trying to go through tutorials and if I don't want to skip over something just because I don't fully understand it.

    I browsed the codeblocks docs but I got reminded of using gamemaker: unless I know exactly what I'm looking for and know exactly why I am using it, its all nonsense.

    Whats the difference between compilers? I thought codeblocks was a compiler and g++ was something entirely different, as would be the ms visual studio.

    The language itself is hard enough.

  5. #20
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Codeblocks is not a compiler. Codeblocks is an "integrated development environment", that is, an editor that does syntax highlighting and has a button you can push that will run a compiler.

  6. #21
    Registered User
    Join Date
    Dec 2010
    Posts
    48
    Quote Originally Posted by tabstop View Post
    Codeblocks is not a compiler. Codeblocks is an "integrated development environment", that is, an editor that does syntax highlighting and has a button you can push that will run a compiler.
    This is complicated but the learning of the language and an application that can faciliate the learning are so intertwined that this is hard to avoid.

    So codeblocks uses g++? What different compilers are there?

    In my programming experience(albeit there little of) I have always been fascinated with the lowest level stuff, all the way down to the circuit boards. I have to learn somewhere so I'm digging around with what I can find/do.

    If I want to run a simple piece of code I would rather do it in the command line than an entire IDE, so I guess I am looking for the 'bare bones' as I am going. Obviously I don't want to do everything from scratch but I atleast want to know/need to know what is going on.

  7. #22
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,336
    Quote Originally Posted by MattJ812 View Post
    This is complicated but the learning of the language and an application that can faciliate the learning are so intertwined that this is hard to avoid.

    So codeblocks uses g++? What different compilers are there?
    I'm going to be lazy and let someone else do the listing.

    Quote Originally Posted by MattJ812 View Post
    In my programming experience(albeit there little of) I have always been fascinated with the lowest level stuff, all the way down to the circuit boards. I have to learn somewhere so I'm digging around with what I can find/do.

    If I want to run a simple piece of code I would rather do it in the command line than an entire IDE, so I guess I am looking for the 'bare bones' as I am going. Obviously I don't want to do everything from scratch but I atleast want to know/need to know what is going on.
    Yay!

  8. #23
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by MattJ812 View Post
    This is complicated but the learning of the language and an application that can faciliate the learning are so intertwined that this is hard to avoid.

    So codeblocks uses g++? What different compilers are there?
    Actually CodeBlocks is an IDE ... with the right settings it can work with any compiler...

    What different compilers are there...

    List of compilers - Wikipedia, the free encyclopedia

    If you're looking for downloadable stuff...

    Free Compilers and Interpreters for Programming Languages (thefreecountry.com)

    If I want to run a simple piece of code I would rather do it in the command line than an entire IDE, so I guess I am looking for the 'bare bones' as I am going. Obviously I don't want to do everything from scratch but I atleast want to know/need to know what is going on.
    Well that's good, and we should all know how... but if you ever get into a real project; several EXEs and DLLs, settings, dialogs, etc... you will very quickly yearn for the organizational tools a good programmer's IDE provides...

  9. #24
    Registered User
    Join Date
    Feb 2003
    Posts
    596
    I just noticed a setup file in the mingw folder... tdm-mingw-1.908.0-4.4.1-2.exe

    Do i have to run this or is g++ already installed? I see no g++ reference anywhere, heck I don't even know what it is I'm just trying to go through tutorials and if I don't want to skip over something just because I don't fully understand it.
    You shouldn't have to run that unless you de-selected it in the wizard when you installed CodeBlocks. It's included in the standard install.

    Look in C:\Program Files\CodeBlocks. You should see a folder called MinGW -- that's the GCC compiler directory. It contains the C compiler (gcc) and the C++ compiler (g++). In the MinGW directory you will find bin, include and lib directories. Since you want to compile from the command line it will be convenient to add those to your user path, include and lib environment variables. If you don't know how to do that, ask.

    If the compiler isn't already installed, you can either try running that mingw setup file, or uninstall and reinstall CodeBlocks (this time making sure that MinGW is selected in the wizard). Given your inexperience, reinstalling might be the better alternative to be sure it ends up configured correctly.

    IMHO, you don't need to waste time investigating other compilers at this time. Unless you have a compelling need to use another compiler GCC is your best choice for a free, modern, standards-compliant compiler.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Cant compile using Codeblocks 10.05
    By laimaretto in forum Windows Programming
    Replies: 2
    Last Post: 12-15-2010, 12:24 PM
  2. Giving CodeBlocks a shot
    By jeffcobb in forum Tech Board
    Replies: 24
    Last Post: 05-23-2010, 12:46 PM
  3. Code::Blocks Help
    By rakeshkool27 in forum C Programming
    Replies: 0
    Last Post: 01-16-2010, 08:25 AM
  4. library issues in CodeBlocks
    By everlearnin in forum C++ Programming
    Replies: 0
    Last Post: 06-02-2009, 08:44 PM
  5. Codeblocks crashes linux?
    By Shakti in forum Tech Board
    Replies: 1
    Last Post: 03-25-2009, 07:26 AM