Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: Sec0nd on November 11, 2010, 06:45:13 pm
-
I learn c++ in my school, there we use DevC++.
I heard from Code::blocks from my friend and I want to use it at home, but in school we use system("pause") command, but Code::Blocks isn't familiar with it.I wan't to use my files both of IDE.
So how can I set that Code::Block include automatically <stdlib.h>, without writing it to the source file?
Thank You for helping!!!
-
Learn the difference between an Compiler and the Code::Blocks IDE.
Learn to Always include the correct header for the functions you use even if it works sometimes without using the proper headers!
Learn to mention the OS and Compiler you are using when asking an question about how to do something that has to do with your compiler/OS and little to do with Code::Blocks!
Tim S.
-
I'm using the default C++ compiler.( GNU GCC )
The OS is Windows7.
-
Try GCC Option "include" in Code::Blocks, IIRC in the extra Compile area.
http://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html#Preprocessor-Options
-include file
Process file as if #include "file" appeared as the first line of the primary source file. However, the first directory searched for file is the preprocessor's working directory instead of the directory containing the main source file. If not found there, it is searched for in the remainder of the #include "..." search chain as normal.
If multiple -include options are given, the files are included in the order they appear on the command line.
No idea if the above does what you want; this is NOT really a Code::Blocks question.
Tim S.
-
Sorry, I don't really understand your suggestion:S
Try GCC Option "include" in Code::Blocks, IIRC in the extra Compile area.
http://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html#Preprocessor-Options
-include file
Process file as if #include "file" appeared as the first line of the primary source file. However, the first directory searched for file is the preprocessor's working directory instead of the directory containing the main source file. If not found there, it is searched for in the remainder of the #include "..." search chain as normal.
If multiple -include options are given, the files are included in the order they appear on the command line.
No idea if the above does what you want; this is NOT really a Code::Blocks question.
Tim S.
-
Try placing "-include stdlib.h" without the double quotes in the Other Options section.
Project -> Build Option
Tab "Compiler Settings"
Sub Tab "Other Options"
-
Thanks, but I don't use projects, I'm a beginner.
We work with several source files..
-
Thanks, but I don't use projects, I'm a beginner.
We work with several source files..
So long then; because if you do NOT want to use projects; then in my opinion you have no real reason to use Code::Blocks or to expect help from the website.
You wasted a lot of my time by NOT saying the fact you do NOT use projects right at first.
Tim S.
-
Okay, sorry.
And thanks for trying to help....
-
Try placing "-include stdlib.h" without the double quotes in the Other Options section.
Project -> Build Option
Tab "Compiler Settings"
Sub Tab "Other Options"
You can also use the option in the Compiler Settings; this should work without a project. I have never tried it before.
Settings -> Compiler and Debugger
Tab "Compiler Settings"
Sub Tab "Other Options"
Never ask why the debugger does NOT work; it requires a project to work.
Tim S.