So in Linux or Unix I can write my code in emacs, than save it with a .cpp extention. Than how do I compile it from there? What is the line of code?
So in Linux or Unix I can write my code in emacs, than save it with a .cpp extention. Than how do I compile it from there? What is the line of code?
My best code is written with the delete key.
You compile c++ source files with the command cpp, example:
cpp source.cpp -o proggy
Now that would name the output 'proggy'.
For c source files its:
gcc source.c -o proggy
Thanks.
or wait. What about make files. How are those constructed in Linux?
You write them by hand. A google search should turn up a tut or two.
starX
www.axisoftime.com
Are you trying to tell me that handi capped people can't write them? You prejudiced bastard.
You can't be Troll_King. Quzah says that I'm Troll_King.
Quzah is blind.
ugh... stop it.
you can compile it through emacs, but i don't think its a particularly time-saving idea. a seperate console does the exact same thing.
Actually, a moderator clicked the nice little link that says "IP Logged" and found out that lo and behold, Troll_King's IP address was the same as someone posting as "unknown".Originally posted by Unregistered
You can't be Troll_King. Quzah says that I'm Troll_King.
Quzah.
Hope is the first step on the road to disappointment.
Make is a great tool for any coding.
Code:$cat >Makefile program: program.o g++ -o program program.cpp program.o: program.cpp g++ -c program.cpp $make g++ -c program.cpp g++ -o program program.cpp $make make: Nothing to be done for `program'. $
I don't know about you, but I don't appreciate the moderators and webmasters sending me email to porn sites, so I don't accept cookies here anymore.
Thanks for the code. I haven't come accross programming in Linux yet, but it is enevitable especially since I have a few books on that topic not far away. If that is all there is to making a MAKE file, than it shouldn't be a problem. Great.
Make is painful.. I know from personal experience .
You might want to try KDevelop (comes with Red Hat 7.3) or Anjuta (dunno if it comes with it) to build/edit/debug your programs (much like Visual Studio).