Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. LNK1168: cannot open blah.exe for writing
Qt 6.12 LTS is out! See what's new in the release blog

LNK1168: cannot open blah.exe for writing

Scheduled Pinned Locked Moved General and Desktop
6 Posts 4 Posters 11.9k 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    I've uninstalled, and reinstalled vs2010 professional and also qt and I still get this problem.
    If I build and run an app, any app, then close the app.
    And then make a change and build and run again, I get the linker error saying it can't open the executable for writing.

    My only option is to wait around for "System" to release it's handle, up to 60 seconds or so, at least, or use cygwin to do a "rm -rf ./dir/executable.exe" to force remove it.

    This is a stupid problem to have that prevents me from doing normal things. Like programming.

    How does everyone else not have this problem?
    I'm running Windows 7 64-bit.

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Moderators Qt Champions 2024 Qt Champions 2022 Qt Champions 2017
      wrote on last edited by
      #2

      Welcome to the forum. Looks like your executable is still running in background. Go to task manager and kill the process. Then it should work fine.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      https://www.pthinks.com

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #3

        Nope. It's not. This happens on every project, even a brand new one where I've added nothing to the project. If I use a file unlocking app, it say "System" is using it, but it won't let go of the handle to it and I can't unlock it.

        1 Reply Last reply
        0
        • hskoglundH Offline
          hskoglundH Offline
          hskoglund
          wrote on last edited by
          #4

          Hi, if it's System, maybe it's some service that's holding your .exe file hostage, googling I found "this suggestion":http://www.sevenforums.com/software/72091-several-minute-delay-when-deleting-any-exe-file.html, open an administrative CMD window and type:
          @
          net start AeLookupSvc
          net start PcaSvc
          @

          H 1 Reply Last reply
          2
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #5

            I must have looked for several hours for a solution online. This is exactly what the problem was. I had this two services disabled. Thank you sooooo much!!!

            1 Reply Last reply
            0
            • hskoglundH hskoglund

              Hi, if it's System, maybe it's some service that's holding your .exe file hostage, googling I found "this suggestion":http://www.sevenforums.com/software/72091-several-minute-delay-when-deleting-any-exe-file.html, open an administrative CMD window and type:
              @
              net start AeLookupSvc
              net start PcaSvc
              @

              H Offline
              H Offline
              houla
              wrote on last edited by
              #6

              @hskoglund
              It works. Thank you !!

              1 Reply Last reply
              0

              • Login

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