1) Install Apple's Developer Tools (XCode etc). These include command line compilers like gcc. You should have an installer in Applications->Installers or something similar or you can download the newest release from : Apple. You want the XCode download. If it says you need a developer account you can create a free web only one.
2) If you really want something like apt check out fink or darwin ports.
Suspected that, but I'm so used to gcc/g++ that I didn't dare suggest Developer Tool... 😱
Do you know if (g)cc is available via Fink...? 🙂
Edit: Never mind, just remembered that I have fink installed, and gcc 3.3 is available... and there are also some cctools, which I guess has something to do with the compiler... 🙂
thanks.. i already found fink.dmg. my problem was that i was trying to install Qt.. for this i need gcc.. then i downloaded gcc and tried to install.. but of course for this i needed cc.. so i was going nowhere. i hope fink will help