{"id":981,"date":"2022-08-30T15:10:24","date_gmt":"2022-08-30T15:10:24","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/problem-about-qmake-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:10:24","modified_gmt":"2022-08-30T15:10:24","slug":"problem-about-qmake-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/problem-about-qmake-collection-of-common-programming-errors\/","title":{"rendered":"problem about qmake-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/ad89fb0303370a178be0223baeff2788?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\noracal<br \/>\nc++ qt plugins qmake mingw32<br \/>\nI have been trying to use QCA (Link) on my Windows PC for a couple of days now, works fine on my linux box, just can&#8217;t get it working with Windows.So i followed all the instructions for installing QCA and then the ossl plugin for QCA. The QCA works fine but for some reason the plugin isn&#8217;t showing up in my Qt Creator nor am I able to use some of the functions in the plugin.I used the qcatool2.exe that comes with QCA to check my plugins usingqcatool2<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/a3328258d0bf39f527b28a69af7b9bc8?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJames Oltmans<br \/>\nqt qmake<br \/>\nI&#8217;m getting a lot of errors because qmake is improperly ordering the boost libraries I&#8217;m using.Here&#8217;s what .pro file looks likeQT += core guiTARGET = MyTarget TEMPLATE = appCONFIG += no_keywords \\link_pkgconfigSOURCES += file1.cpp \\file2.cpp \\file3.cppPKGCONFIG += my_package \\sqlite3LIBS += -lsqlite3 \\-lboost_signals \\-lboost_date_timeHEADERS += file1.h\\file2.h\\file3.hFORMS += mainwindow.uiRESOURCES += Resources\/resources.qrcThis produces the following command:g++ -Wl,-O1 -o MyTarget file1.o file2.o file3.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/129a3ee5e99a6c0858869ac87af9366c?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nOHTO<br \/>\nc++ qt linker cmake qmake<br \/>\nI converted a project from qmake (Initially I used qt-creator to build it on mac\/linux\/win) to cmake and I get a lot of link errors.For example:Undefined symbols for architecture x86_64:&#8221;runion(QtRegion const&amp;, QtRegion const&amp;)&#8221;, referenced from:Q3DView::ReloadLineData() in 3DView.cpp.o&#8221;pafrand(int)&#8221;, referenced from:My .pro file:CONFIG += debug_and_release QT += core gui opengl DEFINES += _TEST1 TEMPLATE = app TARGET = test HEADERS = xxx.h \\xxxxxx.h \\etc.hLibs\/include\/generic\/xxxxxx.hSOURCES = xxxx.cpp \\xxx.cpp \\xxxx.cpp INCLUDEPATH += Libs\/include INCLUD<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/169d41622465f53865aeb3a56dd7df68?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nL123<br \/>\nqt assembly qt-creator qmake<br \/>\nI am using Windows XP, and Newest Qt Creator with QtSDK and the built-in gcc compiler.The question is, how to use full assembly in a C++ Qt Project. I know how to use inline assembly, but I don&#8217;t know how to do non-inline(written in a separate .asm file) full assembly, in a Qt C++ project.Is this possible with a Qt C++ project, and if so, how?EDIT:*pro file TEMPLATE = app CONFIG += console CONFIG -= qtSOURCES += \\calc.Scalc.Ssection .datahello: db &#8216;Hello world!&#8217;, 10helloLen: equ $-hel<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2924d3b08fd49ee6439e6febea831dee?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nHaroogan<br \/>\nc++ qt linker qmake qobject<br \/>\nHere is a sample qt code that is copied from qt documentation site.#include #include #include #include #include #include #include #include #include #include #include #include #include class QSslError;QT_USE_NAMESPACEclass DownloadManager: public QObject {Q_OBJECTQNetworkAccessManager manager;QList currentDownloads;public:DownloadManager();void doDownload(const QUrl &amp; url);QString saveFileName(const QUrl &amp; url);bool saveToDisk(const QString &amp; fileName, QIODevice *data);virtual ~DownloadManager();public slots:void execute();void downloadFinished(QNetworkReply *reply);void sslErrors(const QList &amp; errors);};DownloadManager::~DownloadManager() {}DownloadManager::DownloadManager() {connect(&amp;manager, SIGNAL(finished(QNetworkReply*)), SLOT(downloadFinished(QNetworkR<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/e9ff561e20f74f1ef8115f24af2b03ad?s=128&amp;d=identicon&amp;r=PG\" \/><br \/>\ncmannett85<br \/>\nqt gcc mingw qmake<br \/>\nI am getting linker failures under MinGW, however I cannot see why. This is the link command:g++ -shared -mthreads-Wl,&#8211;out-implib,C:\\Users\\camm\\Syren\\libs\\libSy_polyMesh.a -o C:\\Users\\camm\\Syren\\libs\\Sy_polyMesh.dll debug\/Sy_polyMesh.o debug\/moc_Sy_polyMesh.o debug\/qrc_Sy_polyMesh.o -L&#8221;c:\\Qt\\4.8.4\\lib&#8221;-lglu32 -lopengl32 -lgdi32 -luser32 -LC:\\Users\\camm\\Syren\/libs -lSyren -lglew32 -lboost_system -lQtSvgd4 -lQtSqld4 -lQtOpenGLd4 -lQtGuid4 -lQtCored4The undefined reference errors come from the Syren dll (I should state the command was automatically generated by qmake). The -LC:\\Users\\camm\\Syren\/libs looks malformed to me because of the mix of forward<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/graph.facebook.com\/510746110\/picture?type=large\" \/><br \/>\nLos Frijoles<br \/>\nc++ gcc static-linking qmake boost-regex<br \/>\nI am writing a static library for use in a couple projects using the Qt build system. While the library itself doesn&#8217;t use Qt, the applications using it will use Qt and I wanted to use Qt creator for all of them to keep them in one place.I am using regular expressions in this library and since I was already using boost for smart pointers and a couple other things it made sense to use Boost.Regex as well. The following code appeared initially to compile normally (this is located in some code going into the static library):#include boost::shared_ptr SimulationCore::load(const std::string &amp;fileName) {\/\/go through the list of file loaders and the first one to match gets to load ittypedef std::pair LoaderRecord;boost::shared_ptr loader;BOOST_FOREACH(LoaderRecord loaderRecord, this-&gt;fileLoaders){boost::regex r(loaderRecord.first);if (boost::regex_match(fileName, r)){loader = loaderRecord.second;break;}}\/\/etc&#8230;.However, when linking this library with my testing project (which is a console application), I got the following errors:\/home\/kcuzner\/Projects\/Qt\/Simulate\/Tests\/..\/lib\/\/libEngine.a(simulationcore.o): In func<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/d7547928cf48f2d88c4e2c993dd3bc14?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\njalone<br \/>\nc++ osx shared-libraries qmake<br \/>\ni have a working cmake project that i need to move to qmake.Everything is working but the include of a library called octomap.I installed ( sudo make install ) octomap in system\/usr\/local\/lib\/liboctomap.a \/usr\/local\/lib\/liboctomap.dyliband the headers in \/usr\/lo<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/235b9ceb1ae440e46ad70c469d78eff6?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nEsa<br \/>\nwindows qt-creator qmake<br \/>\nI like the environment, especially as I got hit by the VS MSBuild bug. Basically, QT -= gui core # No qt is usedyet, when I try to compile, I get the following error:c:\\QtSDK\\Desktop\\Qt\\4.7.3\\mingw\\lib\\libqtmaind.a(qtmain_win.o):-1: In function `WinMain@16&#8242;: c:\/ndk_buildrepos\/qt-desktop\/sr<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/a4f835b65aa93df5ade68191fa51fc7c?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser1203141<br \/>\nc++ qt makefile g++ qmake<br \/>\nIm helping on a c++ application. The application is very large and is spread out between different sub directories. It uses a script to auto generate qt .pro files for each project directory and uses qmake to th<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/eea53d740e545170568396e388cd9b42?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nDan O<br \/>\nc++ linker static-libraries qmake<br \/>\nI have two qt .pro files, both using the lib TEMPLATE and staticlib CONFIG. The first library (lets call it &#8216;core&#8217;) is a dependency for the second lib (I&#8217;ll call it &#8216;foo&#8217;). In fact, there&#8217;s a class in foo that ex<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2924d3b08fd49ee6439e6febea831dee?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nHaroogan<br \/>\nqt mingw qmake log4cxx<br \/>\nIt&#8217;s the second day I&#8217;m trying to marry Qt5, MinGW and log4cxx.Even after I&#8217;ve compiled everything successfully, linked apr, apr-util and log4cxx libraries &#8211; gcc gives me a bunch of &#8220;undefined reference&#8221; problems.It looks like different settings were specified during log4cxx compilation (I&#8217;m using ant). Was anyone able to successfully compile and use log4cxx in Qt?[Added later] Environment:log4cxx trunk apr 1.4.6 apr-util 1.5.2 latest MinGW I&#8217;m using QT5 with latest MinGW as a compilerWhat I&#8217;ve done:compiled log4cxx using ant with the following command: &#8220;ant -Dcompiler=gcc -Dfind=false -DLO<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/c3c3e947255e5ab77934b2173f83d908?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nelephantintheroom<br \/>\nc++ qt opencv static-libraries qmake<br \/>\nI&#8217;m currently trying to play around with OpenCV but I ran into a bit of trouble.. I use the qt ide with mingw to compile my applications.My code looks like this: #include \u201chighgui.h\u201dint main( int argc, char** argv ) {IplImage* img1 = cvLoadImage( argv[1] );cvNamedWindow( \u201cExample\u201d, CV_WINDOW_AUTOSI<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/da04c00ca0145075798cc4fb4e8f9635?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nOndrej Fabry<br \/>\nc++ qt cmake qmake wt<br \/>\nI am working on a network management application with Qt and I chose to use Wt for UI, because with it I will not have to deal with any of web parts (PHP, AJAX, HTML\/CSS) and it&#8217;ll be usable on all platforms.I successfully managed to compile and run examples using cmake. Although I am used to QtCreator IDE and qmake I would rather use that for development and compiling. I got stuck trying to compile &#8220;wtwithqt&#8221; example in QtCreator(qmake). I&#8217;ve been searching everywhere for some guide how to compile it with qmake. However I found nothing helpful.Here is my .pro file.testWt.proQT += core QT -= guiTARGET = helloqt CONFIG += console no_keywords CONFIG -=app_bundleTEMPLATE = appINCLUDEPATH += libLIBS += -lwt -lwthttp -lboost_signals -lboost_system -lboost_regexQMAKE_CXXFLAGS += -DNDEBUGHEADERS += \\QtObject.h \\HelloApplication.hSOURCES += \\hello.cpp \\QtObject.cppCompile ouput13:28:15: Running build steps for project testWt&#8230; 13:28:15: Starting: &#8220;\/usr\/bin\/make&#8221; clean -w make: Entering directory `\/home\/nms-development\/QtProject\/testWt-build-desktop-Qt_4_8_1_in_PATH__System__Debug&#8217; \/usr\/bin\/qmake-qt4 -spec \/usr\/share\/qt4\/mkspecs\/linux-g++ CONFIG+=debug CONFIG+=declarative_debug -o Makefile ..\/testWt\/testWt.pro make: Leaving directory `\/home\/nms-develo<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/b5f5c77520b71151e2ea385b2c24b869?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nGuilherme Nascimento<br \/>\nc++ qt mingw qmake hunspell<br \/>\nI&#8217;m trying to use hunspell with QtWebKit in Windows (using mingw4.8)I did download these files:QtWekibt-plugins:https:\/\/github.com\/QupZilla\/qtwebkit-plugins\/hunspell:http:\/\/downloads.sourceforge.net\/hunspell\/hunspell-1.3.2.tar.gzBut I can not properly set the directory location of the hunspell lib.LIBS += -lhunspellI tried adding the main folder of the project, tried to add the folder &#8220;src&#8221;, but both cause the following error:error: cannot find -lhunspellI tried doing this:LIBS += -LC:\/Users\/cr\/Desktop\/QT\/qtwebkit-plugins-master\/src\/hunspellbut this error occurs:C:\\Users\\cr\\Desktop\\QT\\qtwebkit-plugins-master\\src\\spellcheck\\speller.cpp:57:error: undefined reference to Hunspell::Hunspell(char const*, charconst*, char const*)see all errors that occur in the following image:[update 1]I try:LIBS += -LC:\/Users\/cr\/Desktop\/QT\/qtwebkit-plugins-master\/src\/hunspell -lhunspellreturn error:error: [Makefile] Error 3[update 2]I try this:HEADERS = $$PWD\/hunspell\/affentry.hxx \\$$PWD\/hunspell\/affixmgr.hxx \\$$PWD\/hunspell\/atypes.hxx \\$$PWD\/hunspell\/baseaffix.hxx \\$$PWD\/hunspell\/csutil.hxx \\$$PWD\/hunspell\/dictmgr.hxx \\$$PWD\/hunspell\/filemgr.hxx \\$$PWD\/hunspell\/hashmgr.hxx \\$$PWD\/hunspell\/htypes.hxx \\$$PWD\/hunspell\/hunspell.h \\$$PWD\/hunspell\/hunspell.hxx \\$$PWD\/hunspell\/hunzip.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/815ee86e14bbedd4f353cad0680c7be5?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMat<br \/>\nqt linker 32-bit qmake<br \/>\nive been googling the net for hours now and still didnt came up with a solution to my problem, so i hope that you guys can help me. Im trying to add external libraries to my Qt Project (4.7.4 32-bit). I&#8217;m working with the CV-Software Halcon (x86-win32) and want to link the example test project (matching.pro) to the halconcpp.lib and halcon.lib inside the lib folder of Halcon. So i adde<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/91aef7668303115d1faecbc3fb582253?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nBart<br \/>\nc++ wxwidgets qmake<br \/>\nI&#8217;m trying to compile a GUI program based on the wxWidgets libraries. I get a lot of undefined references to &#8220;something&#8221;. I tried to add a few libraries manually on the LIBS variable of QMake without success. How ca<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/14de57d911f1a8f24001f767d3596e3f?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nGrizzly<br \/>\nc++ boost mingw qmake<br \/>\nI&#8217;m tryin to use boost threads on mingw (TDM-mingw, 32bit based on gcc4.6) from qtcreator using qmake. I managed to compile boost 1.4.7 usingbjam &#8211;toolset=gcc &#8211;layout=tagged &#8211;without-mpi &#8211;without-python -j 4 stage &#8211;build-type=completeHowever I simply can not get it to link. I tried to link against several of the libboost_thread libraries created (libboost_thread.a, libboost_thread-mt.a, libboost_thread-mt-dll.a, libboost_thread-mt-s.a), however it always ends up giving me ld.exe: warning: cannot find entry symbol nable-stdcall-fixup; defaulting to 00401000 main.o:main.cpp:(.text.startup+0x76): undefined reference to `_imp___ZN5boost6thread12start_threadE<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/a3b04ae63775ecf10247321bec678fe9?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nrobw<br \/>\nwindows qt linker mingw qmake<br \/>\nI&#8217;m trying to link my QT application to a DLL (libshout), while building for Windows.I&#8217;ve added the appropriate lines to my .pro file:LIBS += -L\/local\/lib -lmp3lame LIBS += -L\/local\/lib -lshout LIBS += -L\/local\/lib -logg LIBS += -L\/local\/lib -lvorbis LIBS += -lwsock32I&#8217;ve also successfully built and installed libshout to \/local\/lib (I&#8217;m using mingw and the gcc-dw2 compiler).However, qmake fails to link successfully. I&#8217;ve pasted the gcc\/make output below. I&#8217;m not even sure it&#8217;s trying to link to the right library (isn&#8217;t .a\/.la a static library?). I&#8217;ve been tearing my hair out for 3 days over this one so any help appreciated :)g++-dw2 -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPP ORT -DQT_DLL -DQT_NO_DEBUG -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CO RE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I&#8217;..\/..\/Qt\/4.6.3\/include\/QtCore&#8217; -I &#8216;..\/..\/Qt\/4.6.3\/include\/QtNetwork&#8217; -I&#8217;..\/..\/Qt\/4.6.3\/include\/QtGui&#8217; -I&#8217;..\/..\/Qt\/ 4.6.3\/include\/QtWebKit&#8217; -I&#8217;..\/..\/Qt\/4.6.3\/include&#8217; -I&#8217;..\/..\/Qt\/4.6.3\/include\/Act iveQt&#8217; -I&#8217;release&#8217; -I&#8217;..\/..\/Qt\/4.6.3\/mkspecs\/win32-g++&#8217; -o release\/qrc_resources .o release\/qrc_resources.cpp g++-dw2 -enable-std<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2643d00ac06c7aa82f1bd870f9c5cb64?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nAymeric Larose<br \/>\ngcc make static-libraries qmake portaudio<br \/>\nI&#8217;m trying to use the static library from portaudio by putting &#8220;libportaudio.a&#8221; in my project after compiling portaudio (by doing &#8220;.\/configre &amp;&amp; make&#8221; and then i took the file in lib\/.libs\/).As this is a qt project, my Makefile Lib line look like this: LIB<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/26d7b31da814155de274bc19f5c5f82f?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMike<br \/>\nc++ qt windows-7-x64 qmake undefined-reference<br \/>\nOk. I just installed Qt from: http:\/\/qt.nokia.com\/downloads using the online installer. I have MinGW, make, gcc and g++ installed. I also added variables QMAKESPEC and QTDIR and also appended the directories in MinGW and Qt to the PATH variable. Whe<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/8br6L.png?s=32&amp;g=1\" \/><br \/>\nkarlphillip<br \/>\nc++ qt opengl opencv qmake<br \/>\nI have compilation problems when I&#8217;m using the createOpenGLCallback. I&#8217;ve got the follow error message:undefined reference to `cv::createOpenGLCallback(std::basic_string<\/li>\n<\/ul>\n<p id=\"rop\"><small>Originally posted 2013-11-09 23:10:32. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>oracal c++ qt plugins qmake mingw32 I have been trying to use QCA (Link) on my Windows PC for a couple of days now, works fine on my linux box, just can&#8217;t get it working with Windows.So i followed all the instructions for installing QCA and then the ossl plugin for QCA. The QCA works [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-981","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/981","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=981"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/981\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=981"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=981"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=981"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}