Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 904
TJ1 Avatar asked Feb 20 '23 10:02

TJ1


1 Answers

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.

like image 188
Luchian Grigore Avatar answered Feb 21 '23 22:02

Luchian Grigore