|
I've exhausted my question for this entry, I'll bug u guys later :D /thread
So I'm doing the first example of the textbook now... I ran into trouble.
In Emacs yada.c: === #include <stdio.h>
main() { printf("hello, world\n"); } ===
In Terminal evan@Evan-Box:~/Documents/tryingout$ cc yada.c evan@Evan-Box:~/Documents/tryingout$ ls a.out yada.c yada.c~ evan@Evan-Box:~/Documents/tryingout$ a.out bash: a.out: command not found
nvm got it evan@Evan-Box:~/Documents/tryingout$ a.out bash: a.out: command not found evan@Evan-Box:~/Documents/tryingout$ ~/Documents/tryingout/a.out hello, world
So what did I do wrong? It seems I could type "emacs" in anywhere on the directory and emacs would run, but my a.out need to be specified by ~/Documents/tryingout/a.out for it to run... hmm
|
I'll be watching this blog constantly for the next 1 hour until I get answers xD
|
You got a Linux n stuff.... So now you can't play iCCup n stuff... You can't use Chaos Launcher n stuff... Poor guy I feel your pain. At least you won't have virus issues. People don't code viruses for Linux very often.
|
Why you had to get linux to do C programming I don't know, but ah well
C is made in files that are basically .txt, but different extension (.h and .c). You compile those through gcc and link them and such, so that's what you'll be using mainly. Getting emacs can depend on your distro, but knowing Ubuntu, you probably already have it (I dunno though, never used Ubuntu). Someone more well-versed in C will have to help you with the rest
|
Thx Tec, my eecs roomate recommended getting a linux for that because he says linux has the more natural compiler and windows has a shit compiler or something haha. Hi Selbon, I use linux just to learn C, I still have windows.
|
I'm using Ubuntu and I find that emacs is not automatically installed. You can easily install it through "Add/Remove.." Applications.
|
GNU GCC complier not good enough?
|
On January 07 2009 16:34 IzzyCraft wrote: GNU GCC complier not good enough? :p I have no idea what are you talking about. I have 0 experience, please explain
|
United States3824 Posts
They made me get linux yesterday too at school for java.
Here's what you do. Edit the program in a text file inbuntu should come with a text editor. Put the file in the folder that you want to compile in, and then get your compiler up and running. Basically you can do it with the command prompt if you navigate to the right folder and then use whatever C command to run your compiler. I would look in your compiler documentation for that though.
Or run it in windows and feel better about your life because you aren't a open source zealot.
|
United States3824 Posts
Wait if your roommate told you how to do it why didn't you ask him? Just saying.
|
United States3824 Posts
And furthermore isn't C a little archaic? Is this for a class or did you decide that you wanted to make yourself suffer by learning to program in a language that is really really effing difficult?
|
Out of curiosity, what do you plan on learning C for anyway? Depending on what you want to do, there may be a better language suited for your purposes.
|
Well if you're just learning how to program there is probably no better language then C imo and i do believe it's true native linux's support C much better then windows. Anyways what i mentioned is probably the most used compiler used for any C work unless professional. Which can always be done though cmd prompt like alot of things it just doesn't come native to windows.
|
thedeadhaji
39489 Posts
Kernighannn is an awesomee guuyyyyyyyyyyyy had him as faculty @ Pton
|
Like stated, you make text files with a text editor, doesn't matter if it's graphical or in the console. Then navigate the compiler to the file and compile it.
The extensions in Linux don't matter, while the permissions the files have - DO matter. I mean no matter what the file extension is, you can compile it with a C compiler as long as you have the permissions to do so.
|
K guys thanks. Is there anyway to find out if a certain application is on my system? Say I want to search for starcraft, how do I do that in the terminal? Now say I want to execute the program starcraft, how do that do that in the terminal?(Just type starcraft I guess? I typed emacs and it ran) thanks!
|
Alrite I just typed emacs in the terminal and it prompted me to install it. SO I guess I'll have emacs now. Now quesiton is: Where is emacs? It did not ask me where to put emacs and now I dunno where it is haha
All previous question still pertains.
|
thedeadhaji
39489 Posts
|
Germany2896 Posts
If you want to use win, you could get Visual Studio Express which might be a bit more familiar. Emacs, GDB, etc might be powerful, but they are quite different from what a windowser is used to. To play SC you need to install wine, as there is no linux native version of SC. And why do you want to do everything in the terminal? To manage apps there should be some packetmanager. But I don't know which one it is for your distri.
|
Hai, I know how to use emacs. I am not saying I want to play sc, I'm just using sc as an example of a program. I am asking how do I run a program from the terminal. So far my understanding is you just type the program.
For instance I jsut got emacs and to run it I just go yadayada$Emacs&
and it'll run it for me. Is my interpretation correct?
|
|
|
|