Eclipse CDT static resources under build folder - build-process

I'm building a C++ project under Eclipse and my release folder should include a static sub-folder with some files inside it, those are required by executable during runtime. The problem is that this folder is automatically deleted before every build - entire release folder is completely wiped out and I'm losing all the files inside it.

Solution is simple - need to place rm.exe from mingw utilites on path and Eclipse will delete only specific build files instead of removing entire release folder.

Related

Sharing .netcore project between windows and linux Keeps adding files

I am working on a group project and we have decided to use netcore for the project. The project was originally created using VS.
When I pull the project and run it using VSCode, I have noticed two things:
I have to navigate to the src folder and run it from there.
Before pushing new changes to the master branch, .netcore on linux has made changes to obj folder and added .vscode folder.
how can I stop this from happening so we don't step over each others toes, and why does this happen?
Thanks.
You should not add the files under obj to source control. It contains artifacts that are regenerated on every build.
If you use git, here's a suggested list of files and folders to ignore:
[Oo]bj/
[Bb]in/
.vs/
*.xap
*.user
/TestResults
*.vspscc
*.vssscc
*.suo
*.cache
*.docstates
_ReSharper.*
*.csproj.user
*[Rr]e[Ss]harper.user
_ReSharper.*/
packages/*
artifacts/*
msbuild.log
PublishProfiles/
*.psess
*.vsp
*.pidb
*.userprefs
*DS_Store
*.ncrunchsolution
*.log
*.vspx
/.symbols
nuget.exe
build/
*net45.csproj
*k10.csproj
App_Data/
bower_components
node_modules
*.sln.ide
*.ng.ts
*.sln.ide
project.lock.json
.build/
.testpublish/
launchSettings.json

Qt Release qt.conf

When I release my Qt project, I want to redistribute the QtCore5.dll and Qtxxx.dll files.
How can I make myapp.exe to find them automatically?
The best way of doing this seems to be by editing a qt.conf file placed in the same folder as my executable.
myapp.exe is in c:\myapp\bin folder
The dlls are in c:myapp\common folder
"Better" way is to put your qt.conf into your resources :/qt/etc/qt.conf. This way has highest priority for resolving platform dependencies.
In our project we use cmake to generate necessary qt.conf file: in debug mode we put path to installed Qt binaries and in release - to local (deploy) folder.
Qt5xxx.dll files are linked, so you should place it in same folder, or make them available throught PATH environment variable. If you really want such exotic redistribution system (please, say real reason) - you may create your own platform-specific launcher, that will load necessary .dll's from any path.
Just put all required dll files into the same directory as your executable.
Note, that there are more files to distribute than just Qt*.dll - you will need proper plugin from platforms subdirectory and many more. Read Qt documentation on deploying application under Windows - it will teach you all required files.

Qt renaming path of the project

sometimes when I rename the path to a qt project, it cannot be run even though I clean qmake and rebuild it!!! the path does not contain any space. and the project is completely correct and I know that the error is for path renaming , for example when I rename :
D:/abd/projects/LAND_2/Land_QT/...
to
D:/abd/projects/LAND_2/Land2_QT_SA/...
it cannot be build and says that some include file is missing(but the file is there!).
what is the problem?
I work with dynamic qt5.2 on windows 7.
Edit:
when I copy the project folder to a new directory( a path upper than current path) then the project can be build and run.
When you rename the path to the project, go to the project folder and delete the file with .pro.user extension. Open the project and Qt will ask you to configure the project. Choose the required kit, build and run the project.It should build successfully now
If you have changed path multiple times the .pro.user file is created multiple times delete all files with this extension and compile

Applications works while debugging, but doesn't work when "released"

So, I just made a standard, QtQuick 2 application, it has the default Recangle, Text and MouseArea. So, I just tried to compile the application in release mode, to see what files it would generate, and then I tried opening the application and this happened:
When I resize it, I cans see white space:
However it all works fine in debugging:
I am using Qt 5.0.1 and QtQuick2
Update
So, after running it through Dependency Walker it appears like there are three files missing: qt5quick.dll, qt5gui.dll, and qt5core.dll. Do I have to manually add them from somewhere?
The current directory structure is:
`test-build-Desktop_Qt_5_0_1_MSVC2010_32bit-Release/release
|+qml
|+test
|-main.qml
|-main.obj
|-moc_qtquick2applicationviewer.cpp
|-moc_qtquick2applicationviewer.obj
|-qtquick2applicationviewer.obj
|-test.exe
|-test.exe.embed.manifest
Note: I pasted the qml directory as suggested in Nemanja Boric's answer from the parent directory, but that didn't solve the problem! :(
Also, I was under the impression that none of the source (apart from JavaScript maybe) wouldn't be openly distributed with the app, but compiled or packed inside the application somehow (note the .cpp file and the qml directory)?
Update 2
The application works just fine when run from inside Qt 5 Creator:
Starting [...]\test-build-Desktop_Qt_5_0_1_MSVC2010_32bit-Release\release\test.exe...
QOpenGLShader::link: "(41,18): warning X3206: implicit truncation of vector type
"
[...]\test-build-Desktop_Qt_5_0_1_MSVC2010_32bit-Release\release\test.exe exited with code 0
Well, apart from that one awkward warning...
You need to copy qml files into your current directory. When you create release application with QtCreator, you will have this directory structure (or something like this):
example-build-Desktop_Qt_5_0_1_MSVC2010_32bit-Release
|- debug
|- qml
|- release // application executable is here
What you need to do is to copy qml folder to be in the same directory with your executable release file (simply copy qml folder into release folder).
About dll files - you can copy them manually from QtInstallDir/bin folder or you can add that directory into PATH, if you are developing on that machine - it could be easier.
You don't need to publish cpp files, but you need to publish qml files. What you can do, through I never succeed, but it seems to be possible is to bundle qml files into Resource file, and to load it from resources, but that can be extracted easily, too - so - don't put your logic or confidential informations in qml files.
Also, you need to copy all required dll files into directory with exe: qt5quick.dll, qt5gui.dll, qt5core.dll and libEGL.dll.

Qmake does not support build directories below the source directory

I have created an application that compiles and runs like a charm on OS-X. I would now like to start getting it to work on Windows. To start, I copied the project to a windows machine and just tried to compile, but got this error:
:: warning: Qmake does not support build directories below the source directory.
Any ideas?
Set the shadow build directory to some folder on the same level of your project directory:
folder/
project/
project-shadow-build-release/
project-shadow-build-debug/
You can do this in the "Projects" view, via the toolbar on the left. To me, this warning was just an annoyance, a project never failed to build because of it.
Don't copy your project.pro.user file when you are copying a project from one machine to another, or from one directory to another. When you open the project, Qt Creator will offer to create a new build directory in the proper place.
Andref gave the correct answer to resolve this warning, but you may want to understand why this requirement exists.
In fact, the build directory must be at the same folder level as the project (i.e. it can't be above or below). The reason why is that the linker is called from the build directory. Hence, any relative paths to library files will be different than what you entered in your project file.
It kinda sucks. I like to put all intermediate files in their own folder. But you simply can't with qmake.
.pro.user are generated files by Qt Creator. They are unrelated to qmake and should not be touched (and not put into a VCS for that matter)
Just remove the files with the pro.user extension , worked for me
I also got this, trying to compile a project created on linux.
Another way to solve it is to change the paths in the .pro.user file (in the directory of your project)
Right Click on a project: Set As Active Project
Click on the Projects button (The one with the spanner image)
Edit build configuration : Debug / Profile / Release / and change the default directories, OR just uncheck the Shadow build check box.
The Build directory path should now change to black, from red

Resources