Results 1 to 6 of 6

Thread: error ":: error: cannot open output file debug\assign2_9.exe: Permission denied"

  1. #1
    Join Date
    Jul 2012
    Posts
    201
    Thanks
    26
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default error ":: error: cannot open output file debug\assign2_9.exe: Permission denied"

    My program ran about three time but when I ran it the forth time it gave the error ":: error: cannot open output file debug\assign2_9.exe: Permission denied" ":: error: collect2: ld returned 1 exit status". I did not change anything in the code. WHATS CAUSING THIS ERROR PLEASE HELP!

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: error ":: error: cannot open output file debug\assign2_9.exe: Permission denied"

    Looks like an executable was already started, but not closed.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: error ":: error: cannot open output file debug\assign2_9.exe: Permission denied"

    Windows locks executables when they are running. When the application is running during a build the linker cannot replace the executable and fails in the fashion you describe.
    "We can't solve problems by using the same kind of thinking we used when we created them." -- Einstein
    If you are posting code then please use [code] [/code] tags around it - makes addressing the problem easier.

  4. #4
    Join Date
    Nov 2012
    Location
    Russia
    Posts
    231
    Thanks
    118
    Thanked 18 Times in 10 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: error ":: error: cannot open output file debug\assign2_9.exe: Permission denied"

    Hello! I have a same problem. I must open every time "Task Manager" for ending task. For example, I created the simple application with a dialog:

    Qt Code:
    1. #include "Dialog.h"
    2. #include <QApplication>
    3. #include <QMessageBox>
    4.  
    5. int main(int argc, char *argv[])
    6. {
    7. QApplication app(argc, argv);
    8.  
    9. app.setApplicationName( "Single Point" );
    10. app.setApplicationVersion( "0.1" );
    11.  
    12. #ifndef QT_NO_OPENGL
    13. Dialog w;
    14. w.show();
    15. #else
    16. QMessageBox::information( NULL, "Error", "OpenGL support required");
    17. #endif
    18.  
    19. return app.exec();
    20. }
    To copy to clipboard, switch view to plain text mode 

    I receive:
    error: cannot open output file debug/SinglePoint.exe: Permission denied

  5. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: error ":: error: cannot open output file debug\assign2_9.exe: Permission denied"

    I assume you are seeing the modal message box, closing that, and having the program fall through to the main event loop. The program stays running in that case. Try this:
    Qt Code:
    1. #include "Dialog.h"
    2. #include <QApplication>
    3. #include <QMessageBox>
    4.  
    5. int main(int argc, char *argv[])
    6. {
    7. QApplication app(argc, argv);
    8.  
    9. app.setApplicationName( "Single Point" );
    10. app.setApplicationVersion( "0.1" );
    11.  
    12. #ifndef QT_NO_OPENGL
    13. Dialog w;
    14. w.show();
    15. return app.exec();
    16. #else
    17. QMessageBox::information( NULL, "Error", "OpenGL support required");
    18. return 1;
    19. #endif
    20. }
    To copy to clipboard, switch view to plain text mode 

  6. The following user says thank you to ChrisW67 for this useful post:

    8Observer8 (15th August 2014)

  7. #6
    Join Date
    Nov 2012
    Location
    Russia
    Posts
    231
    Thanks
    118
    Thanked 18 Times in 10 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: error ":: error: cannot open output file debug\assign2_9.exe: Permission denied"

    Thank you very much for your help

Similar Threads

  1. Replies: 1
    Last Post: 10th March 2011, 15:40
  2. Replies: 9
    Last Post: 20th May 2010, 10:55
  3. Replies: 0
    Last Post: 21st February 2010, 19:09
  4. Replies: 0
    Last Post: 4th November 2009, 11:21
  5. QFile Problem~ "Unknow error" in "open(QIODevice::ReadWrite)"
    By fengtian.we in forum Qt Programming
    Replies: 3
    Last Post: 23rd May 2007, 16:58

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.