Please nominate your Qt Champions for 2021!

Failed to start program. Path or permissions wrong?

  • I built the project. Bulding succeded but the executable file is not there so i receive the message 'Failed to start program. Path or permissions wrong?' Naturally the programm cannot be executed because it is not created but Qt tells that the build succeded. I use linux Mint Nandia.
    The project is already built and work in another directory, but i made changes and i want to rebuild it.
    Please help. If you need further information i can tell you..

  • Moderators

    Oh, do tell us please :)

    Have you moved the project together with .pro.user file by any chance? If so, first delete the .pro.user file, then open the project again.

    If that is not the case, I would start by checking your .pro file, especially whether DESTDIR is set, or some INSTALLS stuff maybe. Also, check what happens when you toggle Shadow building in project options.

  • i deleted the .pro.user and made the configuration from the begining and still the same error. i don't want to play with shadow building because i don't want to loose my backup. another idea?

  • Moderators

    Check console output when doing a full rebuild - maybe linker has problems in writing the output file?

  • Thanks for your fast answer.. Where can i find console ?

  • Moderators

    Hit Alt-4 in Qt Creator, or click on "Compile Output" button at the bottom of Qt Creator's window.

  • Yes i get an error there..
    make[1]: Entering directory ....Desktop_Qt_5_0_2_GCC_64bit-Debug' make[1]: Nothing to be done forfirst'.
    make[1]: Leaving directory `...Desktop_Qt_5_0_2_GCC_64bit-Debug'

    i hided the full path for obvious reasons.. :)

  • Moderators

    That looks like shadow building in works.

    "Nothing to be done for 'first'" is standard make message. It's not an error as such - usually it means that the project is already built and there is no need to compile again.

  • heh that's the problem, the project did not create and executable... in the folder there are only 3 files Makefile Makefile.debug and Makefile.release..

  • Moderators

    Delete those makefiles.

    But we're running in circles here, I'm afraid. I'm sure I've run into a similar problem before, but I don't remember what was the solution. We're probably missing something obvious.

  • Yes i know that we are making circles. I will try now removing these make files.. please remember :)

  • i made a backup of whole project and remove shadow build and works. but i don't think that is a solution.
    it is a semisolution i think..;)

  • it was not a solution finally. the project always executes the old executable file. the problem is that Qt builds successfull but the executable file is not created...

  • Lifetime Qt Champion

    in this case, are you sure your project is setup correctly ? Could you share the pro file ?

  • This may be similar problems as I had lately. However, I am on Windows 7 with creator 2.6.
    I have a rather large project based on subdirs with some libs shared by a couple of applications.
    I noted that changing the source with some debug statements and in the debugger there was no influence on what I had changed. As I found out later Qt creator compiled and linked always the release version only for this particular application. I did the whole bucket of things rebuild, clean and build (as separate steps) also at least some partly "Run qmake" until I found out what happened. In my case it was cured by "Run qmake" for the whole subdirs project. Suddenly the debug build was created.
    It sounds a bit weird, but I assume Qt creator somehow looses track when switching between release and debug modes. IMO not really a logical behaviour, but I do not know what is actually happening in qt creator.

    Especially if you have a complex project, try "Run qmake".

  • Yes it's very weird.. I am thinking to switch it in windows for better luck. I run linux on virtual machine, does this make any difference ?

  • [quote author="clouca" date="1367858735"]Yes it's very weird.. I am thinking to switch it in windows for better luck. I run linux on virtual machine, does this make any difference ?[/quote]
    Do not know. I have not used Qt creator lately on a virtual machine.

    [quote author="SGaist" date="1367847901"]Hi,
    in this case, are you sure your project is setup correctly ? Could you share the pro file ?[/quote]
    at clouca: that is an option. Maybe someone sees an issue.

    Do you have a complex project?

  • Yes it is a project with 5 subfolders..

  • Lifetime Qt Champion

    Since it's a subfolder project, how do you setup your DESTDIR variables ?

  • Thanks all of you for your answers. SGaist I will check tomorrow and tell you.

  • Hi
    I had this problem in old versions of QtCreator. As far as I remember it's a bug, but is was supposed to be solved in latest version, I believe. Do a google search, you will find similar threads some wich are alreay solved.

  • john_god john_god i didn't found something simillar
    my project was created in qt 4.7 32(bit) and i am now running Qt 5.0 (64bit) if that can help..

  • [quote author="clouca" date="1367907957"]john_god john_god i didn't found something simillar
    my project was created in qt 4.7 32(bit) and i am now running Qt 5.0 (64bit) if that can help..
    Those are the versions of Qt lib. Qt creator has currently version 2.7. A Qt creator installed with Qt 4.7 is fairly old.
    How did you install Qt 5? Which exact Qt5 version are you using? Did you replace also the Qt creator at that time?

  • I use Qt Creator 2.7.0. Based on Qt 5.0.2. No i didn't replace anything, i moved to a new pc to startover the project.

  • as i have noticed i have wrong path. but in the correct path the executable does not exists. firstly how can i change the path ?

  • Lifetime Qt Champion

    Where does that path come from ?

  • I don't know what to do i am desperated...

  • Lifetime Qt Champion

    Do you set the DESTDIR in your pro files ? If yes where do they point to ?

    Otherwise can you post (i.e. pastebin) your pro files ? So we can see if the problem lies with them or if we can eliminate that as a cause.

    Did you take a look at the build panel to see where things are built ?

  • no i don't have DESTDIR but in my project there is SUBDIRS : which points to subdirectories.. maybe this is the problem ?

  • Lifetime Qt Champion

    As I said before, without seeing anything from your project I can only make guesses.

    If you really can't share anything. The only solution I see for you is to start from scratch a new project using the subdir template with only one sub directory that contains a project for a hello world app. Make it build and run and once that is good. Take one by one the pieces of your other project and integrate it in the one building and running until everything works.

  • What do you want to share from my project ?

  • Lifetime Qt Champion

    As already mentioned, seeing the pro files could be useful

  • Ok.. just o moment to finish what i'm doing now..

  • I fixed the problem but i don't know how solved exactly.. I played with settings on kits...

  • I've run today into same problem.
    It appears a bit weird.

    When this error occurs, the exe has the Windows' typical blue/yellow shield over the icon.
    Interestingly, this can be changed only by changing the name of the executable in the .pro file(TARGET=).

    As a first assumption I would say: If it contains the name of one of the parent directories this problem pops-up.

    I run QtCreator 2.4.1on Win7.

    Any comment on this?

  • Lifetime Qt Champion

    Did you stop your application before rebuilding ?

  • yes.

    Actually, I've did rebuilds after each name change.

    First I tought about 8 char name, but was not the case.

    My structure is something like:

    When I used 'AstDispatch' or 'Ast-Dispatch' or 'AstDispatchX' the executable was marked with the shield.
    If I named it AstDispatceh' it was ok.

  • That shield is typically associated with User Access Control. As a test I would turn off UAC and see if your default .exe name works. Alternately (as a test only) you could try going to the properties and the security tab and see if Run as Administrator is checked. This won't be a fix though because I would suspect that if you check or uncheck it, it will go back to what it was when you rebuild. I once had a similar intermittent problem with Visual Studio. I believe my fix was to disable indexing on my development folder.

  • I understand the meaning of the shield.
    My question is not what the shield means, but why this is related to the name of the file.

    I don't want to remove the effect, but understand the cause.
    Is this related to OS - Win7 decides this is a vulnerable exe based on the name? or to compiling - Qt marks the file differently?

    in poor wording: the shield causes that the OS asks you if you would like to run this unsigned exe. When started from the designer it causes to fail due security reasons.

  • Moderators

    Windows is automatically marking some files based on their names (especially if they contain something like "setup" or "install").

Log in to reply