Qt on Mac: where to find "configure" - macos

I am very new to Mac.
I downloaded QT SDK Mac Open source (http://get.qt.nokia.com/qtsdk/qt-sdk-mac-opensource-2010.02.dmg) and installed the Package.
I can run qmake, build samples and run demos,
but I cannot run configure (in order to build the Qt libraries statically).
It says: -bash: No such file or directory.
Documentation says I should run this in the "Qt root folder", but what is this folder in Mac?
I looked for it in /usr/bin, /usr/local/Qt4.6, /Developer/Tools/Qt.
Anyway, what is "configure" on Mac. is it an executable or a script?
Thanks a lot

The SDK download is a pre-built binary library. You need to download the source code version of Qt to be able to configure it to build as static libraries.
The configure script only comes with the source code download version.

I think the SDK only provides the headers and libraries hence the reason you can build applications using Qt. To build Qt itself you will need the source package which is a different download.

Related

How to pack a Vala application under Windows?

On windows I use Vala via MSYS2. How do I properly package the application so that it can run on another computer(along with Gtk). What and where windows should be placed from MSYS2 dll to exe you can run from anywhere?
You are using MSYS2 so you could try a three staged approach:
Create a PKGBUILD file and use makepkg-mingw to build a MSYS2 package of your application
Install MSYS2 in a temporary directory and then your application's MSYS2 package, this will resolve the dependencies
Use a tool like msitools or NSIS to create an installer for the files in your temporary directory, msitools plays nicer with installs in a corporate environment, but is not graphical, NSIS provides a GUI interface
Some references:
Building and distributing your application - GTK Windows download page
How to build your GTK+ application on Windows - detailed instructions for building the intermediate MSYS2 package, by Ignacio Casal Quinteiro
What is major difference between MSI and EXE installation files?

How to build opencv correctly in windows to get "opencv_createsamples.exe"

I want to learn and use haarcascade classifier using OpenCV for detection of object of my choice. I searched the internet and found that createsamples utility helps in creating dataset for positive and negative images. I know how to install OpenCV in python (pip install opencv-python works perfectly) but since I need to use that utility I need to build the OpenCV for my windows system.
My attempts to install OpenCV in windows
Attempt 1 : using MinGW and cmake
cloned latest OpenCV using git at "C:\OpenCV" from https://github.com/opencv/opencv
Installed cmake
created build using cmake at "C:\OpenCV\build" using MinGW(64 bit) build system with default options
ran mingw32-make
ran mingw32-make install
It created an install directory in "C:\OpenCV\build\install"
but to my surprise opencv_createsamples.exe was not present there
opencv_visualisation.exe, opencv_annotation.exe, opencv_version.exe etc. are present
screenshot of install files generated
screenshot of build options selected in cmake by default
It is clear BUILD_opencv_apps is true by default and other apps were created except this one
still in source folder : createsamples.cpp is present in "C:\OpenCV\apps\" along with opencv_visualisation.cpp and others
Attempt 2: visual studio 14_15 build from official site
Downloaded OpenCV latest 4.0.1 from https://github.com/opencv/opencv/releases/download/4.0.1/opencv-4.0.1-vc14_vc15.exe from https://github.com/opencv/opencv/releases webpage
extracted the opencv build at "C:\OpenCV401\"
still to my surprise at "C:\OpenCV401\build\x64\vc14\bin" no opencv_createsamples.exe
likewise other files are present
screenshot of files present in build
Attempt 3
This time I downloaded visual studio 10 build from this github page : https://github.com/abreheret/opencv3.2.0_build
here at <OpenCV_DIR>/x64/vc10/bin/ all the amazing files are present
screenshot of files present in this build
So, my question is :
Why that utility was not built from the source using MinGW and cmake in my first attempt
Why they have not included in the official build
How to build using MinGW and cmake to get that utility correctly (maybe some build configuration needed?)
Createsamples was disabled in latest OpenCV (4.0 and greater): here.

Automatically include Qt libraries in the .app bundle deploying on Mac

I am using Qt Creator to deploy my Qt application. On Mac, I'd like to include the required Qt libraries in the .app bundle. Is there any way to do it automatically using Qt Creator? Should I do it using the command-line? In that case, how should I do it?
The macdeployqt command line tool will add all the necessary Qt libraries that your Qt project references.
If you require any other, 3rd party libraries, you'll need to copy these manually and set the paths to them using the install_name_tool command.
You can check which libraries your application references using the otool command. For example: -
otool -L MyApplication.app/Contents/MacOS/MyApplication
For Qt Creator, I tend to write a script that adds the necessary libraries and calls macdeployqt and then under Projects, add a build step which calls the script.
An example script that would just add the Qt libraries would look something like this: -
#!/bin/bash
pwd
echo Copying QT libraries...
macdeployqt ./MyApplication.app
You can simply run macdeployqt foo.app. Qt Creator does not support this feature off-hand either. However, you can inject custom commands into your process in the QtCreator project settings.
It does not support QML just yet though. There are patches under codereview where it is coming. See the following link for details:
https://codereview.qt-project.org/#q,status:open+project:qt/qttools,n,z
Note: macdeployqt should not be used for usual development and debug! It should be only used when deploying. Otherwise, it is executed each time for building even if you just recompile the code due to a minor change for testing. This can slow down that process, but as for deploying, it should be alright.
On QT6 I was able to do it entirely within QT Creator:
In Projects/Build, add a custom build step after 'make' (probably only want to do this for your 'release' configuration):
Command: %{Qt:QT_HOST_PREFIX}/bin/macdeployqt
Arguments: %{ActiveProject:BuildConfig:Path}/%{ActiveProject:Name}.app - qmldir=%{ActiveProject:NativePath}
Working Directory: %{buildDir}
I was able to test it by airdropping the resulting .app onto my test machine.
reference: https://doc.qt.io/qt-6/macos-deployment.html#macdeploy

Trying to build static Qt project, cannot find configure.exe

I'm trying to follow the advice in this question:
Building Qt 4.7.3 (latest) on windows
It talks about where configure.exe is. In my installation, which includes 4.7.4 and 4.8.1 for Windows, I only find configure.exe in Symbian/SDKs/Symbian3Qt474/
Is this the right executable, and should I be adding that Symbian directory to my %PATH% so the Visual Studio command prompt can find it?
This just doesn't seem to be in the right place.
Make sure you have downloaded the Qt libraries and not the SDK. The SDK is a binary distribution, the source code in it is generally only for reference purposes.

qt configuration on windows

I'm having some trouble installing and configuring qt on my vista laptop.
I'm trying to setup a development environment on my laptop where I compile from the command line, because that's how the environment is setup on my university's linux machines, so I don't want to tie myself to some IDE .. (plus, real programmers use the command line!)
I haven't used the command line before for C++ development, it was all MSVC, so now I'm having a bit of trouble.
I'm still using MSVC, but from the command line. I practically have no idea what's going on, I just know that I have to run:
qmake
nmake
to compile my code!
I downloaded the opensource version of qt, and did the configuration, and tried a simple qt application (from a tutorial) and it worked, it compiled and executed pretty much as expected.
Now, when I decided to run another project that uses opengl, I got the following error:
fatal error C1083: Cannot open include file: 'qgl.h': No such file
or directory
I'm not sure where does the compiler look for header files, and I didn't copy any header files anywhere, I assume that configure.exe worked its magic somehow and added the include directory to one or more enviroment variables or to some registery location or whatever other peculier places that the MSVC compiler searches for to find include directories.
However, what I did was search my C:\qt\include\ folder to make sure that qgl.h exists, and sure enough there it was. so why can't nmake find it?
I think the actual solution to this is in your pro file:
QT += opengl
If you want to stay with the command line anyway (plus use it on a linux box later / parallel) I'd suggest at least trying out the MinGW version of Qt. I'm using it regularly, and besides of the non-existance of a GUI it works pretty well. Using MinGW also has the advantage that you can simply download and install the MinGW edition of Qt and don't need to reconfigure or recompile anything.
Also, trying out QtCreator might be interesting. It's still beta and requires the beta Qt 4.5 but it's a nice small IDE that integrates nicely with gcc.
Two potential solutions (they solved issues at my workplace)
Do you have qt include and bin folders in the PATH variable? I think the doc says only one of these is needed, but one of the students had Vista and putting the other in the PATH variable solved a "Cannot open include file" problem.
If you're using MSVC did you run configure and nmake from the Visual Studio command prompt? We had problems when using the bare windows Command Prompt because the VS one adds a lot of temporary environment variables to the configure process.
Good luck
Install the complete Qt SDK for Windows which includes Qt 4.6 SDK, Qt Creator 1.3, and MinGW.
It will also install "Qt Command Prompt" launcher that you can use to build Qt apps from the command line.
I'm sure you're more familiar with MSVC than MinGW, as I do too (I've been using MSVC 6.0 to MSVC# 2008 for developing .NET apps).
But try MinGW with Qt and I think it's better for long term. I do some C++ development on Linux too so getting familiar with MinGW will be beneficial for you in cross-platform C++/Qt development.
For more info, see Installation of Qt 4.6 SDK for Windows.
Qmake generates Makefile from *.pro file located in current directory. It has qt path compiled in. Type "qmake -v" to see it. You can't move qt's dir after compiling it. If You haven't moved it, first maybe try to install Qt following instruction from INSTALL file. Good luck.
The opensource version of Qt does not provide profiles (mkspecs in qt terms) so qmake can generate nmake (msvc) compatible makefiles.
You have to use mingw/gcc.

Resources