Click here to Skip to main content
15,887,746 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionwhat is contained in iostream and std Pin
Anonygeeker28-Nov-17 23:21
Anonygeeker28-Nov-17 23:21 
AnswerRe: what is contained in iostream and std Pin
CPallini29-Nov-17 0:33
mveCPallini29-Nov-17 0:33 
GeneralRe: what is contained in iostream and std Pin
Anonygeeker29-Nov-17 1:16
Anonygeeker29-Nov-17 1:16 
GeneralRe: what is contained in iostream and std Pin
CPallini29-Nov-17 1:23
mveCPallini29-Nov-17 1:23 
AnswerRe: what is contained in iostream and std Pin
jschell29-Nov-17 12:39
jschell29-Nov-17 12:39 
QuestionC++ cout in header file error - ‘cout’ was not declared in this scope Pin
Vaclav_27-Nov-17 14:23
Vaclav_27-Nov-17 14:23 
QuestionRe: C++ cout in header file error - ‘cout’ was not declared in this scope Pin
David Crow27-Nov-17 16:47
David Crow27-Nov-17 16:47 
AnswerRe: C++ cout in header file error - ‘cout’ was not declared in this scope Pin
CPallini27-Nov-17 21:31
mveCPallini27-Nov-17 21:31 
AnswerRe: C++ cout in header file error - ‘cout’ was not declared in this scope Pin
Jochen Arndt27-Nov-17 21:26
professionalJochen Arndt27-Nov-17 21:26 
AnswerRe: C++ cout in header file error - ‘cout’ was not declared in this scope Pin
Richard MacCutchan27-Nov-17 21:53
mveRichard MacCutchan27-Nov-17 21:53 
GeneralRe: C++ cout in header file error - ‘cout’ was not declared in this scope Pin
Vaclav_28-Nov-17 4:09
Vaclav_28-Nov-17 4:09 
GeneralRe: C++ cout in header file error - ‘cout’ was not declared in this scope Pin
Richard MacCutchan28-Nov-17 4:25
mveRichard MacCutchan28-Nov-17 4:25 
GeneralRe: C++ cout in header file error - ‘cout’ was not declared in this scope Pin
Vaclav_28-Nov-17 7:07
Vaclav_28-Nov-17 7:07 
GeneralRe: C++ cout in header file error - ‘cout’ was not declared in this scope Pin
Richard MacCutchan28-Nov-17 8:37
mveRichard MacCutchan28-Nov-17 8:37 
AnswerRe: C++ cout in header file error - ‘cout’ was not declared in this scope Pin
Jochen Arndt28-Nov-17 4:54
professionalJochen Arndt28-Nov-17 4:54 
GeneralRe: C++ cout in header file error - ‘cout’ was not declared in this scope Pin
Vaclav_28-Nov-17 7:46
Vaclav_28-Nov-17 7:46 
GeneralRe: C++ cout in header file error - ‘cout’ was not declared in this scope Pin
Jochen Arndt28-Nov-17 8:39
professionalJochen Arndt28-Nov-17 8:39 
GeneralRe: C++ cout in header file error - ‘cout’ was not declared in this scope Pin
David Crow28-Nov-17 8:14
David Crow28-Nov-17 8:14 
GeneralRe: C++ cout in header file error - ‘cout’ was not declared in this scope Pin
Vaclav_28-Nov-17 11:26
Vaclav_28-Nov-17 11:26 
GeneralRe: C++ cout in header file error - ‘cout’ was not declared in this scope Pin
David Crow28-Nov-17 14:03
David Crow28-Nov-17 14:03 
GeneralRe: C++ cout in header file error - ‘cout’ was not declared in this scope Pin
Richard MacCutchan28-Nov-17 21:40
mveRichard MacCutchan28-Nov-17 21:40 
AnswerRe: C++ cout in header file error - ‘cout’ was not declared in this scope Pin
Vaclav_28-Nov-17 12:25
Vaclav_28-Nov-17 12:25 
GeneralRe: C++ cout in header file error - ‘cout’ was not declared in this scope Pin
Jochen Arndt28-Nov-17 21:28
professionalJochen Arndt28-Nov-17 21:28 
A compiler processes source files and creates an object file for each of the source files. These object files are then passed to the linker together with libraries to create an executable or a library.

The compiling process itself is not a single run but consists of multiple passes with three main tasks for the GCC:

  1. Running the preprocessor
  2. Compiling the intermediate file created by the preprocessing to assembly code
  3. Creating object files from the assembly code files
In your case it is all related to the preprocessor. That will look for the preprocessing directives (those beginning with #), process them and create an intermediate file. This intermediate file is then used for compilation. It will not contain #defines anymore.

If you want to see how it works, you can let GCC do each step separately and create corresponding output files which can then be inspected (use g++ for *.cpp files with *.ii as intermediate file extension):
# Run the preprocessor and stop 
# The result is printed to stdout and redirected to a file
gcc -E example.c > example.i

# Compile passing the intermediate file and stop
# Creates assembly code file example.s
gcc -S example.i

# Compile passing the assembly code file and stop (do not link)
# Creates object file example.o
gcc -c example.s
You might also use
gcc -save-temps -c example.c
to prevent deletion of the *.i and *.s intermediate files so that they can be inspected.
GeneralRe: C++ cout in header file error - ‘cout’ was not declared in this scope Pin
Vaclav_29-Nov-17 17:36
Vaclav_29-Nov-17 17:36 
Questionem_setwordbreakproc in MFC Pin
ForNow26-Nov-17 14:05
ForNow26-Nov-17 14:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.