Compiling in Qt Creator on OS X: "dyld: Library not loaded" - qt

I've searched around and can't find an answer to this. I'm trying to compile some examples in Qt Creator (Qt 5.0.1) on Mac OS X Lion, and it keeps giving me errors. Here's the full error:
dyld: Library not loaded: /Users/bld.qt/bamboo-agent-home/xml-data/build-dir/DQTC-RELEASE5LGPL-OSX106/______________________________PADDING______________________________/lib/QtWidgets.framework/Versions/5/QtWidgets
Referenced from: /Users/<bleh>/Qt5.0.1/5.0.1/clang_64/examples/widgets/widgets/codeeditor-build-Desktop_Qt_5_0_1_clang_64bit-Debug/codeeditor.app/Contents/MacOS/codeeditor
Reason: image not found
Anyone know any fixes?
Thanks

Looks like it can't find the QtWidgets library. Add this to your .pro file
qt += widgets
Based on the transition from Qt 4 to 5 where QtWidgets are a Separate Module

Related

Qt 6.4.1, no Qt6Multimedia folder present - CMakeLists.txt can't find the module

I am using Qt 6.4.1, and in QtCreator I am trying to import the Qt6 Multimedia module, but I get the following error:
The error says "Found package configuration file: C:/Qt/qt/6.4.1/mingw_64/lib/cmake/Qt6/Qt6Config.cmake but it set Qt6_FOUND to FALSE so package "Qt6" is considered to be NOT FOUND. Reason given by package: Failed to find required Qt component "Multimedia". Expected config file at "C:/Qt/qt/6.4.1/mingw_64/lib/cmake/Qt6Multimedia/Qt6MultimediaConfig.cmake" does NOT exist"
It appears my Qt version does not have the folder in my cmake directory:
Why is this? Have I missed something/got something wrong or is there no support for the Multimedia module in Qt6.4.1? What can I do to import this module? Thanks in advance.
You need to check QtMultimedia in QtMaintenanceTool when you are installing Qt. See the screenshot:
If it is not available for your compiler, then you have no other option than build Qt with QtMultimedia on your own.

Unknown module(s) in QT: 3dstudioruntime2

I installed qt creator and qt 3dstudio with the qtOnline installer for linux. I want to build a project using these two packages. I design my project in qt3dstudio and then I use qtcreator to code the logic of the program. But I cannot import qt3dstudio module into the code.any suggestions??
I need to get this going on ubuntu 16.04LTS. I couldn't find anything useful on the web about the problem. I did try to build qt3dstudio but some of the dependencies caused my ubuntu desktop to stop working and I had to reinstall ubuntu.
QT modules in my .pro file:
QT += widgets qml quick gui 3dstudioruntime2
and when I hit build I get the following error:
Unknown module(s) in QT: 3dstudioruntime2

How to build shared libraries of qwt - how to prevent qmake from linking to QtCore and QtGui

I have the source code of qwt and while making shared libraries of qwt , I want to prevent qmake from linking to QtCore and QtGui
Looking forward to guidance
You can't. qwt uses Qt, so there's no way to build it as a shared library without linking it to QtCore/QtGui. To import Qt's symbols, it has to be linked to QtCore/QtGui import libraries - that's how qmake sets it up. Otherwise, the linker would have to emit a qwt library with a whole bunch of unresolved symbols, and it simply wouldn't work - it'd crash on the first reference to a Qt symbol, given that said symbol would have an address of zero.
To build it without linking it to Qt it has to be built as a static library. It will be then linked to Qt when the executable is linked.

"undefined reference" while building webkitwidgets module into self-compiled Qt5 due to missing ICU libraries?

I have built Qt 5 libs from source into Ubuntu 12.04 and made a Qt test app. In .pro file I have written QT += core gui webkitwidgets to use Qwebview in my test project.
But when I run qmake into Qt creator then it gives me error:
Unknown module(s) in QT: webkitwidgets
I think webkit or webkitwidgets module is not build by source when I built Qt 5 libs from source.
So I have build qtwebkit or webkitwdgtes module from source as per below.
cd qtwebkit
qmake
make -jX
where X is number of cores * 2 + 1
But when I run make command then I got below errors.
StringImpl.cpp:(.text+0x64ad): undefined reference to u_strToUpper_51'
StringImpl.cpp:(.text+0x6636): undefined reference to u_toupper_51'
DatePrototype.cpp:(.text+0x328): undefined reference to udat_open_51'
DatePrototype.cpp:(.text+0x366): undefined reference to udat_close_51'
JSGlobalObjectFunctions.cpp:(.text+0x99f): undefined reference tou_charType_51'
StringImpl.cpp:(.text+0xa00): undefined reference tou_foldCase_51'
CollatorICU.cpp:(.text+0x1f1): undefined reference to ucol_getLocaleByType_51' CollatorICU.cpp:(.text+0x20f): undefined reference toucol_getAttribute_51'
CollatorICU.cpp:(.text+0x25b): undefined reference to ucol_open_51'
CollatorICU.cpp:(.text+0x27f): undefined reference toucol_open_51'
CollatorICU.cpp:(.text+0x2a4): undefined reference to ucol_setAttribute_51'
and many more such undefined reference errors.
Also I have found that qtwebkit module uses ICU library (which are missing at my machine).
So how can I build ICU libraries into Ubuntu so that qtwebkit module can take reference of complied ICU libraries and I can able to fix these reference error and build qtwebkit successfully.
I have fixed a similar error by removing ICU libraries from Qt/lib folder.
If there is another version of ICU installed to os libs, it makes conflict.
Did you try this?:
sudo apt-get install libqt5webkit5-qmlwebkitplugin libqt5webkit5.
RESOURCES += \
resources.qrc
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets webkit webkitwidgets
However, and even when I made it work for my project, webkit gives more issues down the road, like being missing from the UI toolbar or not compiling at the time to publish your programme to the Store. I would suggest to look into alternative solutions like
QWebEngineView.
Try installing the package with apt-get:
sudo apt-get install libqt5webkit5-dev

Building Qt 4.8 with mingw fails - "I couldn't find a pro file for QtCore module"

I'm trying to re-build Qt 4.8.0 in Windows statically. I'm following the documentation here: http://doc.qt.nokia.com/4.8-snapshot/deployment-windows.html. After typing config -static in a mingw terminal at C:\QtSDK\Desktop\Qt\4.8.0\mingw, I get the following error:
Running syncqt...
I couldn't find a pro file for QtCore module
syncqt failed, return code 2
I've been looking all over and can't figure out where to go from here! IMO the Qt documentation is not very good in this regard.
Thanks!
Marlon

Resources