QT creator 4.9.2 with ROS plugin - qt

I am using QT creator 4.9.2 with Ros plugin
I have the following problem. I can compile a catkin project inside QT creator fine but for some reason I get loads of Lexical or preprocessor errors on all my header file includes (also ones like iostream). I also have no intellisense. Again it all compiles fine but I can't click on include files or have any intellisense for this particular project
The weird thing is that another catkin project builds fine with the same QT Creator version but doesn't have any of these problems and i have set it up in what I believe is the exact same way but obviously they are different CmakeList.txt files for each project.
I've tried cleaning the project and rebuilding but no joy. Any ideas on what I could try to resolve?
Thanks

Related

Impossible to deploy Qt applications

I am having serious troubles in trying to deploy my new application built with Qt. The program runs fine when started from Qt Creator (all builds: debug, profile, release), but it crashes when started by double clicking on the .exe. An error dialog pops up with the following message:
?defaultTypeFor#QTimer##CA?AW4TimerType#Qt##H#Z could not be located
in the dynamic link library
C:\Users\SDT1\Documents\Scanner\Scanner_deploy\Scanner.exe
I am using Qt 5.8.0 and I am building the project with MSVC2015_64 bit. I am using windeployqt.exe from
C:\Qt\5.8\msvc2015_64\bin
to dinamically link the Qt libraries.
This problem started happening since I moved from the old connect syntax (with the macros SIGNAL and SLOT) to the new one with function pointers. I also started using QTimer::singleShot instead of QMetaObject::invokeMethod, and not surprising the error involves QTimer. However, the program works just fine from inside Qt Creator and I can't figure out where the issue is, since I am using windeployqt to get the right dlls.
Also, why my .exe is referred to as "dinamic link library" in the error message? It's an .exe!
Ok I solved the issue, but I'm still not sure what was going wrong: my Path variable was pointing to the folder of Qt version 5.7 (the only other version I have). I changed it to 5.8, rebooted and redeployed and it DIDN'T work. Then, I deleted the build folder, rebuilt and re-deployed and it DID work. So, the problem was with the build.
I don't know how this can happen. I changed back the Path to Qt 5.7 and rebooted to make some tests. The problem appeared again, but I don't understand how the Path affects the build. Despite having Qt 5.7 in the Path, in Qt Creator the Compile Output shows all the Qt stuff pointing to the 5.8 folder (qmake.exe, uic.exe, include folders, ...). There is no reference to version 5.7. Only jom.exe is not from the Qt 5.8 folder, since it is in the Qt Creator folder. Maybe it's it that loads something from Qt 5.7, by looking at the Path? Who knows......

Deploying Qt C++ Application from Visual Studio qwindows.dll error

I've been googling for a solution to this issue and although I've found many people sharing my problem none of their solutions work for me.
I wrote a C++ application using Qt framework using Visual Studio 2010. I built and ran the application in "Release" mode from Visual Studio without issue, but when I copy that exe from the Release folder to a new destination (pretend its a new PC) it fails to run providing this error:
---------------------------
TestApplication
---------------------------
This application failed to start because it could not find or load the Qt platform plugin "windows".
Available platform plugins are: windows.
Reinstalling the application may fix this problem.
Within the executable directory I have the following file structure:
./TestApplication.exe
./libGLESv2.dll
./Qt5Core.dll
./Qt5Gui.dll
./QtWidgets.dll
./platforms/qwindows.dll
./qt.conf
All dll files were taken from the 5.0.0 build of Qt in the Qtbase folder where the libraries reside.
The qt.conf file is:
[Paths]
Plugins=.
Without it, the launch error is the same except it says "minimal" and "offscreen" are available platforms as well.
For all other people experiencing this error it seemed to be solved by creating the platforms folder and putting in the qwindows.dll. But doing that myself doesn't change any behavior.
Is there something I've done wrong? Perhaps my method of generating the .exe in the first place is wrong?
If you are using libGLESv2.dll, then you must include libEGL.dll, too.
You can't see that in depends.exe, don't know how the Qt developers managed to hide this.
If your Qt is out of the box, then both Dlls are necessary even if you are not using OpenGL.
Also, if your Qt is out of the box, you need to include also the three ic*.dll, which contain information for Unicode handling.
You can see which DLLs are needed by looking at which ones are invoked when running Debug (F5) in Qt Creator.
=Carl
The release is likely missing a library/plugin or the library is in the wrong directory and or from the wrong directory.
Qt intended answer: Use windeployqt.
Qt comes with platform console applications that will add all dependencies (including ones like qwindows.dll and libEGL.dll) into the folder of your deployed executable. This is the intended way to deploy your application, so you do not miss any libraries (which is the main issue with all of these answers). The application for windows is called windeployqt. There is likely a deployment console app for each OS.

Debugging a version of Qt Creator and plugins all built from source

My goal is to be working on / debugging qt creator plugins and, maybe, editing / debugging qt creator source code. Towards this end I've tried a couple of things:
Downloading source for the qt sdk and qt creator, compiling each, and then making a qt creator plugin project and hooking everything together by hand. This got complicated pretty quickly (I tried to keep my plugin project outside the qt-creator/src/plugin/ folder) and doesn't really get me to a nice spot in terms of debugging.
Using an installed version of the qt creator to open the qtcreator.pro that came along with the source, adding a qt creator plugin as a sub project, and building everything from the already installed version of qt creator.
I like the second approach a lot because I have control over everything but I can rely on qt creators tools that make projects, enhance debugging, etc. There's just one small problem...
When I run my shiny new build of qt creator (with my plugin project) from inside the installed version all I get is a popup called "qtcreator_process_stub" that says "This is an internal helper of Qt Creator. Do not run it manually. Press to close this window..."
So I'm not really sure how to debug my build of qt creator from my instance of qt creator. Any ideas? Note: if I run the generated Qt Creator.app I get a functioning instance of qt creator with my plugin loaded properly.
I believe this was a versioning problem. I had an older version of the ide installed and was using it to build and debug a newer version of the ide.
I was able, in the older ide, to launch and debug the new ide as an external process through the debug menu... but that was mildly annoying.
Once I installed a new version of the ide I was able to debug like normal.

How to get QtCreator to link incrementally with nmake?

I used to develop in Visual Studio (2008) but almost completely switched to developing in QtCreator now, mainly due to Code Navigation, refactoring and Code Completion.
I'm using the win32-msvc2008 mkspec. So far I've managed to set up everything except for one thing:
Incremental Linking.
In my project file I added the line:
QMAKE_LFLAGS += /INCREMENTAL
and I get a linker line like
link /LIBPATH:"(...)" /NOLOGO /INCREMENTAL /DEBUG /MANIFEST (...)
However, it always tells me it cannot find the .exe or it was not built completely by the last incremental build, even if I only change a .cpp file, revert the change and save.
I've tried building with and without shadow build, and with nmake or jom, neither combination works.
Has anyone managed to get QtCreator to link incrementally with nmake?
PS: If I import the project file into Visual Studio using the Qt Plugin, incremental linking works perfectly.
Apparently qmake needs to generate the makefiles differently in order to make incremental linking work properly when you are using nmake.
I filed a bug request, if you're interested, here it is: https://bugreports.qt-project.org/browse/QTBUG-22718

QWT plugin for QT 4.5

I have gotten the latest QWT 5.1.2 for QT 4.5 and managed to get it to complie. I am now trying to get the plugin to work in QT Designer (with VS intergration). I have placed the plugin files into the plugin/designer folder, but when attempting to load, I hit this error
Cannot load library qwt_desginer_plugin5.dll: The specified module cannot be found.
I've done some search on this issue, one page which suggest moving the plugin to the VS intergration folder - which does not exist for Program Files\Nokia\Vs4Addin.
My QT Designer is a debug-and-relase build. (That is, if I use a debug build of the plugin it would complain that it is expecting a release).
qwt_designer_plugin5.dll depends on qwt5.dll, so:
Additionally to placing "qwt_desginer_plugin5.dll" in "plugins\designer" directory, you must put qwt5.dll to some place where windows loader can find it (at example, you can put it in "%QTDIR%\bin" directory)
It appears that I have to place the generated dll into the qt\bin folder for the designer to load the plugin
You may place it everywhere in the PATH. Also the same dir as the executable program works.
You can see how dll libraries are loaded.

Resources