title: Linking with gcc on Windows:
body: <p>I'm trying to link a c-file (<code>cvode.c</code>) towards a set of .dll files.  I run the following two lines in a cmd:</p>
  
  <pre><code>&gt;&gt;&gt; gcc -c -I C:\sundials\inst2\include cvode.c
  
  &gt;&gt;&gt; gcc -shared -o cvode_lib.dll cvode.o -L. C:\sundials\inst2\lib\sundials_cvode.dll -L. C:\sundials\inst2\lib\sundials_nvecserial.dll
  </code></pre>
  
  <p>The first command does not give any errors but the second one gives the following error message:</p>
  
  <pre><code>C:\sundials\inst2\lib\sundials_cvode.dll: file not recognized: File format not recognized
  collect2.exe: error: ld returned 1 exit status
  </code></pre>
  
  <p>If I try to import the dll-files with ipython it works perfect, and the same two lines (with the same source files) works perfectly on my second computer running the same OS (windows 10 64bit) with the same version of gcc (installed with the latest Mingw64-installer).  I've also tried to install cygwin64 and compile with its gcc-version, without success.  The file compiles perfectly fine on an Ubuntu computer as well.</p>
  
  <p>I have also tried to link vs the corresponding <code>&lt;sundials&gt;</code>.lib-files but that is not working either.</p>
  
  <p>Googling for solutions has not been successful, maybe because I am not too familiar with c or gcc.  However since it runs perfect on my other Win10 PC I fear it might be something deeper... </p>