Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

VC++ 4.2: How do I specify an include directory?

Posted on 1997-05-07
1
Medium Priority
?
216 Views
Last Modified: 2013-11-18
I have a header file in a directory outside of my project workspace directory that I would #include in one of my source files.  I have attempted to add this directory to my include search path by specifying it in:

        Build->Settings->Resources->Additional resource include directories:

Let's say the header files are in c: msdev\projects\generic\myheaders.  I specifyc:\msdev\projects\generic for the include directory.  Then in my .c file I include the file like this:

#include <myheaders/header1.h>

When I compile, I get the following error:

fatal error C1083: Cannot open include file: 'myheaders/header1.h': No such file or directory

Thanks in advance for the help.

-Mike
 bendi003@maroon.tc.umn.edu                                            
0
Comment
Question by:mbendic
1 Comment
 

Accepted Solution

by:
rshek earned 100 total points
ID: 1163330
There are a few things you can try:

1. In the Build/Settings dialog, go to the C/C++ tab. From the Category drop-list, select Preprocessor. Put your additional include path in the edit box under "Additonal include directories". Spearate by a comma if more than 1 directory is required.

2. Force the update of dependencies by selecting from the menu bar Build/Update All Dependencies. Check all boxes. The source file window (don't know exactly what it is called), which list all of your project source files, should now have a Dependencies subfolder.

Hope this would help.

Rodney Shek

0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
Suggested Courses

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question