Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Cannot write to file: Unknown error after clean install of Qt
Forum Update on Monday, May 27th 2025

Cannot write to file: Unknown error after clean install of Qt

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
18 Posts 7 Posters 2.9k Views
  • 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.
  • johnratiusJ johnratius

    I am using Qt Open Source and the default installer. I am trying to install the latest version and every time, the installer says it installed successfully without any errors but when I launch Qt Creator, I get this error:
    Image of the error

    This error pops up in some random places. When I try to create a new project it appears. Sometimes I get this error:
    Image of second error

    What I have tried:
    I already reinstalled 3 times. I used Revo-Uninstaller and cleaned up registry and other file references.
    I gave full permissions to my AppData folder and all folders/files inside.
    I tried running the installer with Admin privileges twice. I also gave full permissions to any other folders I thought Qt would use. (ProgramData, C:\Qt)
    I added C:\Qt\Tools\QtCreator\bin and C:\Qt\Tools\QtCreator\bin to my system's paths.

    Other errors I get is just plain freezes/crashes when clicking buttons or trying to open projects. I have no idea what's going on and why it's not working, let me know if you need other info from me.
    I would like to get Qt up an running soon hopefully, but I don't know how to fix whatever is wrong with it. Thanks for your help in advance.

    (I am also running this on my Windows 10 Pro laptop)

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

    @johnratius
    I would concentrate just on the path it reports. Have you tried, outside of Creator, to create exactly that file successfully?

    1 Reply Last reply
    0
    • johnratiusJ Offline
      johnratiusJ Offline
      johnratius
      wrote on last edited by johnratius
      #3

      @JonB
      That file already exists. I checked it's permissions and the system and user has full access to that file. I uploaded the contents of the file here: toolchains.xml
      I am not sure what's wrong with my computer or installation.

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

        You could try creating a new user in your Windows 10, log out and log in as that new user and start Qt Creator.
        (Note: this is a just a guess :-)

        1 Reply Last reply
        0
        • johnratiusJ Offline
          johnratiusJ Offline
          johnratius
          wrote on last edited by
          #5

          @hskoglund
          I tried a new user and it installed and runs correctly. Since I installed it to the C:\ directory, I tried running it on my normal account and I continue to get the errors. Any suggestions?

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

            The easiest is just to nuke the whole directory C:\Users\John\AppData\Roaming\QtProject
            (equivalent to creating a new user in Windows 10 from Qt Creator's point of view)

            Note: perhaps zip the directory first in case there are some settings you want to resurrect from the nuking

            1 Reply Last reply
            2
            • johnratiusJ Offline
              johnratiusJ Offline
              johnratius
              wrote on last edited by
              #7

              I tried that before and I kept getting the error. I ended up just reinstalling windows for a clean installation. It now works fine.

              1 Reply Last reply
              0
              • johnratiusJ Offline
                johnratiusJ Offline
                johnratius
                wrote on last edited by
                #8

                Reinstalling Windows was a temporary fix. I installed all my regular programs back and tried to run Qt Creator and got the same errors.

                mrjjM 1 Reply Last reply
                0
                • johnratiusJ johnratius

                  Reinstalling Windows was a temporary fix. I installed all my regular programs back and tried to run Qt Creator and got the same errors.

                  mrjjM Offline
                  mrjjM Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on last edited by
                  #9

                  @johnratius said in Cannot write to file: Unknown error after clean install of Qt:

                  regular programs

                  Hi does these regular programs include any kind of anti virus software ?

                  1 Reply Last reply
                  1
                  • johnratiusJ Offline
                    johnratiusJ Offline
                    johnratius
                    wrote on last edited by johnratius
                    #10

                    @mrjj Only Malwarebytes. But I have already disabled it and tried running it before and the issue still arises. When Qt Creator ran successfully after my clean Windows re-install, Malwarebytes was already installed. Since then, other software such as Microsoft Visual C++ Redistributables were installed as well as OBS, Git, MS Office, music software, etc... I even disabled windows Firewall and still got the errors. I don't think it's an anti-virus problem...

                    I should add, though I have not used Qt Creator much and I used to program Qt in other IDEs, when creating a project now, all Qt includes are not recognized or not found. In any new or old project. I have no idea why Qt Creator can't read the path to bin. (adding to path to system variables has not worked, though I have not tried adding every bin directory, just the ones I use)

                    I found these:
                    https://stackoverflow.com/questions/7530111/qt-creator-cannot-create-file-qtcreator-xml-mac/8820193
                    https://askubuntu.com/questions/253785/cannot-overwrite-file-home-baadshah-config-qtproject-qtcreator-toolchains-xml

                    but I am not familiar enough with Linux to translate these commands over to test them. I also installed Qt with all the correct permissions I thought it needed which worked for a little while.

                    1 Reply Last reply
                    0
                    • johnratiusJ Offline
                      johnratiusJ Offline
                      johnratius
                      wrote on last edited by
                      #11

                      Would it be possible that other software on my computer conflicts with Qt?

                      mrjjM 1 Reply Last reply
                      0
                      • johnratiusJ johnratius

                        Would it be possible that other software on my computer conflicts with Qt?

                        mrjjM Offline
                        mrjjM Offline
                        mrjj
                        Lifetime Qt Champion
                        wrote on last edited by
                        #12

                        @johnratius
                        Hi
                        yes but its normal scanner software or other file checkers as Creator has its on profile etc so
                        not sure how another app could prevent it from writing etc.

                        Also it worked when windows was more clean and then it stopped so it does seems like something you installed after does something but I have no guesses.

                        1 Reply Last reply
                        1
                        • johnratiusJ Offline
                          johnratiusJ Offline
                          johnratius
                          wrote on last edited by johnratius
                          #13

                          So after many days weeks of checking each program I install after a reset, I found the perpetrator.

                          I have a bin directory in my C drive containing a script with a bunch of doskey commands so I can use common bash commands.

                          Upon adding this script with my registry script:

                          Windows Registry Editor Version 5.00
                          
                          [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Command Processor]
                          "AutoRun"=hex(2):43,00,3a,00,5c,00,62,00,69,00,6e,00,5c,00,73,00,74,00,61,00,\
                            72,00,74,00,75,00,70,00,2e,00,62,00,61,00,74,00,00,00
                          

                          Qt Creator throws this error.

                          What the above script does is this and only this:

                          registry editor pic
                          Makes sure the Command Processor folder is there, adds an AutoRun REG_EXPAND_SZ with the value to my script C:\bin\startup.bat

                          From what I remember, I can do this manually and Qt still crashes on start.

                          I do love my bash commands and would like to have them with Qt Creator. Is this a bug? If there is a workaround, that would be amazing.

                          Time to restore my computer to before I installed the script sigh...

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

                            Hi, I think the culprit might be one of the bash commands in that startup.bat file causing a name collision.
                            First guess would be: is one of those bash commands called toolchains?

                            1 Reply Last reply
                            3
                            • johnratiusJ Offline
                              johnratiusJ Offline
                              johnratius
                              wrote on last edited by
                              #15

                              That would be my guess too but no. This is all I have in my bash commands.

                              @echo off
                              cls
                              doskey ls=dir /W $*
                              doskey touch=copy NUL $* 1>NUL
                              doskey up=cd.. $*
                              doskey ip=ipconfig $*
                              doskey rm=del /Q /F $* > NUL
                              doskey rmd=rmdir /Q /S $*
                              doskey clear=cls
                              cls
                              

                              Note: This the above runs whenever I start a CMD window the way the registry script is installed.

                              1 Reply Last reply
                              0
                              • F Offline
                                F Offline
                                fifthfloor
                                wrote on last edited by
                                #16

                                I installed Qt 6.0.0 today and I'm getting the same error on every startup of Qt Creator 4.14.0.
                                There was Qt 5.15 with a previous version of QtCreator installed, which I removed before.
                                Deleting the complete directory \users...\QtProject did not help.

                                I don't have a script like @johnratius nor a registry entry like this.
                                But I found a similar report for a ubuntu environment here:

                                https://bugreports.qt.io/browse/QTCREATORBUG-20880

                                The conclusion there is that some third party library has an influence.

                                1 Reply Last reply
                                0
                                • M Offline
                                  M Offline
                                  maxim2511
                                  wrote on last edited by
                                  #17

                                  I have this same problem. On Gentoo linux I have installed Qt 6.3 on seperate disk, and from there I am launching app, and that disk is not part of the system, and I have privileges problem on folders and files, every time when folder or file was updated, they was changing owner rights, and I need go step by step and rewrite rights to be on my user account, and ( to be sure that everything go wright ) I set files accessible to everyone. Read, write, and execute.

                                  1 Reply Last reply
                                  0
                                  • B Offline
                                    B Offline
                                    BlasQt
                                    wrote on last edited by
                                    #18

                                    Same problem here, running Qt Creator 15.0.1 on windows 11

                                    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 Extensions
                                    • Unsolved