I am trying to learn about the compilation process. I am working on a pretty simple SDL game, but I know that making games isn't very practical, so I am using the project to learn about other programming aspects as well. One of the things I am trying to learn about it the full compilation process, in detail. I have found an interesting article on the subject at: http://www.lisha.ufsc.br/teaching/os/exercise/hello.html
However, I followed the same steps the author of the article did, and I am having a lot of trouble in the linking stage. When I do the same thing the author did, I end up with a lot of undefined reference errors. If I link without the -static flag, it looks like it works, but when I try to run the executable, I get the error
bash: ./hello: No such file or directory (which is not true, I can confirm that it exists and has the correct permissions with "file" and "ls -lA"). I thought that maybe the issue was my 64 bit processor and I was linking against some 32-bit libs, so I tried linking against libs from /usr/lib64/ instead on /usr/lib/ but the result was the same.
If I can't get this simple "hello world" code to build correctly, my game certainly won't. What am I missing?
I am using linux and gcc, if that isn't obvious.
gcc version 4.3.3