TJ1
TJ1

Reputation: 8508

Adding existing .h and .c files to a Microsoft Visual Studio 2010 C++ project

I would like to use some pre-written .h and .c files in my MSVS2010 C++ project. These are source files of a library that I would like to use in my project. I went and added .h files to "Header Files" folder in my MSVS solution, and .c files to "Source Files" folder. But when I include one of the .h files using include "sample.h", it does not recognize that header file. What do I need to do so that MSVS recognize the added files? Thanks for the help.

Upvotes: 4

Views: 14865

Answers (1)

Luchian Grigore
Luchian Grigore

Reputation: 258648

Add the path to the header to the Extra include directories in the project settings.

Adding existing files to a project doesn't actually copy the files. They remain in their original location.

Upvotes: 8

Related Questions