I am new to using Far Manager (http://www.farmanager.com/). I found it very helpful for managing files and editing. But when it comes to compiling and running programs I think we have to do many things manually similar to as while running programs from command line (as compared to using suitable IDE). Also I could not find any good tutorial (in English) for compiling, running and debugging c/c++ programs using Far. Could any one please explain how I can do these tasks (compiling, running and debugging) easily? i.e. with very less manual efforts?
Also it would be great to get an explanation (steps) for running interactive programs (having user interaction in command line for giving inputs to the program). You can also post some good links to tutorials (in English) explaining all these.
You can create file associations in Far Manager. Go to Menu (
F9
) -> Commands (C
) -> File associations (A
), then make a new file association (Insert
):Now, when you press Enter on a file, say,
e.cpp
, the commandg++ -O2 -Wall -Wl,--stack=268435456 e.cpp -o e.exe
will be executed. If all is well, the executable filee.exe
will appear. For this to work, g++ must be already in yourPATH
. Otherwise, provide the full path, likeC:\MinGW\bin\g++
instead of justg++
.Better integration (say, compile by pressing
F9
in the editor) is also possible, but a bit more work to set up.As for debugging, personally, I use debug output for debugging contest code. Not much integration needed.
ok , i tried this steps and it succeded but until now i can't compile or run the code , please help ?
You will have to be more specific. Otherwise, your "succeeded" and "can't compile" statements seem to contradict each other.
ok i understand , but i want to ask you about something — from your opinion what is the best competitive IDE (competitive) for C++ ? ! away from the subject of far manager
Huh? Sorry, I don't follow your logic.
Anyway, there's plenty of previous discussion on the topic. In case you still have questions, do post in a more relevant place.
Thanks for that i was using ctrl+g and manually input the compile code. I going to try this.
I have g++ installed and also it is set in the path but when i open file associations in far manager there is no *.cpp file extension.what should i do?
Create one. Read the first comment in the thread.
I went through the first comment in the thread but iam unable to create one new association. It is not showing any options and also there are no existing file associations also.The file association table is empty.
Press the Insert key on your keyboard to make a new association.
Yeah thanks Gassa its working now.
As you have said that after file association process we can create any file....but how would I know which is my command link...I have tried your command but it's not working... please explain it completely please
The ability to create any file does not depend on file associations.
When you write in the line under "Execute command (used for Enter)", the command you wrote will activate when you press Enter on the file. Same for the other lines.
Maybe you forgot to save the command? When you are done on that screen, press OK to save the new file association.
If the above guess doesn't work, I'm out of guesses. In that case, you may want to explain what exactly you did, and what exactly didn't work.
What command I should write?...I mean which link..can I write the link as you write... And how to create a file?
To create a file, press
Shift+F4
.As for the other part, there is a generic manual in Far, just press F1 and follow.
Now, if you still need specific help, please say what specifically went wrong, down to the letter, when you followed the guide above. Based on your comment, sorry, I can't guess what is the part where you get stuck.
What should I write in execute command (used for enter)...? Can I write it same as you have written
If you have g++ in your path, yes you can.
Otherwise, use the full path, like
C:\MinGW\bin\g++
instead of justg++
.The remaining part of the line may remain the same.
Okay sir...sir I have tried many times to create a file but it's not showing anything...what can be the reason?... Sir please help me out... please give me complete steps to create a file from beginning of opening far manage
Shift+F4
. (On newer laptops, Fn Lock may interfere with that, act accordingly.)F2
). (Won't work if you don't have write permission for the current file location.)Esc
).Thanks sir...I have created the file ..but how would I have permission to save file...?
Please teach me all steps until I give input to program and get the output
You know, if you have trouble saving files on your computer and setting permissions to folders, perhaps you will do better with a more intuitive environment. Far Manager assumes basic skills with command line and such. Alas, I'm not that good at teaching computer literacy remotely. Google is your better friend in this case.
I completely understand you sir... But please let me know how to compile,run and give input in far manager
OK then sir, how about a question of the form of:
I don't want to go in circles here. Do value your and others' time. As snobby as he sounds, Eric Raymond does have a point.
May I know how to use F9 to compile file in far manager?
For example, you can record a keystrokes sequence and bind it to a hotkey. The process is described, for example, here.
Whenever there is an infinte loop the Console screen gets stuck. Is there any way to set a timeout of few seconds.
Try
Ctrl+C
-ing the program then.