Hello everyone
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
prushik 50 Junior Poster
cool_jatish -5 Newbie Poster
jephthah commented: GTFO you cheating fraud of lying liar -1
Nick Evan commented: Here's some reputation. Too bad it's the wrong kind. -2
jephthah 1,888 Posting Maven
jonsca commented: The first rule of Rep Club is that you do not talk about Rep Club. +4
cool_jatish -5 Newbie Poster
jephthah 1,888 Posting Maven
Banfa 597 Posting Pro Featured Poster
Nick Evan 4,005 Industrious Poster Team Colleague Featured Poster
jephthah commented: gah. i need to not drink and post. +7
prushik 50 Junior Poster
Salem 5,199 Posting Sage
prushik 50 Junior Poster
Banfa 597 Posting Pro Featured Poster
Salem commented: Nicely put +20
prushik 50 Junior Poster
Banfa 597 Posting Pro Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.