### gagantheroyal's blog

By gagantheroyal, history, 5 years ago, ,

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.

• +8

 » 5 years ago, # |   +8 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 command g++ -O2 -Wall -Wl,--stack=268435456 e.cpp -o e.exe will be executed. If all is well, the executable file e.exe will appear. For this to work, g++ must be already in your PATH. Otherwise, provide the full path, like C:\MinGW\bin\g++ instead of just g++.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.
•  » » 2 years ago, # ^ |   +8 ok , i tried this steps and it succeded but until now i can't compile or run the code , please help ?
•  » » » 2 years ago, # ^ |   +8 You will have to be more specific. Otherwise, your "succeeded" and "can't compile" statements seem to contradict each other.
•  » » » » 2 years ago, # ^ | ← Rev. 2 →   0 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
•  » » » » » 2 years ago, # ^ |   0 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.
•  » » » » » » 2 years ago, # ^ |   0 ok , thanks alot
•  » » 22 months ago, # ^ |   +8 Thanks for that i was using ctrl+g and manually input the compile code. I going to try this.
•  » » 4 months ago, # ^ |   0 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?
•  » » » 4 months ago, # ^ |   0 Create one. Read the first comment in the thread.
•  » » » » 4 months ago, # ^ |   0 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.
•  » » » » » 4 months ago, # ^ |   0 Press the Insert key on your keyboard to make a new association.
•  » » » » » » 4 months ago, # ^ |   +8 Yeah thanks Gassa its working now.
•  » » 3 months ago, # ^ |   0 Just like to execute you have given command, can you please provide full command to debug. And what is the meaning of debug out in above comment?
•  » » 2 months ago, # ^ |   0 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
•  » » » 2 months ago, # ^ |   +3 As you have said that after file association process we can create any file.... The ability to create any file does not depend on file associations. but how would I know which is my command link... 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. I have tried your command but it's not working... Maybe you forgot to save the command? When you are done on that screen, press OK to save the new file association. please explain it completely please 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.
•  » » » » 2 months ago, # ^ |   0 What command I should write?...I mean which link..can I write the link as you write... And how to create a file?
•  » » » » » 2 months ago, # ^ |   0 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.
•  » » 2 months ago, # ^ |   0 What should I write in execute command (used for enter)...? Can I write it same as you have written
•  » » » 2 months ago, # ^ |   0 If you have g++ in your path, yes you can. Otherwise, use the full path, like C:\MinGW\bin\g++ instead of just g++. The remaining part of the line may remain the same.
•  » » » » 2 months ago, # ^ |   0 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
•  » » » » » 2 months ago, # ^ |   0 Open Far Manager. Navigate to a directory where you will store the program. Press Shift+F4. (On newer laptops, Fn Lock may interfere with that, act accordingly.) Input the name of the new file. Press Enter. ... Press Save (F2). (Won't work if you don't have write permission for the current file location.) Then Quit (Esc).
•  » » » » » » 2 months ago, # ^ |   0 Thanks sir...I have created the file ..but how would I have permission to save file...?
•  » » » » » » » 2 months ago, # ^ |   0 Please teach me all steps until I give input to program and get the output
•  » » » » » » » » 2 months ago, # ^ |   0 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.
•  » » » » » » » » » 2 months ago, # ^ |   0 I completely understand you sir... But please let me know how to compile,run and give input in far manager
•  » » » » » » » » » 2 months ago, # ^ |   0 OK then sir, how about a question of the form of: what you did, what you expect, what actually happened? 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.
 » 23 months ago, # |   0 Whenever there is an infinte loop the Console screen gets stuck. Is there any way to set a timeout of few seconds.
•  » » 23 months ago, # ^ |   +10 Try Ctrl+C-ing the program then.