1

I am just getting started with visual studio and have begun a C# project. I was wondering how I can link to a specific header file/library using visual studio or whether that is possible or not.

What I want is to be able to include a file by browsing for it and to have it appear in the using headers automatically. Any ideas?

Raktim Biswas
  • 4,011
  • 5
  • 27
  • 32
Ricky Payne
  • 71
  • 1
  • 12
  • C# . I'm just wondering if I can make my life easier with some built in VS functionality – Ricky Payne Oct 24 '16 at 11:29
  • 2
    In `C#` they're called _using directives_ https://msdn.microsoft.com/en-us/library/sf0df423.aspx – fubo Oct 24 '16 at 11:31
  • If you want to add files that are in different [namespaces](https://msdn.microsoft.com/en-us/library/z2kcy19k.aspx), then you must add a reference in one file to the namespace of the other file using the `using ` directive. – Raktim Biswas Oct 24 '16 at 11:43

1 Answers1

4

In C# you don't have header files. If you are trying to use some C++ code in your application, you need to create a wrapper dll for it. More on this here

If you want to use a library (dll file) in your project you need to reference it to your project.

  1. In Solution Explorer find your project and open it up
  2. Right click on the References item.
  3. Select Add Reference

Here you can add a reference to a project in the same solution, or select browse on the left side to find the concrete dll you want to use.

Community
  • 1
  • 1
Milan Gulyas
  • 632
  • 8
  • 18