Compile errors
-
Hi all, I am brand new to VC++. I an always having problems with paths when compiling. For instance, the MIDL compiler does not compile if the path of directories include blank spaces (e.g. c:\Program Files\.....). So, I am always compiling with include files in non blank spaces directories (c:\temp\include). What is wrong? Thank you in advance:((
-
Hi all, I am brand new to VC++. I an always having problems with paths when compiling. For instance, the MIDL compiler does not compile if the path of directories include blank spaces (e.g. c:\Program Files\.....). So, I am always compiling with include files in non blank spaces directories (c:\temp\include). What is wrong? Thank you in advance:((
Are you try to do something like
#include "C:\Program Files\Microsoft Visual Studio\VC98\Include\stdio.h"
by any chance? This is where the difference with include "file" and include <file> comes in. If you're including a standard system header, just do
#include <stdio.h>
and the compiler will find the header for you. If it's a header you've written yourself, then it should either be in the same directory as the project, or a "near by" folder, in which case you can just do
#include "myheader.h"
or
#include "../commonheaders/myheader.h"
for example (though in this case, it'd be better to add the "commonheaders" folder into the VC include folders settings, then it'll find it without needing to specify the path) If you have a common header that's used in multiple projects, you can use source control (i.e. SourceSafe) to share a single file across multiple projects and keep them in sync for you Hard coding exact directory paths into sourcecode is very bad, as it locks down the code to your specific PC. If you hand the source to someone else to work on, they'll have to have their directory layout identical to yours in order to be able to compile the code, which isn't particularly desirable -- Help me! I'm turning into a grapefruit!