"Gary" <gl*******@comcast.net> wrote...
"Victor Bazarov" <v.********@comAcast.net> wrote in message
news:<O48yb.358939$Fm2.358821@attbi_s04>... "Kostas" <sk*******@hotmail.com> wrote... Hello, I just need to get something straight in my mind. In
microsoft's VC compiler, whenever I include an .h file it should go
into my stdafx.h file.
No.
Then every cpp file needs to include the
stdafx.h file so I don't get the precompiled header directive
something message.
That's specific to their way of organising precompiled headers.
You are completely free to turn that feature off. See the VC++
help to learn how to do it.
What happens to the cpp file with definitions of
whatever is declared in the h file. Do I just add it to the project?
Usually.
If the cpp file is not application specific but is a utility routine,
it is usually not added to the project. Once compiled (separately) the
library containing the object file is pointed to when running the
linker (-L switch?)
There are no switches defined by the language Standard (except the
'switch' statement).
and the specific object file is pointed to when
running the linker (-l switch?) so that it is linked into the
executable.
Isn't that the way?
It's not _the_ way. It's _a_ way. If your "utility routine" is
a function (or a class) template, there is no library to put it in,
you _usually_ give it to the compiler at the compilation stage.
Then again, there is that "export" keyword, which I'm yet to use in
my programming activities...
Victor