QT Dlls problem - qt

I have small problem with qt dlls. In visual studio 2008 project compile fine and everything works, but when I try to open application in debug folder without using visual I had errors, so I copy all needed dlls to this project, but after that I don't have any error, and nothing happens (window doesn't appear on screen).

In visual studio you can add a binary reference to the Qt dll's and it will ensure they get copied to your build directory when you debug. You need to might use a dependency walker to figure out what all the required dll's are.

You need to also copy from your Qt install folder the "platform" dll located at : platform\qwindows.dll
to your running folder.
(I forget if you need to copy "platform\windows.dll" or just "windows.dll")

You can also use the cygwin toolkit to resolve dependencies as well (ldd). Another option is to add the library path to your %PATH% environment variable

Related

Why are c++ .dll not recognized in bin folder of asp.net webapp?

I create an ASP.NET Webapp with Razor syntax in Visual Studio 2015, in C#.
I have to use 20 third party native c++ dll files (most of them for image handing, libtiff-5.dll, libpng16-16.dll, etc...).
Even when I manually copy those dll files into the bin folder, the app would not run. The error is:
Could not load file or assembly 'managedDllWrapper.DLL' or one of its dependencies. The specified module could not be found.
But according to almost all hints in the internet, copying to bin folder should work.
When I copy the dlls into the C:\Windows folder, the webapp runs perfectly, but only locally on my machine.
Also, when I create a C# Console app, instead of a webapp, copying into the bin folder works fine.
Why doesn't it work for a webapp? How can I import those dlls?
I cannot reference them into Visual Studio to the project, as they are not a valid COM assembly.
the dlls are not imported in the code with dllimport, as I don't know the specific functions they provide. A managed dll wrapper uses the dlls.
Any ideas? Thanks!
I did not solve the problem one to one, but I circumvented the problem successfully:
By rewriting the c#/c++ wrapper with explicit dllimport, I adressed the dll files directly with path. Then, the dependent dll just have to be in the same folder as the referenced dll. This works also in web apps.

How to move and build Asp.net project to other computer?

I developed a website using VS2012, Asp.net MVC4 and entity framework in old computer.
and I copied the project to new computer, in VS2015 project folder, and try to run it. but there are many warning sign in reference.
I don't know what the warning sign means..
How can I solve that problem? so that I can build the project in new computer?
[Edited]
I did, 'Update-Package -Reinstall', and I found still some of reference are still with warning sign. and the package path was pointed to bin directory.
So I copied the bin directory then,
and,
How should I do to solve this problem?
You should look on the old computer where are those references coming from. Whether they are added as NuGet packages or directly referenced from some lib folder which you forgot to copy. On the old computer click on the assembly reference and open the properties window (F4) which will show the physical path to the assembly. On the new computer you should replicate the same folder structure so that the assemblies can be resolved. Alternatively you may take a look at the corresponding .csproj file.
If they were added as NuGet packages, then you should restore them using the following command:
Update-Package -Reinstall
This will look for a packages.config file in all projects in the current solution and download and install the NuGet packages listed there.

In a Visual Studio 2012 project, how can I avoid copying and pasting QT DLLs into executable directory?

I'm using Visual Studio 2012 to build a QT 5.5 application.
Note, I use CMake to generate the Visual Studio project and solution files.
If I build the Release solution, when I run the .exe I get an error complaining the dll's were not found. I can fix this error, by copying and pasting the required dll's into the project's Release directory.
How can I avoid copying and pasting the required DLLs?
Do I need to specify the DLLs and/or their path in Visual Studio?
Is there a way to use CMake to specify the DLLs and/or their path?
For providing the Qt DLL's along with your application, the windeployqt tool which comes with Qt itself is probably what you want. It knows about Qt's plugins, etc. and can copy in the relevant Qt DLL's and plugins for you. Depending on what you are trying to do, you may want to invoke it as either a post-build step, as an install step or both. There's also a macdeployqt tool for Mac OS X, but there is currently no equivalent linuxdeployqt tool.
For taking care of copying in any non-Qt DLL's, CMake's BundleUtilities module can be used to automatically copy in any DLL's that the executables/libraries depend on. Unlike the Qt-specific deploy tool, BundleUtilities works for all platforms, but it doesn't know anything about Qt plugins which would be loaded dynamically at run-time. Again, use the relevant function(s) from BundleUtilities as a post-build and/or install step. For Qt4, the DeployQt4 module invokes BundleUtilities internally, but CMake doesn't provide an equivalent module for Qt5, instead choosing to let Qt itself provide the necessary support.

Can't launch Qt Quick Controls application

I downloaded Qt 5.4 and created Qt Quick application with Qt Quick Controls 1.3.
I didn't change anything in code, just built it (as release). Then I copied .exe to another folder, added all the .dll files I needed and when I launched my program there was no window, just the program process running in the Task manager.
However, I can launch program which uses QtQuick 1.1.
How can I fix it?
Thanks.
Here is an image for some more explanation:
Try to deploy your application using The Windows Deployment Tool which copies all DLL and other files necessary for deployment alongside your application executable automatically.
The Windows Deployment Tool could be found in QTDIR/bin/windeployqt.exe
Open your command prompt and add the path to your Qt directory and it's bin folder to the PATH variable like :
set PATH= path\to\Qt\bin
Next run the windows deployment tool with your application path as the argument:
windeployqt.exe <path-to-app-binary>
This way you make sure that the deployed application would work on any computer and you have included whatever necessary.
Sounds like you are missing the platform plugin. It should be in the folder of the executable, in a platforms subfolder. That's why you aren't getting a window - the runtime fails to load the platform support plugin. On windows that should be a qwindows.dll file.

msbuild with no Visual Studio (Yes Windows SDK installed & Copy Local=true)

A project gets built fine from Visual Studio without a problem from developers work station. Now we need to more it to DEV and UAT server. I've been struggling all day trying to get my ASP.NET project built with msbuild on a server with no Visual Studio installed (dev tools not permitted on servers) -
The type or namespace name 'Optimization' does not exist in the namespace 'System.Web'
The type or namespace name 'DotNetOpenAuth' could not be found
Couple attempts were made:
1. Install Windows SDK (http://msdn.microsoft.com/en-US/windows/hardware/hh852363) - appears there has been a lot of discussions from another Stackoverflow post (Related but not exactly - Build ASP.NET 4.5 without Visual Studio on Build Server). You'd also need to add to environment variables PATH
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\
C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools
(This did NOT help)
2: gacutil to install the dll's?
(no vs command prompt - as said, no dev tool/Visual Studio permitted on server)
3: copy the dlls' to (i.e. same folder as MSBuild.exe):
C:\WINDOWS\Microsoft.NET\Framework64\v4.0.30319\
(This did NOT help)
4: Copy local = true
(This did NOT help - the dll's apparent msbuild can't find already in bin folder of the ASP.NET application)
It appears to be a bug with msbuild - http://social.msdn.microsoft.com/Forums/vstudio/en-US/434abf1a-30db-4b13-8062-13755898dd71/msbuild-is-unable-to-link-to-a-webapplication-project?forum=msbuild
Anyone has experience with this?
Thank you for your feedback. This is an intentional change made in VS 2012. Projects excluded from a build configuration do not get built when you are building that configuration.
Yes, I've had experience with that. I discovered that excluding the project was handy in the IDE, I think I remember so that stable libraries don't get rebuilt so often; but the user could right-click on that project and build directly just once or when really needed.
But, it broke the MSBuild.exe command-line build, because those projects were not available at all.
One thing is to add conditional logic to the build file so it knows to set things differently for an interactive user or a pure build environment:
Condition="'$(BuildingInsideVisualStudio)' == 'true'"
I ended up eventually improving the build solution in my case, so I can't recall a specific example of the Excluded thing.

Resources