• About
  • Canadian Pilot’s Licence
  • My Flight Lessons

Dan's Landing

Adventures in the air, on the ground and in between

programming

Setting header file paths in Visual Studio 2010

May 4, 2011 by Danny

I was working on a project which required some coding in Visual Studio recently and ran into a problem: the included header files were not in the same directory as the source files and therefore were not found during a build. Not being familiar with the code, I was not very keen on going through and changing the #include “header.h” lines manually to the proper relative path (which would have been along the lines of #include “../../include/header.h” in some cases and different in others).

From my experience with other compilers I knew there had to be a way to specify the location where the VS2010 C++ compiler was to look for the header files. A bit of digging through Google didn’t help very much as the consensus was: relative paths are the way to go. Going through the project settings I finally came upon my fix which I will share with you.

To set the path:

  1. Go to your project’s properties. (Either Right-click the project name and select Properties or from the menu bar click Project –> Properties.)
  2. Navigate to Configuration Properties –> C/C++ –> General as shown below and enter the path in the Additional Include Directories box ( separate;entries;with;semicolons; )

Visual Studio project properties box

Voila! The header files are now found and the project compiles!

Posted in: Programming Tagged: c, header file path, header files, Microsoft Visual Studio, programming

About

I am an IT professional, aviation geek, flight simulator pilot and all around tinkerer.

Read More About Me...


This blog is a collection of notes and ideas from various projects.

I co-host Cleared En Route, a podcast about Canadian aviation and space exploration.

Get free cloud storage from Dropbox

Categories

  • Engineering
  • Flying
    • Accidents
    • Airplanes
    • Airport
    • Aviation shows
    • Flight Simulation
    • Flight Training
    • Getting a Canadian Pilot's Licence
    • My Flight Lessons
  • Germany
  • Good Read
  • News
  • Product Reviews
  • Programming
    • Embedded
  • Space
  • Video

Copyright © 2019 Dan's Landing.

Omega WordPress Theme by ThemeHall