Profiling with Intel Vtune Amplifier - directshow

I have create one filter dll using some static libs and this dll is used in graph studio and it's running fine. But I have to do profiling of my dll, so I have started graph studio then vtune. In vtune project property I have attached it to process and successfully generated the Profile report. But I only able to see assembly of my code not c/c++ source of my code. How to see the source code of my dll in Vtune?

You have to specify where to search for Symbol files.
Here is a good documentation https://software.intel.com/en-us/articles/resolving-symbol-references-after-data-collection

Related

Qt, Visual Studio 2017 and .vcxproj.user Files

I am using Visual Studio 15.9.14 and Qt 5.13.0 on multiple machines. When I check out my source from version control:
If I open the VS IDE to build my solutions, everything compiles and links correctly.
If I build the solutions from the command line using devenv.exe, there are multiple compile and link errors in the Qt projects.
The problem is that when building from the command line, the .vcxproj.user files are NOT generated, and therefore $QTDIR is not defined for use in my projects. The result is my automated/nightly builds fail.
I can build a tool to create the files and integrate it into my build process, but I shouldn't have to. This problem seems to be related to the VS/Qt integration. I have also encountered a similar problem in the IDE where I had to force the files to regenerate by touching the projects.
Any suggestions/help would be appreciated.

Problems with deploying Qt5 application on windows

So I have Visual Studio 2013 (community edition) with Qt addin installed, Qt5 libraries (32bit), and I'm trying to create an executable that is independent of all development configurations (it may use static or shared libs, I don't really care at this point).
OS: Windows 7, x64.
For doing this I changed the Solution Confguration visual studio option from Debug to Release, and add all the necessary libs in Configuration Properties -> Linker -> Input -> Additional Dependencies. The application now starts only if I run it from visual IDE, If I try to start it from the generated .exe I got The application was unable to start correctly (0xc000007b) error.
I have searched and found that this error code indicates one of the following problems:
32-bit app tries to load a 64-bit DLL (not my case I think, Qt DLLs are 32bit (I have installed using this .exe: qt-opensource-windows-x86-msvc2013-5.5.0.), and I use some other .DLLs which are also 32bit).
There are some missing DLLs. (I did copy all the necessary Qt DLLs in the same folder with the final executable).
For checking what dependencies my app requires, I opened the .exe file with Dependency Walker application, this is what it shows me:
in this list were also Qt5Multimedia.dll and Qt5SerialPort.dll, I get rid of the errors by copying the .DLLs in the same folder with the .exe.
Any ideas how to solve this?
You should never do that operation manually unless the standard procedure completely fails. There is already standard tool for Qt Windows deploymend windeployqt.
It takes care about Qt DLL dependencies, makes a copy of platforms\qwindows.dll and also it makes a copy of libraries that you cannot detect with the Dependency Walker, since image plugins and some other are loaded at runtime.
You do not even need to have your Qt bin folder in your environment PATH. The simplest deployment:
copy built exe binary to a new folder
open cmd console in that folder
call windeployqt using its full path (if it is not in the system PATH) and provide your executable, for example:
c:\Qt\Qt5.5.1-vs2013-x64\5.5\msvc2013_64\bin\windeployqt.exe application.exe
As a result you have in that folder all needed Qt DLLs. Of course you can have also issues with MSVC redistributables, but those should be deployed separately and installed once per system.
The tool windeployqt has various options. It can also take care about deployment of qml related files.
Only some 3rd party libraries should be copied manually if they are used, for example OpenSSL.
Solution:
As I got deeper, I have found this answer, after doing what that answer indicates (I actually copied all the .DLLs located in \Qt5.5.0\5.5\msvc2013\bin to the folder where my .exe is located), the error message changed from The application was unable to start correctly (0xc000007b) to Application failed to start because it could not find or load the QT platform plugin “windows”.
Searching on web for more about this error, I have found from this answer that you also need the platforms folder in the same location with the .exe (which was located in Qt5.5.0\5.5\msvc2013\plugins path). After copying that folder, the application started without any problems!!!
Now I just need to delete all unnecessary .DLLs from my application folder (Dependency Walker does not offer very useful information about this), and all the deployment is done.
I have solved the problem in the same time as describing it, so I guess I will just leave this here, may help others that have the same problem.

How to use Sketchup Examples

I am trying to write a sketchup exporter. That will take a model that is currently inside sketchup and export it to a custom format.
I know that the sketchup sdk comes with some example projects such as skp2xml. How do I use this example file? It creates a dll file. How do I access this code within sketchup? Do I need to load it with ruby? If so how?
The deprecated documentation states:
A SketchUp plugin exporter is a piece of code that is dynamically loaded at runtime when a user indicates that they wish to export the model, view, section slice or image.
On the Windows platform an exporter is implemented by creating a COM
DLL which contains a class that implements IEnumSketchUpExporter
interface. See the SkpToXML Exporter example in the Examples folder
for the details on how to do this.
The example is a visual studio project which I can compile into a dll. What do I do with the dll though? Do I need to place it in a special location?
Note that the skp_to_xml example will not work without Sketchup Pro.
The XML Exporter sample builds an exporter plugin for SketchUp and runs in the same process. Due to its C++ interface, it has to be built with the same Visual Studio version as SketchUp, which is VS2010. If you let VS2012 upgrade the project, the resulting DLL will not be compatible and it will likely cause crashes.
To use the Sketchup skp_to_xml project do the following:
Build the Project file located in skp_to_xml/win. Make sure that
you have the correct platform selected (32, 64) or Sketchup will not
load it. It must be in release mode or Sketchup will crash.
Copy the SkpToXML.dll to your sketchup/Exporters folder. Default location is: C:\Program Files\SketchUp\SketchUp 2015\Exporters
Go File->Export->3D Model
In the export model export type you will find the new .xml file
format.
Sources:
https://groups.google.com/forum/#!topic/su-sdk-fileshare/xGCiGK2775k
http://sketchucation.com/forums/viewtopic.php?f=180&t=53862

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.

How to build QTcore4.dll without dependency to MSVCx80.dll?

I have a windows screensaver that I want to recompile using the QT libraries, so that I can make available for more platforms.
I am facing problems with the deployment on Vista and XP.
I compile my screensaver statically with MT, and run the dependency checker.
The results are:
MyScreensaver.SCR needs several DLLS, QTCORE4.DLL but no MSVCx80.DLLs.
So far this is fine.
My problem is that QTCORE4.DLL in its turn, does need MSVCP80.DLL and MSVCR80.DLL
As a result my application does not run on Vista systems.
Can I build QTCORE4.DLL to be statically linked the the microsoft libraries (maybe Libcmt.lib ?) so that I do not have any dependencies in the MS CRT DLLs?
Limitations:
I do not want to have the users install the MS VC redistributables. The screensaver is only 1 MB, and it is ridiculus to ask the user to do so many changes in his computer just for a screensaver.
I do not want to use the trick to put the MS CRT dlls in the same application path with the screensaver because screensavers are installed in system32, and I want to install the minimum possible files there.
Finally, I do prefer to produce a monolithic program, rather that a bunch of DLLs
I tried a full static compilation and link of QT, but this is not allowed (if I understood correctly, by the LGPL) and also it is not recommended according to this: http://www.qtsoftware.com/developer/faqs/why-does-a-statically-built-qt-use-the-dynamic-visual-studio-runtime-libraries-do-i-need-to-deploy-those-with-my-application
After trying for solutions in various directions, it seems the most feasible one is to use the QTCore4.dll and QTGui4.dll, but having them linked statically to MSVCRT. In this way, neither my program, nor the QT DLLs will have dependencies on MSVCRT dlls.
Is there a solution to this?
( I am new to QT programming )
Thank you,
Michael
I think they are concerted that parts of your application will be compiled with /MD(d) and parts with /MT(d), but if you control everything (including 3rd party libraries) then its pretty safe to use /MT(d).
You have two options:
Those dependencies are part of Microsoft Visual C++ Runtime Library, you can deploy that library in your installshield and user silently installs it, MSVCRT library not included in Windows by default, you must deploy runtime library in your installshield and copy Qt*.dll DLLs in your application directory.
Use Static Linking of Runtime and Qt main dependencies, with this option you have one executable file, but to static compile of Qt you must have Qt commercial License for commercial use.

Resources