title: Unable to export functions from C++ DLL
body: <p>I need to create a C++ MFC DLL using Visual Studio 2008. To do this I created a DLL MFC Win32 Console project in Visual Studio and made a function that creates an object and uses its method to print a string to the screen. Kind of like this:</p>
  
  <pre><code>__declspec(dllexport) void Foo(void);
  </code></pre>
  
  <p>where: </p>
  
  <pre><code>    void Foo(void){
      print* obj = new print;
      obj-&gt;testPrint();
      return;
  }
  
  void print::testPrint(void){
      printf("Bar\n");
      return;
  }
  </code></pre>
  
  <p>It compiles successfully and generates the DLL, but when I try to use it I always get:
  "error LNK2019: unresolved external symbol "void __cdecl Foo(void)"</p>
  
  <p>I tried using Dependency Walker and it doesn't show any function up in the DLL. Am I doing something wrong? I've searched a lot and still got no conclusions from what may be happening.</p>