Help with using Qt 5.3.0 REALLY CONFUSED!
-
I have just started trying to learn using Qt for embedded Linux development and I am trying to run the provided examples and demos by Qt on the TI Sitara AM335x board from Qt Creator. I used the online installer to install Qt on Ubuntu and then using the documentation provided on TI http://processors.wiki.ti.com/index.php/Sitara_Linux_Training:_Hands_on_with_QT I have managed to establish remote connection with Sitara and run a basic hello world program and webview using tabs as documented in the link.
While trying to run the sample demos or examples provided , i configure the projects with the same settings I used for the above projects. On building and deployment they never seem to run. One of the errors was
@
/home/siddarth/Qt/Examples/Qt-5.3/widgets/widgets/calculator/button.cpp:41: error: QtWidgets: No such file or directory
@I copied the QtWidgets folder from the lib in the Qt folder to the libraries in qtopia folder in Ti Sitara location that were being used by GDB and the GCC. I also copied the Qt Core fodler but now I am getting the error
@
/opt/ti-sdk-am335x-evm-07.00.00.00/linux-devkit/sysroots/cortexa8hf-vfp-neon-3.8-oe-linux-gnueabi/usr/include/qtopia/QtCore/qglobal.h:1030: error: #error “You must build your code with position independent code if Qt was built with -reduce-relocations. “ “Compile your code with -fPIC or -fPIE.”
@Can someone please help me as to what i am doing wrong!?
-
Hi and welcome to devnet,
It looks like you are mixing Qt 4 and Qt 5 somewhere
-
I believe I'm running into the same problems! I just downloaded 5.3 about 2weeks ago. I have been reading all kinds of tutorial info, both here on site and from several books (earlier editions of QT). When I write the coding according to the tutorials found here on site and try to run them, all I get are errors!! GGggggrrrrr!!!
While I'm new, I have found that most of the tutorials are for earlier versions of QT but do not say so. It is VERY VERY FRUSTRATING to enter in the coding and then find out, through errors, that it is not up to date for the QT Version being used!
It is also annoying to ask questions on the forum that seem stupid, because after reading how to do something, the answer is you're using an old version and using the wrong syntax.
What's the chances of starting a tutorial section where ALL the examples and coding applies STRICTLY to a specific version like QT 5.3? -
There are tutorials and examples in Qt's own documentation that you can use
-
That's what I find confusing. Most of the tutorials and examples I've looked up don't have a Qt version listed. On the few I have found that say 5.0 or 5.3, I have put in the coding, checked it METHODICALLY to insure correctness, and wham, does not work! The last one I did apparently needed a @ Qt += widgets @ in the .pro file which was not mentioned.
Am I looking in the wrong place on this site? I really like the program and I'm trying really hard to learn it, but this is frustrating!!
Bob
-
This site is community driven and was up before Qt 5, so you will find examples that where written with Qt 4 in mind. However, if you are using a recent version of Qt Creator, the QT += widgets line is handled automatically for you when creating a new project.
It's one of the major modification between Qt 4 and 5, the widgets have now their own module. In doubt you have the porting guide that can help you spot differences.
-
Hi Bob,
There were big changes between Qt 4 and Qt 5, so tutorials that worked for Qt 4 might not work in Qt 5 unless you modify it.
However, within Qt 5, these big changes don't occur. A tutorial that works for Qt 5.0 will also work with Qt 5.3.
[quote author="BOHICAMAN" date="1403548831"]That's what I find confusing. Most of the tutorials and examples I've looked up don't have a Qt version listed.[/quote]Where did you look for these tutorials?
I recommend following the "official documentation":http://qt-project.org/doc/qt-5/index.html (make sure that the URL starts with "qt-project.org/doc/qt-5). Here is the official Getting Started guide for widgets: http://qt-project.org/doc/qt-5/gettingstartedqt.html
If you follow the documentation that was installed along with your copy of Qt, you should have a better experience.
-
Thanks!! Greatly appreciate your response. I will download and study both sets of documents. Hopefully they will remedy my "what version" problem!
Bob