Immunity Error "probably not a 32-Bit Portable Executable" when compiled with g++

I am working through the Pentatration Testing: System Security course and I am on the buffer overflow goodpwd exercise. my immunity debugger cant load my compiled goodpwd.exe and it appears b/c it was compiled using g++, when i compile it with gcc and add a flag -lstdc++ at the end, it works. I know that different compilers make slightly different code, but if i run a file command in linux on the g++ compiled executable, i get a 32 bit PE, and that is what immunity is telling me the file is not and why it is unable to load. Any thoughts here?

Hi, I used Dev-C++ (after proper install) to compile the goodpwd.cpp, noting that in tools\compiler options there are a few options for 32X or 64X to select. To be able to load a PE with immunity debugger, the TDM-GCC 4.9.2 32-bit release worked for me. However without selecting it, ID threw out the same error as per your subject.