December 22, 2010

kyleplattner kyleplattner
Lab Rat
199 posts

Move from QML Only Application to Qt Quick Application with C++

Page  
1

I have been developing my application with only QML and JavaScript. I recognize that I need to move to C++ soon and so I started that transition today. I created a new Qt Quick Application and imported all of my QML Files into it. When I try to build the Main.Pro file I receive:

  1. :-1: warning: directory '/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib' following -L not found

  1. :-1: warning: directory '/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib' following -F not found

  1. :-1: error: [copydeploymentfolders] Error 1

Any help would be appreciated. Thanks.

26 replies

December 22, 2010

QtK QtK
Lab Rat
1045 posts

check the console output for more detailed information.

December 22, 2010

kyleplattner kyleplattner
Lab Rat
199 posts

  1. Running build steps for project Main...
  2. Configuration unchanged, skipping qmake step.
  3. Starting: "/usr/bin/make" -w
  4. make: Entering directory `/Users/kp/Desktop/Precision Work/Harvest DU Repository/Main-build-desktop'
  5. g++ -c -pipe -g -gdwarf-2 -Wall -W -DQT_DECLARATIVE_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Qt4.7/mkspecs/macx-g++ -I../Main -I/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/usr/include/QtCore -I/Library/Frameworks/QtGui.framework/Versions/4/Headers -I/usr/include/QtGui -I/Library/Frameworks/QtDeclarative.framework/Versions/4/Headers -I/usr/include/QtDeclarative -I/usr/include -I../Main/qmlapplicationviewer -I. -I../Main -I. -F/Library/Frameworks -o main.o ../Main/main.cpp
  6. g++ -headerpad_max_install_names -o Main.app/Contents/MacOS/Main main.o qmlapplicationviewer.o moc_qmlapplicationviewer.o   -F/Library/Frameworks -L/Library/Frameworks -framework QtDeclarative -L/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib -F/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib -framework QtScript -framework QtSvg -framework QtSql -framework QtXmlPatterns -framework QtOpenGL -framework QtNetwork -framework QtGui -framework QtCore
  7. ld: warning: directory '/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib' following -L not found
  8. ld: warning: directory '/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib' following -F not found
  9. Copying application data...
  10. cp: Repository/Main/../QML: No such file or directory
  11. make: *** [copydeploymentfolders] Error 1
  12. make: Leaving directory `/Users/kp/Desktop/Precision Work/Harvest DU Repository/Main-build-desktop'
  13. The process "/usr/bin/make" exited with code 2.
  14. Error while building project Main (target: Desktop)
  15. When executing build step 'Make'

December 22, 2010

QtK QtK
Lab Rat
1045 posts

Seems to be some issue with the path

cp: Repository/Main/../QML: No such file or directory

Its not able to find the above location, please verify this in your code.

December 22, 2010

kyleplattner kyleplattner
Lab Rat
199 posts

The folder exists… and all that is in my cpp file is this:

  1. #include <QtGui/QApplication>
  2. #include "qmlapplicationviewer.h"
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6.     QApplication app(argc, argv);
  7.  
  8.     QmlApplicationViewer viewer;
  9.     viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
  10.     viewer.setMainQmlFile(QLatin1String("QML/QMLFinal.qml"));
  11.     viewer.showExpanded();
  12.  
  13.     return app.exec();
  14. }

December 22, 2010

QtK QtK
Lab Rat
1045 posts

Check if the folder exists at this path

  1. /Users/kp/Desktop/Precision Work/Harvest DU Repository/Main-build-desktop

December 22, 2010

kyleplattner kyleplattner
Lab Rat
199 posts

It does not. Do I need to copy it in there manually?

December 22, 2010

QtK QtK
Lab Rat
1045 posts

copying it manually will fix it. But you will have to add it in your .pro file or better still put QML into your resource file.

December 22, 2010

kyleplattner kyleplattner
Lab Rat
199 posts

how do I add it to my pro file or resource file? Will doing so negate the need to move it in manually?

December 22, 2010

QtK QtK
Lab Rat
1045 posts
kyleplattner wrote:
how do I add it to my pro file or resource file? Will doing so negate the need to move it in manually?

You can add them as OTHER_FILES to .pro

December 22, 2010

QtK QtK
Lab Rat
1045 posts
kyleplattner wrote:
how do I add it to my pro file or resource file? Will doing so negate the need to move it in manually?

The best option is to use resource [doc.qt.nokia.com]. You can use Qt Creator to add a new resource. Just check the docs for more info.

December 22, 2010

kyleplattner kyleplattner
Lab Rat
199 posts

Seems like this is a bug that needs fixing.

December 22, 2010

kyleplattner kyleplattner
Lab Rat
199 posts

Still having problems with this:

ld: warning: directory ‘/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib’ following -L not found
ld: warning: directory ‘/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib’ following -F not found

Any ideas there?

December 22, 2010

QtK QtK
Lab Rat
1045 posts
QtK wrote:
kyleplattner wrote:
Seems like this is a bug that needs fixing.

No its not a bug. But yes it can be enhanced, so that Qt Creator does it automatically

December 22, 2010

QtK QtK
Lab Rat
1045 posts

kyleplattner wrote:
Still having problems with this:

ld: warning: directory ‘/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib’ following -L not found
ld: warning: directory ‘/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib’ following -F not found

Any ideas there?

Its a warning right. Your app must be compiled properly now.

December 22, 2010

kyleplattner kyleplattner
Lab Rat
199 posts

Added the .qrc and still having this error stop my build:

  1. Running build steps for project Main...
  2. Configuration unchanged, skipping qmake step.
  3. Starting: "/usr/bin/make" -w
  4. make: Entering directory `/Users/kp/Desktop/Precision Work/Harvest DU Repository/Main-build-desktop'
  5. /Developer/Tools/Qt/rcc -name Main ../Main/Main.qrc -o qrc_Main.cpp
  6. g++ -c -pipe -O2 -Wall -W -DQT_NO_DEBUG -DQT_DECLARATIVE_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Qt4.7/mkspecs/macx-g++ -I../Main -I/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/usr/include/QtCore -I/Library/Frameworks/QtGui.framework/Versions/4/Headers -I/usr/include/QtGui -I/Library/Frameworks/QtDeclarative.framework/Versions/4/Headers -I/usr/include/QtDeclarative -I/usr/include -I../Main/qmlapplicationviewer -I. -I../Main -I. -F/Library/Frameworks -o qrc_Main.o qrc_Main.cpp
  7. g++ -headerpad_max_install_names -o Main.app/Contents/MacOS/Main main.o qmlapplicationviewer.o moc_qmlapplicationviewer.o qrc_Main.o   -F/Library/Frameworks -L/Library/Frameworks -framework QtDeclarative -L/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib -F/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib -framework QtScript -framework QtSvg -framework QtSql -framework QtXmlPatterns -framework QtOpenGL -framework QtNetwork -framework QtGui -framework QtCore
  8. ld: warning: directory '/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib' following -L not found
  9. ld: warning: directory '/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib' following -F not found
  10. Copying application data...
  11. cp: Repository/Main/../QML: No such file or directory
  12. make: *** [copydeploymentfolders] Error 1
  13. make: Leaving directory `/Users/kp/Desktop/Precision Work/Harvest DU Repository/Main-build-desktop'
  14. The process "/usr/bin/make" exited with code 2.
  15. Error while building project Main (target: Desktop)
  16. When executing build step 'Make'

Page  
1

  ‹‹ Qt Mobility Declarative Mapviewer Example      Catching QML window close ››

You must log in to post a reply. Not a member yet? Register here!