Results 1 to 15 of 15

Thread: Project compiling properly without qrc file

  1. #1
    Join Date
    Mar 2010
    Location
    Huntsville
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Project compiling properly without qrc file

    When building QT application on windows for some reason it will not build properly when I include the .qrc resource. If I remove the resources with the .qrc it compiles.

    I have been building on windows XP by going to the directory of QTDIR/bin in command prompt and typing:

    QtDIR\bin>qmake -o Makefile ProjectDir\project.pro


    Not certain to why it works without the resource file, but including it the make returns an error saying "...rcc.exe...file does not exist project.qrc"

    Any help is greatly appreciated.
    -goodz

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Project compiling properly without qrc file

    Where did you place project.qrc?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Mar 2010
    Location
    Huntsville
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Project compiling properly without qrc file

    It's all in the same project folder. No subdirectories are used to store the project's files.

  4. #4
    Join Date
    Mar 2008
    Location
    France
    Posts
    149
    Thanks
    2
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Project compiling properly without qrc file

    Have youd had your resource file to the *.pro file of your project?
    Qt Code:
    1. RESOURCES = myresource.qrc
    To copy to clipboard, switch view to plain text mode 

  5. #5
    Join Date
    Mar 2010
    Location
    Huntsville
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Project compiling properly without qrc file

    If I don't add the *.qrc file to the *.pro it will compile properly. If I add the resource it will throw an error saying this file does not exist.

    On a side note, I'm using QT SDK and if I build for debugging it will compile properly and run the program with the resource included in the project file.

    Thanks again.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Project compiling properly without qrc file

    Please show us the code where you use data from the resource file and paste the contents of your qmake project file.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Mar 2010
    Location
    Huntsville
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Project compiling properly without qrc file

    Sure. I'm currently just trying to compile an example from the book C++ GUI Programming with Qt4, 2nd Edition.

    iconeditor.qrc
    Qt Code:
    1. <RCC>
    2. <qresource>
    3. <file>images/mouse.png</file>
    4. </qresource>
    5. </RCC>
    To copy to clipboard, switch view to plain text mode 


    iconeditor.pro
    Qt Code:
    1. TEMPLATE = app
    2. HEADERS = iconeditor.h
    3. SOURCES = iconeditor.cpp \
    4. main.cpp
    5. RESOURCES = iconeditor.qrc
    To copy to clipboard, switch view to plain text mode 

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Project compiling properly without qrc file

    I meant the code where you are using the data from the resource file.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9
    Join Date
    Mar 2010
    Location
    Huntsville
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Project compiling properly without qrc file

    Doh! I meant to post that.. Sorry.


    It's in the main.cpp.
    Qt Code:
    1. iconEditor.setIconImage(QImage(":/images/mouse.png"));
    To copy to clipboard, switch view to plain text mode 

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Project compiling properly without qrc file

    Looks fine. What happens if you manually run rcc.exe on the qrc file?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  11. #11
    Join Date
    Mar 2010
    Location
    Huntsville
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Project compiling properly without qrc file

    I'm not certain how to do that? Currently I am at work so I can't do it till later this afternoon.

  12. #12
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Project compiling properly without qrc file

    Open the Qt command prompt, cd to the directory where the qrc file is and run rcc.exe iconeditor.qrc
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  13. The following user says thank you to wysota for this useful post:

    goodz (20th March 2010)

  14. #13
    Join Date
    Mar 2010
    Location
    Huntsville
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Project compiling properly without qrc file

    Alright I got it to compile using the qmake; I didn't realize I was doing it wrong. Apologies.

    However, it doesn't build an executable. Am I still doing something wrong?

  15. #14
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Project compiling properly without qrc file

    Please be more specific.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  16. #15
    Join Date
    Mar 2010
    Location
    Huntsville
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Smile Re: Project compiling properly without qrc file

    Nevermind I was confused on how the qmake worked I researched it and the compilation on windows was a bit confusing to me because make wasn 't recognized; however, after a little more research I found that I had to use mingw32-make.

    I really appreciate your help.

Similar Threads

  1. Replies: 1
    Last Post: 3rd December 2009, 23:34
  2. Compiling a project
    By dreamer in forum Installation and Deployment
    Replies: 2
    Last Post: 3rd July 2008, 10:11
  3. Compiling a Qt project in Mac
    By sunil.thaha in forum Newbie
    Replies: 5
    Last Post: 31st October 2007, 06:20
  4. Extra qualification error while compiling the project file
    By amit_pansuria in forum Qt Programming
    Replies: 1
    Last Post: 8th June 2007, 07:56
  5. Compiling Linux project on Mac
    By December in forum Newbie
    Replies: 2
    Last Post: 25th March 2007, 04:25

Tags for this Thread

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.