In order to develop qt application on eclipse, i have installed mingw, qt and qt eclipse integration. When i try to build the project, it search nmake for building project and syntax of my make file is nmake syntax.
And i thought there were some special eclipse settings but i could'nt find anything about it.
How can i make eclipse produce make file instead of nmake
Any help will be appreciated.
It is because of Qt version. Nmake is special for Visual Studio integrated Qt. So If your eclipse create nmake file instead of make file. Your eclipse show wrong version of Qt.
If you don't want to get this error. You should firstly check:
Check you download true eclipse version. The Qt version which
eclipse is using is correct
Check QT_DIR in your enviroment variable show correct path.
Related
I developed a desktop Qt app on macOs. I want to execute my app on windows. I've looked that pages:
https://doc.qt.io/qt-5.9/osx-deployment.html
https://godhc.wordpress.com/2012/06/10/build-your-qt-project-on-windows-and-mac-osx/
But it did not make sense well.
Can someone explain me how to do that?
you have to recompile it on windows. you have to make sure your code doesn't use macos "framworks" or unix or linux specific functions.
i recommend downloading a precompiled static QT as building it is impossible. you can get that here and using the visual studio compiler, you will have to download visual studio and all the c++ addons and stuff.
!! edit what ever directory your cmd is in is the output of the qmake !!
you then open up cmd and run the static compiled QT's qmake on the .pro file of your project. e.g.
E:\QT_projects\QT\qt5-5.7.1-vs2015\qt5-x86-static-release\bin\qmake.exe E:\QT_projects\variable-length-string-editor-for-binaries\StringEditer.pro
that will make the makefile. and then open the visual studio cmd called "Developer Command Prompt for VS 2017" for me opening the start menu and typing it in will show it.
you then navigate to the folder where the make files that qmake generated e.g.
cd E:\QT_projects\variable-length-string-editor-for-binaries
then run nmake on release or debug or just nmake e.g.
nmake release
I'm trying to build a project which uses qt on an CI service for windows.
I already managed to install the QtPackage for Visual Studio by command line.
Now I'm stuck at the following step:
Launch VS2015 for configuring Qt5Package
QT5 > Qt Options > Add
Version name: Qt 5.6.22Win32
Path: C:\build\libs\qt5_6_2\qtbase
Default Qt/Win version: Qt 5.6.2 Win32 – OK - You may need to restart Visual Studio for this to take effect.
Is is possible to do this from the command line? If not, how can I work around this problem?
If you are willing to modify such global setting (for all projects), I'm sorry but there is no way to do it from command line in current public versions of the QtVSTools, nor in the latest version from the repository head (https://code.qt.io/cgit/qt-labs/vstools.git/ # 2018-01-09).
On the other hand, if you use msbuild to compile the project, you can override the Qt version to be used during that compilation (project files are not modified).
To do so, change the QTDIR project property (using the /property option) and indicate the path to the directory of Qt version you want to use:
msbuild your_solution.sln /property:QTDIR="C:\build\libs\qt5_6_2\qtbase"
Hope this helps.
I've done a whole tutorial about making a 3D Rendering Engine in OpenGL with Java and lwjgl and the guy who made the tutorial also wrote the engine in C++
To increase my knowledge about programming I wanted to take a look at the C++ version too. Also I believe (and I might be totally wrong) that I'm actually able to do a lot more with C++ than with java. The main problem I have is that I cannot get the engine running despite the included instructions and I would really appreciate if someone can help me out.
this is the engine i want to setup: https://github.com/BennyQBD/3DEngineCpp
I want to use CodeBlocks for this project since it was recommended and unlike Visual Studio it is free.. I also already downloaded glew, assimp and sdl and I installed CMake which are needed for this to run. Now I have to put that together according to this instruction here:
###Windows/MinGW###
- Make sure CMake is both installed and added to the system PATH.
- Open a Terminal and run:
```Shell
# install dependencies
# Install GLEW in %PROGRAMFILES%/GLEW or SET %GLEW_ROOT_DIR% to where GLEW is on your machine (Example: D:\PATH_TO_GLEW)
# Install SDL2 in %PROGRAMFILES%/SDL2 or SET %SDL2_ROOT_DIR% to where SDL2 is on your machine (Example: D:\PATH_TO_SDL2)
# Install ASSIMP in %PROGRAMFILES%/ASSIMP or SET %ASSIMP_ROOT_DIR% to where ASSIMP is on your machine (Example: D:\PATH_TO_ASSIMP)
cd build
# REPLACE "Visual Studio 12" with your preferred build toolchain (Maybe you want "Codeblocks - MinGW Makefiles")
# BTW VS 10 is VS 2010, VS 11 is VS 2012 and VS 12 is VS 2013, BLAME MicroSoft for the naming! LOL!
cmake -G "Visual Studio 12" ../
# open the generated SLN file (or cbp file if using CodeBlocks) and build!
```
- Copy the DLLs in /lib/_bin/ to /build/Debug/ and /build/Release/
- In Visual Studio, set the Startup project to 3DEngineCpp
- Move the res folder into the build folder
- Run
Major problem is, since I've only done java coding in eclipse I'm a bit confused..
What does he mean by "Open a Terminal and run: '''Shell" ?? and how am I supposed to install glew, sdl2 and assimp? what's cd build? and why do I need CMake, it isn't really mentioned what it does..?
Maybe someone can elaborate (step by step if possible) what I need to do in order to get this running, thanks a lot!
No guarantees my steps will work flawlessly as external dependencies in C++ is still very painful to deal with for me, but I'll give you some leads and hope you make some progress. Also, I've never used Code::Blocks, so I'm not sure if Visual Studio projects are compatible with it. This is the only way I know how to do things on Windows.
First, you'll need to install CMake. CMake is a utility that generates project files so that the project can be easily compiled on certain platforms. It generates Visual Studio project files on Windows, which will allow you to open the project in Visual Studio, and compile them from there.
In order to build the project, you'll have to sort out its dependencies first.
GLEW:
Download GLEW's sources and extract everything. It comes with Visual Studio project files
Open up Visual Studio with Administrator permissions
Open up GLEW's project
Build everything
Run the install "project" to get Visual Studio to install GLEW
Assimp:
Download Assimp's source from GitHub
Extract the project root directory somewhere. The root directory is the directory where CMakeLists.txt is in
Open CMake's GUI utility
Click Browse Source, and select that directory
Select an output directory by clicking Browse Build
Click Configure, when that's done click Generate. This will generate a Visual Studio project file for you
Open project with Visual Studio, build everything. Run install like you did before to install Assimp
SDL2: SDL's sources come with Visual Studio project files, so you can repeat the steps for GLEW to install it.
Now you can finally start attempting to get the engine to work. No guarantees that it'll work, but I'd try the same thing I suggested for Assimp as they're both CMake projects. Once the project files are generated, you can open it up in Visual Studio. Except this time, you won't really be installing it. You can modify the sources and run it like you would any other C++ project.
How do I exactly set up QT5 to be fully working?
I downloaded and installed:
Qt 5.2.1 for Windows 32-bit (VS 2012, 541 MB)
Visual Express C++ 2012
I ran the examples on QT Creator. They are all compiled and running fine. Simple hello.cpp also works okay
However, I can never understand why:
Running command prompt of QT or C++ native from VS will not let me do "make". qmake -project and qmake XXXX.pro is running fine. (Note: I can do compile well in QTCreator)
Subclassing cannot find its way to the folder. QTCreator complain LNK2019 and LNK1120
Could someone please list step by step on how to set these two software works seamlessly (QT5 and VS2012) from clean installation? I simply want to start coding gui with C++; nothing complex yet.
P.S. I could not find clear answer and guide regarding this matter. I can't register on QT site too (always say "no content to display" on registration page).
Anyway, thank you for the time, effort and attention.
Update: I have windows 8 at home, installed Qt5 and VS12. It works seamlessly. At work, the IT guy is stubborn to install windows 7.... Qt5 and VS12 in windows 7 is not the combo apparently. When compiling, it complains "where the hell is QDialog, QApplication, Q.... or whatever #include...?" I will try something else next week and will update you all.
Wow, what a mind blowing.
Here is the story in my Win7:
1. Installed VS2013, Qt does not like it. Then, I install VS2012. Still does not like it. Then, uninstall everything including deleting C:\Program Files\Microsoft VS 11.0 and 12.0.
2. I install VS2010 and QT for VS2010. Still not working.
Finally, uninstall and delete everything (including all folders in program files and c:\QT), I install VS2012 first then install QT for VS2012. It works....
Hope this help anyone who has problem in compiling during their first install in Win7.
Compiling a QT5 application in VS2012 can be really tricky depending on your current setup. Here's a summary of the most important guidelines to make it work like a charm:
First, it is required that your QT5 version is msvc2012. Otherwise,
it won't work. Make sure that a folder called msvc2012 exists.
Create a QT5 project file (.pro) that represents your current headers and
definitions. Make sure that the TEMPLATE config is set to vcapp.
Run >> qmake yourProject.pro in the command prompt. This should
generate a Visual Studio project (.vcxproj) file that can be openend
with Visual Studio 2012. Note: if there is more than one version of
VS installed on your system, qmake will more likely take a weird
decision and take the older one (qmake you're a bad kitty!). In this
case you must call the qmake from the VS command prompt directly.
Open the .vcxproj with Visual Studio 2012 and compile.
Any problem that may occur, for example compilation failure, is related to one of these steps being incorrectly done.
Useful references:
How to create a QMake project files, How to set environment variables
in vs2008 there is vsvars32.bat that sets up the variables to let you call make from basic cmd.exe. maybe something exists for Vs2012.
under windows systems its not make, it should be nmake
I have Qt installed + Qt Eclipse Integration + MinGW but I can't seem to find a way to build a new Qt GUI project.
I'm getting the following error:
Error launching builder (mingw32-make debug )
(Cannot run program "mingw32-make": Launching failed)
I've updated the Path variable and added all I can think about that can be related and nothing..
Path now is:
C:\PROGRAM FILES\THINKPAD\UTILITIES;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\WINDOWS\Downloaded Program Files;C:\Program Files\PC-Doctor for Windows\services;C:\Program Files\SMLNJ\bin\;C:\Program Files\Chez Scheme Version 7.4\bin\i3nt;C:\Program Files\QuickTime\QTSystem\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Qt\2009.03\qt\bin;C:\Qt\2009.03\bin;C:\MinGW\bin;
any ideas..??
Thanks,
C.
When installing mingw, have you selected the checkbox to install mingw's make too?
You could have a look into c:\mingw\bin and see if there is a mingw32-make executable and you could try to launch mingw32-make from a windows console. Probably there is something wrong with your mingw installation.
Hope that helps,
Elrohir