Author Topic: New with code::blocks, need some help with compiler settings.  (Read 6314 times)

Offline EnterA

  • Single posting newcomer
  • *
  • Posts: 4
Hi, I'm a student learning C, and our course is using code::blocks.
They told us to install the "course wizard" - which adds the course name to the list of new projects. every home exercise we have - we need to make a new project and choose the symbol of our course. and then submit the .c file via the webcourse. also they WARREND us that if we don't use these way to submit our hw - it may result in decrease of home exercise grade.

the problem is that it's annoying to open everytime a new project, with all it's files etc.. my qst is how can I open just a new file - ".c" but with the same properties of compiler/debugging/warnings the course stuff added in the project build.. so that every time I open new file it will function the same as their project and will alert the same compile errors. hope you understood my qst. 10x a lot.

if it helps I added link to their wizard:
http://webcourse.cs.technion.ac.il/234114/Winter2012-2013/ho/WCFiles/Codeblocks-wizard-Windows.exe
« Last Edit: March 02, 2013, 01:12:48 pm by EnterA »

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2777
Re: New with code::blocks, need some help with compiler settings.
« Reply #1 on: March 02, 2013, 01:16:43 pm »
Open/create a new project with the basic configuration that you'd like.
Then:
main menu->File->Save Project as template

Then open the saved template for each new project and adjust the project configuration from there.
« Last Edit: March 02, 2013, 01:18:21 pm by Pecan »

Offline EnterA

  • Single posting newcomer
  • *
  • Posts: 4
Re: New with code::blocks, need some help with compiler settings.
« Reply #2 on: March 02, 2013, 01:18:27 pm »
but I don't want to open new project. I want just to open new .c file with their compiler properties.

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2777
Re: New with code::blocks, need some help with compiler settings.
« Reply #3 on: March 02, 2013, 01:23:46 pm »
In CodeBlocks, compiler properties are saved in the project settings.
So you will have to create a project or template.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: New with code::blocks, need some help with compiler settings.
« Reply #4 on: March 02, 2013, 01:27:09 pm »
If you compile a single file the settings for the global settings of the default compiler are used if I remember correctly.

So set up the default compiler with all your settings and try if it works.

Be aware that settings you make in the global compiler section ("Settings -> Compiler") will normally also be used for projects that use this compiler, so you will most likely run into trouble sooner or later.

Offline EnterA

  • Single posting newcomer
  • *
  • Posts: 4
Re: New with code::blocks, need some help with compiler settings.
« Reply #5 on: March 02, 2013, 01:28:41 pm »
mm why I can't go to setting>compiler and debugger and change there the properies as the the properties they changed in the build options of their project? or is there more things I need to change?

Edit: 10x jens!
"Be aware that settings you make in the global compiler section ("Settings -> Compiler") will normally also be used for projects that use this compiler, so you will most likely run into trouble sooner or later."
what do you mean by saying this? what projects? you mean built-in projects?
« Last Edit: March 02, 2013, 01:36:34 pm by EnterA »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: New with code::blocks, need some help with compiler settings.
« Reply #6 on: March 02, 2013, 01:39:52 pm »
mm why I can't go to setting>compiler and debugger and change there the properies as the the properties they changed in the build options of their project? or is there more things I need to change?

Edit: 10x jens!
"Be aware that settings you make in the global compiler section ("Settings -> Compiler") will normally also be used for projects that use this compiler, so you will most likely run into trouble sooner or later."
what do you mean by saying this? what projects? you mean built-in projects?
Any projects that use the compiler.

Normally the wizard created projects use the default compiler, if you don't want the settings you have to change it for each project you will create later.

And if you need to create real programs (with more than one source-file) you will need to use projects.

Offline EnterA

  • Single posting newcomer
  • *
  • Posts: 4
Re: New with code::blocks, need some help with compiler settings.
« Reply #7 on: March 02, 2013, 01:46:05 pm »
mm why I can't go to setting>compiler and debugger and change there the properies as the the properties they changed in the build options of their project? or is there more things I need to change?

Edit: 10x jens!
"Be aware that settings you make in the global compiler section ("Settings -> Compiler") will normally also be used for projects that use this compiler, so you will most likely run into trouble sooner or later."
what do you mean by saying this? what projects? you mean built-in projects?
Any projects that use the compiler.

Normally the wizard created projects use the default compiler, if you don't want the settings you have to change it for each project you will create later.

And if you need to create real programs (with more than one source-file) you will need to use projects.

The thing is that I use code::blocks only for home exercise and I don't need more than 1 file each time. I only submit 1 ".c" file each time. Does your warning still valid for me? thanks again.
« Last Edit: March 02, 2013, 01:50:12 pm by EnterA »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7592
    • My Best Post
Re: New with code::blocks, need some help with compiler settings.
« Reply #8 on: March 02, 2013, 07:52:19 pm »
mm why I can't go to setting>compiler and debugger and change there the properies as the the properties they changed in the build options of their project? or is there more things I need to change?

Edit: 10x jens!
"Be aware that settings you make in the global compiler section ("Settings -> Compiler") will normally also be used for projects that use this compiler, so you will most likely run into trouble sooner or later."
what do you mean by saying this? what projects? you mean built-in projects?
Any projects that use the compiler.

Normally the wizard created projects use the default compiler, if you don't want the settings you have to change it for each project you will create later.

And if you need to create real programs (with more than one source-file) you will need to use projects.

The thing is that I use code::blocks only for home exercise and I don't need more than 1 file each time. I only submit 1 ".c" file each time. Does your warning still valid for me? thanks again.

Yes, that warning is VALID for everybody that uses Code::Blocks!

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org