title: MinGW compilation "file not recognized: File format not recognized"
body: <p>I'm trying to compile a c++ program and I am having some issues. In particular, when I use x86_64-w64-mingw32-gcc as my compiler, it complains half way through my compilation saying "tmp/src/libfastms/solver/solver.cpp.o: file not recognized: File format not recognized".</p>
  
  <p>Here is my makefile (not mine, I'm trying to adapt this makefile to a cygwin environment) <a href="https://pastebin.com/vgnVYJUL" rel="nofollow noreferrer">https://pastebin.com/vgnVYJUL</a></p>
  
  <p>Here is the console output when I run make:</p>
  
  <pre><code>x86_64-w64-mingw32-gcc -c -o tmp/src/libfastms/solver/solver.cpp.o src/libfastms/solver/solver.cpp  -Wall -O3 -m64  -Isrc/libfastms  -DDISABLE_OPENMP -DDISABLE_OPENCV -DDISABLE_CUDA
  x86_64-w64-mingw32-gcc -c -o tmp/src/libfastms/solver/solver_base.cpp.o src/libfastms/solver/solver_base.cpp  -Wall -O3 -m64  -Isrc/libfastms  -DDISABLE_OPENMP -DDISABLE_OPENCV -DDISABLE_CUDA
  x86_64-w64-mingw32-gcc -c -o tmp/src/libfastms/solver/solver_host.cpp.o src/libfastms/solver/solver_host.cpp  -Wall -O3 -m64  -Isrc/libfastms  -DDISABLE_OPENMP -DDISABLE_OPENCV -DDISABLE_CUDA
  x86_64-w64-mingw32-gcc -c -o tmp/src/libfastms/util/has_cuda.cpp.o src/libfastms/util/has_cuda.cpp  -Wall -O3 -m64  -Isrc/libfastms  -DDISABLE_OPENMP -DDISABLE_OPENCV -DDISABLE_CUDA
  x86_64-w64-mingw32-gcc -c -o tmp/src/libfastms/util/image_mat.cpp.o src/libfastms/util/image_mat.cpp  -Wall -O3 -m64  -Isrc/libfastms  -DDISABLE_OPENMP -DDISABLE_OPENCV -DDISABLE_CUDA
  ld -r -o tmp/src/libfastms/libfastms.o tmp/src/libfastms/solver/solver.cpp.o tmp/src/libfastms/solver/solver_base.cpp.o tmp/src/libfastms/solver/solver_host.cpp.o tmp/src/libfastms/util/has_cuda.cpp.o tmp/src/libfastms/util/image_mat.cpp.o
  tmp/src/libfastms/solver/solver.cpp.o: file not recognized: File format not recognized
  Makefile:167: recipe for target 'tmp/src/libfastms/libfastms.o' failed
  make: *** [tmp/src/libfastms/libfastms.o] Error 1
  </code></pre>
  
  <p>Some other notes:</p>
  
  <ul>
  <li>I don't have this problem when I compile with g++ (only seems to be minGW)</li>
  <li>A common solution to this problem is to clean the directory of residual object files. This does not work.</li>
  <li>Another common reason for this is trying to compile .h files. Obviously I am not doing this.</li>
  </ul>
  
  <p>Thanks in advance.</p>