ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Is it possible to program through the terminal or console rather than using a text editor..If so....how can I do this? Ohhhh I am using Mandrake 8....Thanx
It's a bit of a learning curve, but it's also an addiction.
I believe emacs has better formatting tools for programmers, but I'm sure someone here can offer a better suggestion or elaborate on the above.
Hey....I need some help with this emacs stuff......I do the compile and I get make: *** No targets specified and no makefile found.
I am doing the hello.cxx program..do I have to specify the directory. I thought it would do the default dir.
It's been a long time since I used emace, but I'm guessing that the compile option in emacs is just calling make in a shell. make needs a file called Makefile in order to compile your program. You have two options. One, create a makefile with the rules to build your hello.cpp file. Two, (recommended) in a second window type g++ -o hello hello.cpp.
It's not really worth writing a Makefile for something as small as hello.cpp, but if you do intend to rebuild a file over and over for testing it may be beneficial. For my small test programs I have kind of a "general purpose" makefile that I can add most any simple program to.
Writing Makefiles can drive you crazy if you do not follow the make rules exactly. (watch your tabs instead of spaces).
Alright......finally progress!!!! I got it to compile to an executable file thanks to crabboy...Now how do i run the executable?<-----I promise this the last question on this...
Change the permissions on the hello to allow execution. Try: chmod 755 hello. This will turn on execution for every user that may try to execute it. Then type ./hello and the program should execute.
Note: if you want to execute something without adding execute permissions you can always do it like this: . ./hello
Note: if you want to execute something without adding execute permissions you can always do it like this: . ./hello
actually, this is a common misconception. i thought this until jharris pointed it out to me a few days ago. the execute permissions HAVE to be set, otherwise you get a "permission denied" error. for demo, try this out on a text file
This was a text file and it was executed by the shell.
Code:
-rw-r--r-- 1 webtest users 715 Jul 23 21:59 todo
bash$ . ./todo
bash: System:: command not found
bash: ./todo: line 2: unexpected EOF while looking for matching `''
bash: ./todo: line 14: syntax error: unexpected end of file
ok great that's two straight i've gotten wrong here.
in my defense, i didn't notice that there were two .'s i always used to execute stuff with just the ./ - which i thought would treat any file as executable, until jharris corrected me on that. well... learn something new, i guess.
next time i'm just gonna step out of the way of anyone who has more posts than me
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.