title: Can I build executable as dll?
body: <p>I need to create a dll which contains stuff I have in my executable project in visual studio 2010. I realized instead of creating a dll project, I can just change the project configuration in project properties >> General >> 'configuration type' to 'dll' and it builds fine. It creates the dll. I added an additional .h/.cpp files which contains the export functions I want in the dll.</p>
  
  <p>My first concern is that is this a legit dll? I am trying to load it using <code>LoadLibrary()</code> but I get error code 126 (The specified module could not be found) although the dll is in the project directory (same as executable). I am just wondering if it has to do with the fact it may not be a fully qualified dll for any reason? My exe project is MFC project.</p>
  
  <p>** <strong>Update</strong> **</p>
  
  <p>Thanks to the comments, I can now load the dll successfully - it was dependencies issue. However <code>GetProcAddress()</code> doesn't return valid pointer for the export function. The <code>dumpbin /exports</code> utility shows the dll has no export functions!</p>
  
  <p>So I have added just .h/cpp files to the original project which has a simple dummy function for export right now.</p>
  
  <pre><code>__declspec(dllexport) int MakeDouble(int value);
  </code></pre>
  
  <p>I also included the header file in the app class just in case. I am wondering why does this function does't appear as an export? What do I have to do?</p>