title: Python calling DLL: TypeError: 'LibraryLoader' object is not callable
body: <p>I am trying to import a DLL into Python 2.7.12 64 bit using ctypes. To narrow down the scope for errors I used Microsoft's MathLibrary DLL example and built my own based on these instructions (<a href="https://msdn.microsoft.com/en-GB/library/ms235636.aspx" rel="nofollow noreferrer">https://msdn.microsoft.com/en-GB/library/ms235636.aspx</a>). I built it as x64 release and copied the resulting dll into C:\ root to eliminate path length or spelling error issues. My machine us running Windows 7 Pro 64 Bit.</p>
  
  <p>My python code is:</p>
  
  <pre><code>from ctypes import cdll, windll, c_long, c_int, create_string_buffer
  
  test_dll = windll("C:\\MathLibrary.dll")
  
  add = test_dll.add
  </code></pre>
  
  <p>When run it reports the following:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\temp.py", line 3, in &lt;module&gt;
      test_dll = windll("C:\\MathLibrary.dll")
  TypeError: 'LibraryLoader' object is not callable
  </code></pre>
  
  <p>Can anyone advise what might be the issue?</p>
  
  <p>Thanks</p>
  
  <p>Andy</p>
  
  <hr>
  
  <p>Update:</p>
  
  <p>@eryksun comment  - this removed the LibraryLoader error. However I am now struggling to access the add function and get this error:</p>
  
  <pre><code>    add = test_dll.add
    File "C:\Python27\lib\ctypes\__init__.py", line 375, in __getattr__
      func = self.__getitem__(name)
    File "C:\Python27\lib\ctypes\__init__.py", line 380, in __getitem__
      func = self._FuncPtr((name_or_ordinal, self))
  AttributeError: function 'add' not found
  </code></pre>