> > What does the directory structure of your project look like? In
> particular,
[quoted text clipped - 12 lines]
> compiling before when it had no stdafx.h on its path. (my lack of cpp
> knowledge).
That is because the compiler will look for the PCH instead of trying to load
the real include file.
if you separate include and source files you have to add additional include
directories in your project settings. otherwise you have to explicitly tell
the compiler where those files are (by using ../..) and that removes
flexibility from your project layout.
> I have other problems as well, related to header files includes. Like I have
> a common.h file that has some utility functions and some global variables
[quoted text clipped - 6 lines]
> functions and variables) that I write, which I assume will me visible to
> two.h that are inside the common.h. Now the next thing I'm planning to do is
do it like this:
//common.h
extern int g_Global;
extern int MyFunction(void);
//common.cpp
#include "common.h"
int g_Global;
int MyFunction(void)
{
//...
}
that way there is only 1 definition, and you can use them by simply
including common.h
> inlcude my common.h in stdafx.h and see what happens. Also will play with
> #pragma once stuff which looks insteresting and I hope its not microsoft
> specific.
another thing you'll see often is this:
#ifndef __SOME_INCLUDE_GUARD__
#define__SOME_INCLUDE_GUARD__
//declarations here
#endif
> The purpose I wrote this second para above is:
> Having a C# background, I think I really need to read some really good and
> detailed article on the problems that a dev can face while working on c++
> projects having to do with #include. It would be great if you or anyone else
> has some web links on this, or maybe discuss here.
to find out if something is MSFT specific, find the topic in the MSDN help
collection. it is always mentioned if something is ANSI or microsoft specific.
www.codeproject.com is always a good place to start when looking for info.
if you are serious about C++ you should buy a good book. there are several.
my favorite is still 'the C++ programming language' by stroustrub
it can be a bit dull at times, but it is complete.
if you have specific questions you can always ask them here also.

Signature
Kind regards,
Bruno.
bruno_nos_pam_van_dooren@hotmail.com
Remove only "_nos_pam"
Abubakar - 04 Apr 2006 06:30 GMT
> > > What does the directory structure of your project look like? In
> > particular,
[quoted text clipped - 83 lines]
> bruno_nos_pam_van_dooren@hotmail.com
> Remove only "_nos_pam"
Abubakar - 04 Apr 2006 06:37 GMT
> do it like this:
> //common.h
> extern int g_Global;
> extern int MyFunction(void);
This was very helpful.
Thanks for all other tips as well. My #include problems are settling slowly
n slowly :-)
Regards,
Abubakar.
> > > What does the directory structure of your project look like? In
> > particular,
[quoted text clipped - 83 lines]
> bruno_nos_pam_van_dooren@hotmail.com
> Remove only "_nos_pam"