title: No functions get exported into DLL despite proper dllExport - Visual Studio
body: <p>I have a base class (<code>QIndicator</code>) and I want to implement derived classes in DLLs. The DLL project in Visual Studio 2012 for a sample derived class has the following code:</p>
  
  <p><strong>header file with base class</strong></p>
  
  <pre><code>#ifndef _DLL_COMMON_INDICATOR_
  #define _DLL_COMMON_INDICATOR_
  
  // define the DLL storage specifier macro
  #if defined DLL_EXPORT
      #define DECLDIR __declspec(dllexport)
  #else
      #define DECLDIR __declspec(dllimport)
  #endif
  
  class QIndicator 
  {
      private:
          int x;
          int y;
  };
  
  extern "C"      
  {
      // declare the factory function for exporting a pointer to QIndicator
      DECLDIR QIndicator * __stdcall getIndicatorPtr(void);
  }
  
  #endif 
  </code></pre>
  
  <p><strong>source file with derived class</strong></p>
  
  <pre><code>#define DLL_EXPORT
  
  #include "indicator.h"
  
  class QIndicatorDer : public QIndicator
  {
      public:
          QIndicatorDer       (void) : QIndicator(){};
          ~QIndicatorDer      (void){};
  
      private:
          // list of QIndicatorDer parameters
          int x2;
          int y2;
  };
  
  extern "C"     
  {
      DECLDIR QIndicator * __stdcall getIndicatorPtr(void)
      {
          return new QIndicatorDer();
      };
  }
  </code></pre>
  
  <p>The problem I have is that upon successful build, the produced DLL file does not contain the exported <code>getIndicatorPtr</code> function (as shown by DependencyWalker). I checked whether the <code>dllexport</code> keyword gets propagated properly into the declaration of <code>getIndicatorPtr</code> and it does. </p>
  
  <p>Another interesting problem is that I already have another derived class like this, in another DLL project, that I created some months ago. This older project is basically the same and everything works well there. I checked all properties of both the old and the current projects, and they seem identical. So I ran out of ideas, why I can't get <code>getIndicatorPtr</code> to export. </p>
  
  <p>Any help is much appreciated, 
  Daniel</p>