Блог пользователя gagantheroyal

Автор gagantheroyal, история, 8 лет назад, По-английски

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
  • Проголосовать: не нравится

»
8 лет назад, # |
  Проголосовать: нравится +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.

  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится +8 Проголосовать: не нравится

    ok , i tried this steps and it succeded but until now i can't compile or run the code , please help ?

    • »
      »
      »
      6 лет назад, # ^ |
        Проголосовать: нравится +8 Проголосовать: не нравится

      You will have to be more specific. Otherwise, your "succeeded" and "can't compile" statements seem to contradict each other.

      • »
        »
        »
        »
        6 лет назад, # ^ |
        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

        • »
          »
          »
          »
          »
          6 лет назад, # ^ |
            Проголосовать: нравится 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.

  • »
    »
    6 лет назад, # ^ |
      Проголосовать: нравится +8 Проголосовать: не нравится

    Thanks for that i was using ctrl+g and manually input the compile code. I going to try this.

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится 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 года назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      Create one. Read the first comment in the thread.

      • »
        »
        »
        »
        4 года назад, # ^ |
          Проголосовать: нравится 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 года назад, # ^ |
      Проголосовать: нравится 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

    • »
      »
      »
      4 года назад, # ^ |
        Проголосовать: нравится +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.

      • »
        »
        »
        »
        4 года назад, # ^ |
          Проголосовать: нравится 0 Проголосовать: не нравится

        What command I should write?...I mean which link..can I write the link as you write... And how to create a file?

        • »
          »
          »
          »
          »
          4 года назад, # ^ |
            Проголосовать: нравится 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.

  • »
    »
    4 года назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    What should I write in execute command (used for enter)...? Can I write it same as you have written

    • »
      »
      »
      4 года назад, # ^ |
        Проголосовать: нравится 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.

      • »
        »
        »
        »
        4 года назад, # ^ |
          Проголосовать: нравится 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

        • »
          »
          »
          »
          »
          4 года назад, # ^ |
            Проголосовать: нравится 0 Проголосовать: не нравится
          1. Open Far Manager.
          2. Navigate to a directory where you will store the program.
          3. Press Shift+F4. (On newer laptops, Fn Lock may interfere with that, act accordingly.)
          4. Input the name of the new file.
          5. Press Enter.
          6. ...
          7. Press Save (F2). (Won't work if you don't have write permission for the current file location.)
          8. Then Quit (Esc).
          • »
            »
            »
            »
            »
            »
            4 года назад, # ^ |
              Проголосовать: нравится 0 Проголосовать: не нравится

            Thanks sir...I have created the file ..but how would I have permission to save file...?

            • »
              »
              »
              »
              »
              »
              »
              4 года назад, # ^ |
                Проголосовать: нравится 0 Проголосовать: не нравится

              Please teach me all steps until I give input to program and get the output

              • »
                »
                »
                »
                »
                »
                »
                »
                4 года назад, # ^ |
                  Проголосовать: нравится 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.

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  4 года назад, # ^ |
                    Проголосовать: нравится 0 Проголосовать: не нравится

                  I completely understand you sir... But please let me know how to compile,run and give input in far manager

                • »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  »
                  4 года назад, # ^ |
                    Проголосовать: нравится 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.

          • »
            »
            »
            »
            »
            »
            2 года назад, # ^ |
              Проголосовать: нравится 0 Проголосовать: не нравится

            May I know how to use F9 to compile file in far manager?

            • »
              »
              »
              »
              »
              »
              »
              2 года назад, # ^ |
                Проголосовать: нравится 0 Проголосовать: не нравится

              For example, you can record a keystrokes sequence and bind it to a hotkey. The process is described, for example, here.

»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Whenever there is an infinte loop the Console screen gets stuck. Is there any way to set a timeout of few seconds.