dllmakefile64-bitmingw-w6432-bit

"[WinError 193] %1 is not a valid Win32 application" running CDLL with 64 bit MinGW-w64


I'm trying to compile and run a package on Windows 11 with MinGW-w64, but I'm getting the error message "[WinError 193] %1 is not a valid Win32 application" when I try to run the .dll produced. The makefile is compiling and producing a .dll, and I've confirmed that both MinGW and my Python interpreter running with 64 bits, and I'm using the -m64 CFLAG and LDFLAG in the makefile as well. The line causing this error runs CDLL(path) where path directs towards the .dll file. Any help with this would be appreciated!


Solution

  • Turns out the makefile just didn't have the line that created the .dll! I ran that separately a few days ago and accidentally had it set to 32 bits, and running the makefile wasn't overwriting it as I had expected. Everything's working now!