I don't have OS X available at the moment but if I recall correctly you'll have to use open to launch the graphical app you want if that file .
Code:
open -a gedit practice1.cpp
If you take a look a the graphical app using the shell, you see that it's really a set of directories with a huge number of files included. If I understand correctly, they are self-contained and statically linked.
About gcc and g++, you'll have to get that from XCode. I think it still might be free but you do have to download it from the Apple Store.
Bookmarks