Author Topic: Newbie with Code Blocks Issues  (Read 5543 times)

Offline minipuma17

  • Single posting newcomer
  • *
  • Posts: 2
Newbie with Code Blocks Issues
« on: April 25, 2011, 01:34:46 am »
Hi I am new to C++ and am learning, but Code Blocks has brought up a few questions for me. I was hoping someone here could clarify these.

1. On any basic program (like hello world) How do I make the prompt that the compiler (I am using Mingw) or code blocks puts in at the end of the program (process returend, execution time, press any key) go away?
2. Also what is the bin and obj folders that are created when you create a project?
3. How do I load the exe of my program in the bin folder? (It gives me an error that some dll can't be found.)

Thank you

Offline benkenobi01

  • Multiple posting newcomer
  • *
  • Posts: 64
Re: Newbie with Code Blocks Issues
« Reply #1 on: April 25, 2011, 06:22:45 pm »
the obj folder contains .o files : http://en.wikipedia.org/wiki/Object_file
bin should contains .exe files

Offline Waxhead

  • Single posting newcomer
  • *
  • Posts: 5
Re: Newbie with Code Blocks Issues
« Reply #2 on: April 26, 2011, 01:41:11 am »
1. You can do this two ways.
1a: You can wait yourself: by using getc(stdin); or fgetc(stdin); in your program.
1b: Menu: Project -> Properties -> Build targets (select debug/release) -> click the 'pause when execution ends' checkbox

2. bin: This contains your executables sorted by your build configuration (debug and/or release by default)

3. If you are using MinGW you must go to Menu: Project -> build options -> Linker settings -> Other linker options and add '-static-libgcc'


Offline minipuma17

  • Single posting newcomer
  • *
  • Posts: 2
Re: Newbie with Code Blocks Issues
« Reply #3 on: April 27, 2011, 07:41:05 am »
Thank you for the replies. I have two other questions though :)

1. What is the different between debug and release builds?
2. It now gives me an error of not finding the libstdc===-6.dll when I try to load the executable. What should I do?

Offline reckless

  • Regular
  • ***
  • Posts: 338
Re: Newbie with Code Blocks Issues
« Reply #4 on: April 29, 2011, 06:53:41 pm »
copy the dll from mingw/bin to where your executable is :)

Offline Waxhead

  • Single posting newcomer
  • *
  • Posts: 5
Re: Newbie with Code Blocks Issues
« Reply #5 on: May 05, 2011, 09:50:07 pm »
Thank you for the replies. I have two other questions though :)

1. What is the different between debug and release builds?
2. It now gives me an error of not finding the libstdc===-6.dll when I try to load the executable. What should I do?

1. The Debug build is often larger since a lot of debug(!) information is embedded in the executable. A release build is often smaller and may contain optimizations. You basically choose this yourself and you can even create your own build targets.
2. See my previous answer (3). Make sure you don't enter the quotes ( ' )

kocmohabt99

  • Guest
Re: Newbie with Code Blocks Issues
« Reply #6 on: May 08, 2011, 06:38:30 pm »
@ Waxhead: I have tried doing step 3 of your first post but I can't get it to work. It still says that "libgcc_s_ dw2-1.dll" is missing. Just to be sure when minipuma17 says to load the exe of the program in the bin folder, he means to run the program from the .exe file not from Code::Blocks, right?

thanks.