locked
how do I include a library RRS feed

  • Question

  • Hi everyone,

    I am fairly new to programming, I have a c++ project and I use visual studio 2008.

    I am trying to include a library I found. It's a folder with a lot of .h and .c files and some subfolders (also filled with .h and .c files).

    I tried "#include <filename>"I alsow tried #include <path\filename> but I keep getting the "fatal error C1083: Cannot open include file: 'stdint.h': No such file or directory"

    I added the folder where the files are located in tools->options->vc++directories

    I have added the folder where the files are located in the project options->common options->reference paths

    I set my solution explorer view to include all files, and I have tried right clicking on the files and clicking include in project

    But no matter what I do I keep getting that same error. I am getting somewhat frustrated now, and I am almost ready to just paste the file content in the other file, however this would take forever because it's a complete library. (and it would be completely cracy)

    Thanks very much in advance for any help!!

    Saturday, April 24, 2010 10:38 AM

Answers

  • Use Project menu 'Add Existing Item' to add the .c files to the solution.

    For the h files you should use "filename.ext" not <filename.ext>

    You may have to add the directories at Tools, Options, Projects and Solutions, VC++ Directories, Show Directories for : Include files.

     

    • Proposed as answer by Nikita Leontiev Sunday, April 25, 2010 10:09 AM
    • Marked as answer by Yi Feng Li Friday, April 30, 2010 1:56 AM
    Saturday, April 24, 2010 12:44 PM
  • As I remember stdint.h is not included in Visual Studio.

    Download it from here and provide path to it in VS options or project settings.

    http://msinttypes.googlecode.com/svn/trunk/stdint.h


    Nikita Leontiev
    • Marked as answer by Yi Feng Li Friday, April 30, 2010 1:56 AM
    Saturday, April 24, 2010 12:49 PM

All replies

  • Use Project menu 'Add Existing Item' to add the .c files to the solution.

    For the h files you should use "filename.ext" not <filename.ext>

    You may have to add the directories at Tools, Options, Projects and Solutions, VC++ Directories, Show Directories for : Include files.

     

    • Proposed as answer by Nikita Leontiev Sunday, April 25, 2010 10:09 AM
    • Marked as answer by Yi Feng Li Friday, April 30, 2010 1:56 AM
    Saturday, April 24, 2010 12:44 PM
  • As I remember stdint.h is not included in Visual Studio.

    Download it from here and provide path to it in VS options or project settings.

    http://msinttypes.googlecode.com/svn/trunk/stdint.h


    Nikita Leontiev
    • Marked as answer by Yi Feng Li Friday, April 30, 2010 1:56 AM
    Saturday, April 24, 2010 12:49 PM
  • I found it. The problem was that although I did add the path in tools, options, projects and solutions, vc++ directories, I didn't click on include files, so the path was created in execuable files.

    Thanks very much for the help!!

     

     

    Saturday, April 24, 2010 1:45 PM