Possibly the compiler you're using? Just throwing that out. The code is fine (kind of hard to screw up a hello), and I compiled and ran it on my AIX system without error.
I would have to go with the compiler. You said it compiled and ran on Windows, but if the compiler is a Windows compiler then using it on Unix probably would give you strange behavior because of the architecture differences on the platforms. Did it compile on Unix? If so, I would still say a compiler issue since if it is a Windows compiler.