OSMAN wrote:but why would they be outputting 64bit binary as defaulf now
Because your running a 64bit system? Is there any reason why they should not be outputting 64bit binaries? Nonetheless you have to tell gcc/g++ for which architecture you want to compile. Just read the manpage.
quoting from the manpage:
Hardware Models and Configurations
Earlier we discussed the standard option -b which chooses among different installed compilers for completely different target machines, such as VAX vs. 68000 vs. 80386.
In addition, each of these target machine types can have its own special options, starting with -m, to choose among various hard- ware models or configurations---for example, 68010 vs 68020, floating coprocessor or none. A single installed version of the compiler can compile for any model or configuration, according to the options specified.
Hey, do I have to specify BITS 32 in assembly code in case that's not defaulted?
Yes, you should do this, but that should be no problem at all, because nasm does not support 64bit (for that you might want to use yasm).
And I think it was the assembly part, since I don't have much inline assembly in C.
I wouldn't bet on that. You should try to find out where that error occurs.