Changing program from .cpp to .exe

This is a discussion on Changing program from .cpp to .exe within the C++ Programming forums, part of the General Programming Boards category; Hi there. Its late Im tired, and im intelligence slips me at the moment. Whenever I make a program using ...

  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    6

    Changing program from .cpp to .exe

    Hi there. Its late Im tired, and im intelligence slips me at the moment. Whenever I make a program using the dev-C++ compiler it always saves a .cpp version and a .exe version. The .cpp to edit it and the .exe so i can run my program! I just finished a program and its only saving a .cpp file. How do I manually make the program .exe so i can use it. This is probably the most simple question ever asked and im gonna kick myself when i get an aswer, but please help me lol.

    Thx again

  2. #2
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    open the .cpp in dev and press <F9>

    or, since you're using dev-cpp, open up a command prompt, navigate to
    Code:
    compiler-path\bin
    and type
    Code:
    g++ file.cpp -o file.exe
    that will leave you with an exe that you then have to run manually.

    there really is no way to 'manually' make the .cpp file into a .exe file. that's what the compiler is for. and just FYI, dev-cpp is not a compiler. it's actually an Integrated Development Environment, or an editor, compiler, linker, etc. all packaged up nice and neat. what dev-c++ uses is a MingW port of the GCC compiler, originally written for UNIX. the second method I showed you invokes that compiler directly without going through dev-c++ to get to it.
    Last edited by major_small; 02-15-2005 at 10:44 PM.
    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

  3. #3
    Registered User
    Join Date
    Apr 2003
    Posts
    2,662
    Code:
    .cpp files            \
    .h files               \     Compiler        __________
    std header files            --------->      |.exe file |         
    the kitchen sink       /                    |__________|                    
                          /

  4. #4
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,807
    Your forgot the linker which would leave you with an unresolved kitchen sink
    Woop?

  5. #5
    Registered User
    Join Date
    Apr 2003
    Posts
    2,662
    Your forgot the linker which would leave you with an unresolved kitchen sink
    Nope. Left it out on purpose.

  6. #6
    Registered User
    Join Date
    Feb 2005
    Posts
    59
    So that's where my kitchen sink is.

  7. #7
    Registered User
    Join Date
    Jan 2005
    Posts
    106
    If SDL i s only saving your code when you compile, you probably have a linker error or something. Click on one of the buttons on the compile menu that isn't run, ok, close, etc. I think it says results.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 09-14-2006, 09:47 PM
  2. Problem with .CPP program output HELP please!!!
    By shoeb_hi in forum C++ Programming
    Replies: 4
    Last Post: 03-24-2006, 10:01 AM
  3. Need help with my program...
    By Noah in forum C Programming
    Replies: 2
    Last Post: 03-11-2006, 06:49 PM
  4. I need some help with my program please.
    By agentxx04 in forum C Programming
    Replies: 9
    Last Post: 09-26-2004, 07:51 AM
  5. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21