User forums > Using Code::Blocks

Include automatically

(1/2) > >>

Sec0nd:
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!!!

stahta01:
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.

Sec0nd:
I'm using the default C++ compiler.( GNU GCC )
The OS is Windows7.

stahta01:
Try GCC Option "include" in Code::Blocks, IIRC in the extra Compile area.

http://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html#Preprocessor-Options


--- Quote ----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.
--- End quote ---

No idea if the above does what you want; this is NOT really a Code::Blocks question.

Tim S.

Sec0nd:
Sorry, I don't really understand your suggestion:S



--- Quote from: stahta01 on November 11, 2010, 09:30:24 pm ---Try GCC Option "include" in Code::Blocks, IIRC in the extra Compile area.

http://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html#Preprocessor-Options


--- Quote ----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.
--- End quote ---

No idea if the above does what you want; this is NOT really a Code::Blocks question.

Tim S.

--- End quote ---

Navigation

[0] Message Index

[#] Next page

Go to full version