Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
You should really be making everything ELF instead of a.out, which is barely supported by anything anymore. The stuff compiled by gcc is probably ELF, and therefore things cannot be linked together. Use the -felf flags with nasm instead of -faout.