Missing .qmake.stash file - c++

Who creates .qmake.stash file? When is it created?
I've been working with Qt in Visual Studio creating Windows applications for some years now but never had to care about this file. But now I have set up a cross compilation in Visual Studio using WSL 1 in order to build my application for Linux on arm64.
I'm able to build all projects in my VS solution on my development computer. Now I'm trying to setup this cross compilation system on another PC. The first project of this solution could be built without a problem, but the second one failed with
error : qmake: Project ERROR: Cannot run compiler 'aarch64....'
error : qmake: Maybe you forgot to setup the environment?
error : qmake: Error creating Makefile
After many hours of investigation comparing project files and configurations I was able to find the reason: qmake didn't find the file .qmake.stash when it should create the Makefile.
The working project has a .qmake.stash file in the intermediate output path $(IntDir) /obj//<vs_configuration>, e.g. myproject/obj/x64/RelArm64.
The failing project doesn't have this file in its $(IntDir).
If I manually copy this file from the working project to the other project, it works, too.
Who should have placed this file to $(IntDir) before executing qmake?
My qmake.stash file in the working project is quite old. So it seems as if it isn't generated during every build process.

Related

Where does Visual Studio 2019 CMake project Linux remote builder place sources and output files on target device?

I am building a C++ app for Linux and I'm using Visual Studio's CMake integration to remotely build the app. I have made some modifications to the project's directory structure, and now the output executable file has the same name as a folder that previously was part of the project. Now the program compiles well, but the linker fails with the following error: Cannot modify x: is a directory. I figured that if I clean the target folder the build would succeed. However, I cannot find the project folder anywhere on the target machine's file system.
I have never used that software before, but from the default config i'm guessing it is under ~/.vs/yourProjectName:
{
...,
"remoteMachineName": "${defaultRemoteMachineName}",
"remoteCMakeListsRoot": "$HOME/.vs/${projectDirName}/${workspaceHash}/src",
"remoteBuildRoot": "$HOME/.vs/${projectDirName}/${workspaceHash}/out/build/${name}",
"remoteInstallRoot": "$HOME/.vs/${projectDirName}/${workspaceHash}/out/install/${name}",
}
]
}

Assimp model loading library install/linking troubles

I'm trying to install Assimp to use in my projects, but I'm having some trouble. I'm currently using win 10 pro and visual studio 15 2017.
I have downloaded Assimp 4.0.1.zip, extracted it into a directory, loaded cmakeGui and ran configuration twice, then generated into Assimp/build directory.
Next I went into Assimp/build and I ran the Assimp.sln and chose the ALL_BUILD I think it was. I then copied all the files in the /code/debug that were alongside the .lib and .dll and moved them all into the Debug directory of my project where my exe is built to. I copied the .lib into my opengl/libs directory and all the headers in /include from the originally extracted download into my opengl/includes/assimp directory.
Finally, I adjusted my projects linker settings to include the assimp.lib and assimp.dll (alias for simplicity of this post)
When I tried to build the project it said it could not open the dll and when experimenting I copied the dll into the project dir alongside main.cpp and my other files and ran again, it this time said "invalid or corrupt file: cannot read at 0x378"
It's safe to say I need to study up on compiling, linking and cmake but for now I started over.
I thought I had it working(and maybe I do...) after I got it to stop complaining when I was including the headers into my project. To do so I started from fresh, built Assimp same as before, moved all the files with the dll into my libs directory, dumped all the includes from the download into my includes, also move the config.h from the build into this directory. Then I set the linker settings in the project and didn't move anything into my project directories.
After that, it stopped complaining so I proceeded with the tutorial series I was following. I compiled, got a load of errors, fixed them down to 0 then suddenly I got 8 new ones in their place.
Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol _aiGetMaterialTextureCount referenced in function "public: unsigned int __thiscall aiMaterial::GetTextureCount(enum aiTextureType)const " (?GetTextureCount#aiMaterial##QBEIW4aiTextureType###Z) opengl_model_loading F:\Desktop\MyDocuments\Tuts\opengl\getting started\opengl_model_loading\opengl_model_loading\main.obj 1
This error gave me the feeling it was probably due to the dll.
Please advise.
I've just recently done this myself & will say had lot of trouble with v401 & getting errors or linking issues. Successfully got mine working with following;
Note: ASSIMP does have boost as a dependency.
Download/clone master Asset-Importer-Lib from github:
https://github.com/assimp/assimp
Open Cmake GUI & once open:
Where is the Source code: "..\MyDocuments\assimp\assimp-master"
Where to build the binaries: "..\MyDocuments\assimp\assimp-master\build". You will need to make a build folder & point Cmake to it.
2.1. Alternatively if you're familiar with command line option: generate project files with relevant paths using
cmake -G”Visual Studio 14 Win64"
Click configure.
Then Generate. Make sure you select correct build option ie VS15 2017 64bit.
Load "..\MyDocuments\assimp\assimp-master\build\Assimp.sln" with Visual studio.
Right click "ALL_BUILD" & select "Build". This will take several minutes. Once done & no errors, it should create necessary *.dll/*.lib in
..\MyDocuments\assimp\assimp-master\build\code\Debug
Link & include into your existing project the relevant *.lib & also
"..\MyDocuments\assimp\assimp-master\include\assimp" folder. You will also need to make sure *.dll file is in the same folder, or included, as the *exe you're running.
You may also need to copy over from the ..\MyDocuments\assimp\assimp-master\build\include\assimp\config.h" & include it in step7.
Just ensure you're building right libraries for your code ie 32/64bit/debug/release/unicode/etc, otherwise may encounter issues still.
Following video is useful for the visually inclined.
https://youtu.be/W_Ey_YPUjMk
Hope this helps.
EDIT:
If you want static library version ie no .dll required:
From above steps:
5.1. Change relevant project configuration type & extension from .dll to .lib type (should be two: assimp & zlib).
5.2. Right click "UpdateAssimpLibsDebugSymbolsAndDLLs" ->Properties->Build Events & update the paths in the command line sections from ..\Path*.dll to ..\Path*.lib. (If encounter errors, do same on assimp_cmd project).
Same as above but now also need to link your project to IrrXML.lib & zlibd.lib. Should no longer need the *.dll file.

C++ Project not building. No output files are produced

I have a solution with multiple C# projects included, and a single C++ project.
The C++ project is a .NET Framework bootstrapper that should produce a native executable file. I first built the project as a single project solution, however i'm now trying to migrate it into a master solution.
In order to migrate it, I added a new project called Setup to my existing solution called Master. I then added each header, source and resource by adding new files and copy-pasting the content.
I also changed the output directory to $(Configuration)\ so that it doesn't put the Debug and Release folders in the root folder of the solution.
Now, when I attempt to build the project, it says Rebuild All Succeeded, however when i try to debug it i get the following error
Unable to start the program ~ The system cannot find the file specified
Image of error shown when attempting to debug (F5)
If i navigate to the output directories, they are empty.
This is my first attempt at a C++ project, have i made a schoolboy error?
Does anyone know how I can get this working?
I found the answer. It was indeed a schoolboy error.
I was targeting AnyCPU, whereas i should have been targeting x86.
Now that i'm targeting the correct architecture, the project builds as expected.

visual studio 2013 deploy a project

I crack my head already, I need to deploy a project. I tried to use InstallShield, it create an msi file, and local installation has no errors, but then when I tried to launch the program it output "debug error". In my settings code generator -> runtime library set for Multi-threaded Debug DLL(/MDd). If I'll set it to Multi-threaded (/MT) it would not compile: "Please use the /MD switch for _AFXDLL builds"
Then I tried to use VS Installer project extension. It creates the msi and setup file, but after I install it, I can't find the .exe file and launch program. What I am doing wrong?
Folder with project files
![enter image description here][3]
Folder with exe file
![enter image description here][4]
At the stage of creating the installer for your program, you have to put all the external files, libraries and resources, that your program needs in order to run correctly, in your program's working directory. When you run the program via Visual Studio, everything works fine since it can find the files, because, as you've mentioned, they are in the project folder, and the project folder is where Visual Studio is looking for them.
When you launch your program outside VS, the program can't find these files since it by default tries to locate them in the folder in which the .exe file being run is located. So, if you wan't to run program outside VS, you need to put all the files needed to your .exe's directory.
For the same reason, while creating your installer, you need to include all the files necessary in the installation target directory together with your .exe. Every installer creator lets you do that.
In general, if you cannot run your program outside any IDE, and you can run it within that IDE, it is a rule of thumb that you should first check if you have included all the necessary files/libraries/dll's/etc. in your program's working directory.
I solved it!!!!!!!!
1)Help to run .exe file, helped updating .uld file in the same directory as a exe file.
2)I used Dependency Walker (http://www.dependencywalker.com/) to find all dll that it's need. And then I create a Setup Project using Wizard at the "Choose file to include" step I add every file and every library that it's depend on! Build->Install-> Then magic, and my application installed and running! Thank you all for your help

Building VC++ 6 project from TeamCity. Can't find header files

I have a VC++ project and I have got the .dsw file. I want to build the project through TeamCity and obtain the .dll file.
In the TeamCity, In Build Steps I have given the Runner type as Command Line and passing in the following parameters.
Myproject.dsw /MAKE "Myproject - Win32 Release MinSize"
It creates empty output directories and all but I get this error
fatal error RC1015: cannot open include file 'afxres.h'
I have checked that the file is located at 'C:\ProgramFiles\Microsoft Visual Studio\VC98\MFC\Include'.
I don't understand why it is not picking up the file from this location. I tried adding this location to Environment Variable PATH, but it does not work.
The TeamCity picks up few files from 'C:\ProgramFiles\Microsoft Visual Studio\VC98\Include' though.
Please help.
I some how figured out the solution for this.
The TeamCity Agent runs as a windows service. So, it can not access the User environment variable for e.g. %include% and %lib%.
What I did is, I passed these two variables as environment variables to TeamCity Build. And voila!!! It works. :)