Saturday, May 22, 2010

Visual c++ help?

I have a program that has some .h files that I'm trying to compile. Can you tell me the proper way to build and compile it? I keep getting an error that says can not find my header files.

Visual c++ help?
I'm guessing your header files are not part of standard ones like stdio.h, stdlib.h which are present in standard system directory (where ever you installed your program eg. c:\program files\VS\..\include





and you used include %26lt;filename.h%26gt;


where filename.h is your own header file.





Use


include "filename.h"


(make sure the filename.h file is in the same folder as your other .c file(s). It will recognise and compile.





Using %26lt;%26gt;, compiler looks for header files in standard directory, using "" compiler looks for header files in the same directory as where .c files are.





You can also go to tools -- options -- directories tab and add folder location - where to look for the .h files (under library, include files)





Hope it helps.


No comments:

Post a Comment