Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. error: cannot open output file
Forum Updated to NodeBB v4.3 + New Features

error: cannot open output file

Scheduled Pinned Locked Moved Solved General and Desktop
18 Posts 3 Posters 3.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Axel SpoerlA Axel Spoerl

    @nekkceb
    86d30d02-ab9d-41c8-aeda-237042f07e8a-image.png

    N Offline
    N Offline
    nekkceb
    wrote on last edited by
    #8

    @Axel-Spoerl Sorry, missed the little drop-down arrows! Seems I already have the debug info.

    Axel SpoerlA 1 Reply Last reply
    0
    • N nekkceb

      @Axel-Spoerl Sorry, missed the little drop-down arrows! Seems I already have the debug info.

      Axel SpoerlA Offline
      Axel SpoerlA Offline
      Axel Spoerl
      Moderators
      wrote on last edited by
      #9

      @nekkceb
      No worries. I am curious to learn what you observe!

      Software Engineer
      The Qt Company, Oslo

      N 2 Replies Last reply
      0
      • Axel SpoerlA Axel Spoerl

        @nekkceb
        No worries. I am curious to learn what you observe!

        N Offline
        N Offline
        nekkceb
        wrote on last edited by
        #10

        @Axel-Spoerl Well, I apologize, but I am not expert in debugging compiler issues. I cant see how to do a breakpoint as you suggest, I tried stepping into the .exec function, but that did not do anything. Looks like I am going to have to live with this rather bizarre new behavior or rely on someone more expert to figure it out!

        1 Reply Last reply
        0
        • Axel SpoerlA Axel Spoerl

          @nekkceb
          No worries. I am curious to learn what you observe!

          N Offline
          N Offline
          nekkceb
          wrote on last edited by
          #11

          @Axel-Spoerl I found a solution that works much better than re-booting the computer between each debug cycle. Turns out opening a cmd-prompt, cd to the directory with the offending .exe file and just enter del <filename>.exe /f does the trick!
          However, I still wonder why this behavior started all of a sudden about a week ago, no recent updates to either Windows or Qt. I probably fat-fingered a setting somewhere in Qt, but have not been able to find it so far.

          JonBJ 1 Reply Last reply
          0
          • N nekkceb

            @Axel-Spoerl I found a solution that works much better than re-booting the computer between each debug cycle. Turns out opening a cmd-prompt, cd to the directory with the offending .exe file and just enter del <filename>.exe /f does the trick!
            However, I still wonder why this behavior started all of a sudden about a week ago, no recent updates to either Windows or Qt. I probably fat-fingered a setting somewhere in Qt, but have not been able to find it so far.

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by JonB
            #12

            @nekkceb
            Does it require you use the /f option? If so, that forces deleting of read-only file, which (unlike Linux) Windows/cmd does not allow you to do directly, it requires you make it non-read-only first. If the file being created is somehow being marked read-only then it would not surprise me that Creator or whatever does not do this and expects to open the file directly.

            How that relates to the .exe you are producing I do not know, nor why it has just started happening. But see whether the file is read-only and/or you have to use del /f to delete it, that's a clue.

            BTW, do you use a virus scanner? It is possible that is looking at generated .exe files, worth switching it off or telling it to ignore the build directory.

            N 1 Reply Last reply
            0
            • JonBJ JonB

              @nekkceb
              Does it require you use the /f option? If so, that forces deleting of read-only file, which (unlike Linux) Windows/cmd does not allow you to do directly, it requires you make it non-read-only first. If the file being created is somehow being marked read-only then it would not surprise me that Creator or whatever does not do this and expects to open the file directly.

              How that relates to the .exe you are producing I do not know, nor why it has just started happening. But see whether the file is read-only and/or you have to use del /f to delete it, that's a clue.

              BTW, do you use a virus scanner? It is possible that is looking at generated .exe files, worth switching it off or telling it to ignore the build directory.

              N Offline
              N Offline
              nekkceb
              wrote on last edited by
              #13

              @JonB Thanks for the ideas. Turns out the /f option is not needed. But things are certainly strange! If I try to delete the file in the Windows File Explorer, I get this message:
              276c5ed8-57e4-40ce-b58c-5bd7d887fa9a-image.png
              Note I tried to do this after stopping the program in the debugger AND closing QtCreator. The file is NOT marked as read-only, though windows thinks it is 'open' somehow. Using the cmd-prompt, just issue a del BIPSMain.exe deletes it and allows me to rebuild it in QtCreator.

              Axel SpoerlA JonBJ 2 Replies Last reply
              0
              • N nekkceb

                @JonB Thanks for the ideas. Turns out the /f option is not needed. But things are certainly strange! If I try to delete the file in the Windows File Explorer, I get this message:
                276c5ed8-57e4-40ce-b58c-5bd7d887fa9a-image.png
                Note I tried to do this after stopping the program in the debugger AND closing QtCreator. The file is NOT marked as read-only, though windows thinks it is 'open' somehow. Using the cmd-prompt, just issue a del BIPSMain.exe deletes it and allows me to rebuild it in QtCreator.

                Axel SpoerlA Offline
                Axel SpoerlA Offline
                Axel Spoerl
                Moderators
                wrote on last edited by
                #14

                @nekkceb
                Is BIPS20 your project / BIPSMain.exe your executable?
                If so: It's in use by gdbor however the MinGW derivate is called.

                Software Engineer
                The Qt Company, Oslo

                N 1 Reply Last reply
                1
                • N nekkceb

                  @JonB Thanks for the ideas. Turns out the /f option is not needed. But things are certainly strange! If I try to delete the file in the Windows File Explorer, I get this message:
                  276c5ed8-57e4-40ce-b58c-5bd7d887fa9a-image.png
                  Note I tried to do this after stopping the program in the debugger AND closing QtCreator. The file is NOT marked as read-only, though windows thinks it is 'open' somehow. Using the cmd-prompt, just issue a del BIPSMain.exe deletes it and allows me to rebuild it in QtCreator.

                  JonBJ Offline
                  JonBJ Offline
                  JonB
                  wrote on last edited by JonB
                  #15

                  @nekkceb said in error: cannot open output file:

                  del BIPSMain.exe deletes it and allows me to rebuild it in QtCreator.

                  (Now that we know /f/read-only is not the issue.) Then you are fortunate. Clearly something has it open in some shape or form, in which case Windows does not normally allow to delete the file. So this is surprising but convenient.

                  If you really are sure tasklist/taskman cannot find the executable file still running, and you still want to know what is going on, you could download whatever currently works for Windows which allows you to view open handles in the OS. There used to be a procman and/or procexplorer (or similar names) from sysinternals for this, if they don't work I imagine there are alternatives now.

                  1 Reply Last reply
                  0
                  • Axel SpoerlA Axel Spoerl

                    @nekkceb
                    Is BIPS20 your project / BIPSMain.exe your executable?
                    If so: It's in use by gdbor however the MinGW derivate is called.

                    N Offline
                    N Offline
                    nekkceb
                    wrote on last edited by
                    #16

                    @Axel-Spoerl Agree, you have mentioned that before, but neither BIPSMain nor gdb are found in the Task Manager, or (per @JonB suggestion) the procexp64.exe from sysinternals. Both do appear in the TaskManager when the debug session is running, but both go away when the application exits. So, I am truly at a loss, but knowing I can just delete BIPSMain use the del command in a DOS-box helps a lot.

                    JonBJ 1 Reply Last reply
                    0
                    • N nekkceb

                      @Axel-Spoerl Agree, you have mentioned that before, but neither BIPSMain nor gdb are found in the Task Manager, or (per @JonB suggestion) the procexp64.exe from sysinternals. Both do appear in the TaskManager when the debug session is running, but both go away when the application exits. So, I am truly at a loss, but knowing I can just delete BIPSMain use the del command in a DOS-box helps a lot.

                      JonBJ Offline
                      JonBJ Offline
                      JonB
                      wrote on last edited by
                      #17

                      @nekkceb
                      If you have got procexp64 or similar working, instead of look for executable running it has something which lets you pick a file and find all "open handles" into it. That really ought find dynamicspline.exe with a handle!

                      Or, from error message

                      :-1: error: cannot open output file dynamicspline.exe: Invalid argument.

                      the invalid argument might just indicate that the file "does not exist" or "half exists", is in a funny state so that it cannot be overwritten but can be deleted.... Anyway, that's me out of suggestions now.

                      1 Reply Last reply
                      0
                      • N nekkceb

                        After running my code in debug mode, stop the process and make changes, when I try to rebuild or re-run in the debugger I get this compiler error:
                        :-1: error: cannot open output file dynamicspline.exe: Invalid argument.
                        There is an old post related to this, but in that case, it seems they could find the process still running in the task manager. My application is a windows GUI, not a console application, and I do not see any processes related to it in the task manager that I can kill. The only thing that works for me is to exit QTCreator, then find the build directory (e.g. build-dynamicspline-Desktop_Qt_6_2_8_MinGW_64_bit-Debug) and rename it to something like 'jumk'.. I can then re-start Qt-Creator, re-buiuld and ruyn again. But this is a pain to deal with. AND it just started, i was working fine a few days ago!
                        Windows 10, latest build, Qt Creator 11.0.0, compiling with Desktop Qt 6.2.8 MinGW 64-bit

                        N Offline
                        N Offline
                        nekkceb
                        wrote on last edited by nekkceb
                        #18
                        This post is deleted!
                        1 Reply Last reply
                        1
                        • N nekkceb has marked this topic as solved on

                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved