Qt copying files - qt

I'm using qt-opensource-windows-x86-mingw492-5.5.0 on two different machines.
My problem is when it comes to copying files after the build using the following command:
copyfiles.commands += #call xcopy /S /Y /I $${THIRDPARTY_PATH}\\ffmpeg\\Windows\\* $${DESTDIR_WIN}\\debug
My first machine has Visual Studio 2013 but i'm using mingw. This one properly uses the copyfiles.
On my second machine I dont have Visual Studio and when I run the build I get the following errors:
/usr/bin/sh: #call: command not found
I'm not sure why the same Qt install gives two different solutions. I looked at the build steps of the project and both project are the same.
Any ideas?

Your problem is most likely that you have a 'sh.exe' in your PATH on the second machine.
When generating Makefile's, qmake tries to be clever and determines whether it's running from Windows command line (cmd.exe), or from the Unix/Cygwin shell (sh.exe) by checking whether 'sh.exe' is in the current PATH. If it thinks it is running in a Unix shell it well generate a Makefile meant for mingw32-make, otherwise a Makefile meant for nmake.
This test is unfortunately pretty bogus nowadays, mostly because sh.exe is in part of the 'bin' directory of git on Windows. If this is your problem, and you're using git, just make sure that you include the 'cmd' directory of git instead.

Related

Can not call 'make clean' in cmd regarding qmake project

I'm reading Foundations of Qt Development - by Johan Thelin.
Here quote from page 450 about Building QMake Project.
If you choose to create a Makefile using QMake, you can build your project using a simple make command (or nmake if you’re using Visual Studio). You can clean up your intermediate files using make clean. The slightly more brutal step is to run make distclean, which cleans up all generated files, including the Makefile. You will have to run QMake again to get a Makefile for make.
I tried hard to clean the files using 'make clean'. But cmd displaying the message 'make' is not recognized as an internal or external command, operable program or batch file.
I searched here and tried to find the PATH to make inside Qt directory. But not successful. Then according to this solution I tried to use mingw32-make also. But same results.
Anyone of you can help me?
If you using mingw32, try mingw32-make clean. Remember, you must add mingw's bin directory to User Enviroment to use this command. Follow "My Computer" > "Properties" > "Advanced" > "Environment Variables" > "Path" and add ;C:\Qt\Tools\mingw492_32\bin
OR
use command: setx PATH %PATH%;C:\Qt\Tools\mingw492_32\bin

Building Brackets Shell (After running the grunt build command)

On windows after running the grunt build command for creating brackets shell it gives done without errors but i dont see any .exe file generated..
What might be the problem???
Here are some possible solutions:
Are you following the full brackets-shell build instructions, including all prerequisites?
Make sure Brackets isn't running at the same time. The build will fail silently if the .exe file is currently in use (see bug).
Try with a fresh git clone of the repo. If your brackets-shell local copy has been around for a while, sometimes the build & deps folders can get in a bad state. (I'm assuming you haven't modified the source at all. If you have, try with an unmodified copy of the source first to make sure it builds correctly without any of your changes).
Check that python --version shows 2.7.x
Verbose build output would also be helpful in diagnosing issues like this, but unfortunately there's not yet an easy way to get that...
If you follow the instructions on bracket-shell's wiki page, the Windows executable should be created in the Release directory.

how to recompile Qt statically?

I searched whole internet for this problem.
I want compile Qt statically to run my program without any DLL.
I read several instructions in the internet.that they all told me sth like this:
cd %qtdir%
configure -static -[other option]
make sub-src
but when I use make in cmd,I get this error :
'make' is not recognized as an internal or external command,operable program or batch file.
and I tried nmake and mingw32-make too. I don't know in what qt directory I must do this.
I wanna a very simple instruction...
In Linux the default compiler is g++, which provices "make". If you are on Windows, and you want to use "make", you need to install the mingw distribution[1].
As pointed out by Dídac Pérez, if you want to use the MSVC compiler[2], you should use the visual studio command prompt, that sets all the environmental variables for you by calling a bat file.
Therefore the instructions would be:
open a visual studio command prompt and navigate to your Qt source
directory
type "make confclean" to remove traces from a previous compilation
setup a static configuration, by passing the adequate flag (e.g.:
"configure -static ")
type "nmake" to call the visual studio compiler
get a cup of coffee and wait a couple of hours (depending on your
processor(s) :-))
[1]http://www.mingw.org/
[2]http://www.visualstudio.com/en-us/downloads#d-2010-express

netbeans, Qt, & Qmake "command not found"

All,
I am (trying to) using Netbeans to build a simple Qt app (from a tutorial) and I cannot build it because I get this error:
/C/Qt/2010.02.1/qt/qmake/qmake.exe VPATH=. -spec win32-g++ -o qttmp-Debug.mk nbproject/qt-Debug.pro
make[1]:/C/Qt/2010.02.1/qt/qmake/qmake.exe: Command not found
when the file is exactly there, and I can open a terminal and execute it.
Note in the error message: "/C/Qt..." The actual path is C:/Qt...
I have used the tools/options/c++ dialog to browse to the file and select it, and it is specified as C:\Qt... just like all the other tools. What is corrupting the C: and making it /C/ ?
Now, if I remove the path to qmake, and have it use the PATH environment variable, it finds it, but then it fails due to 'multiple targets'...
Obviously, pilot error, but where? I have seen several posts on this, and they all say to make sure it is in the path, and it is, so now what? (I can open a terminal and type 'qmake' and I get the 'Usage: qmake..." so I know it is visible.
Windows 7, Netbeans 7.0, MinGW (I also have cygwin installed...).
Any and all help greatly appreciated.
:bp:
Addenda: I changed the path to my 'make' to use the MinGW one rather than the cygqin one, and now it can find qmake, but I get other errors: 'Could not find mkspecs for your QMAKESPEC(win32-g++) after trying:...
Any additional thoughts?
QMake requires more than just a path to work correctly. On my Windows box, there is a menu option for 'Qt Command Prompt' under the 'Qt SDK 2010.05' group in the Start Menu. Running it produces the following:
Setting up a MinGW/Qt only environment...
-- QTDIR set to C:\Qt\2010.05\qt
-- PATH set to C:\Qt\2010.05\qt\bin
-- Adding C:\Qt\2010.05\bin to PATH
-- Adding C:\WINDOWS\System32 to PATH
-- QMAKESPEC set to win32-g++
You will want to make sure the environment you launch qmake in has all of those set.
The most probable reason you are see '/C/...' is because you are causing a mingw shell to run when you execute your build.

Why does configure.sh think win32 is Unix?

I'm trying to build an application from source in windows that requires some Unix tools. I think it's the apparently standard ./configure; make; make install (there's no INSTALL file). First I tried MinGW but got confused that there was no bash, autoconf, m4, or automake exes in \bin. I'm sure I missed something obvious but I installed Cygwin anyways just to move forward. For some reason when I run
sh configure.sh
I get:
platform unix
compiler cc
configuration directory ./builds/unix
configuration rules ./builds/unix/unix.mk
My OS has identity problems. Obviously the makefile is all wrong since I'm not on unix but win32. Why would the configure script think this? I assume it has something to do with Cygwin but if I remove that I can't build it at all. Please help; I'm very confused.
Also is it possible to build using MinGW? What's the command for bash and is mingw32-make the same as make? I noticed they're different sizes.
Everything is fine. When you are inside CygWin, you are basically emulating an UNIX. sh runs inside CygWin, and thus identifies the OS correctly as Unix.
Have a look at GCW - The Gnu C compiler for Windows
Also, you might be interested in this help page, that goes into some detail about the minimal system (MSYS), such as how to install, configure et. c.
That should help you get bash, configure and the rest to work for MinGW as well.
From the Cygwin home page
Cygwin is a Linux-like environment for Windows. It consists of two parts:
A DLL (cygwin1.dll) which acts as a Linux API emulation layer providing substantial Linux API functionality.
A collection of tools which provide Linux look and feel.
Since configure is using the Cygwin environment, it is interacting against the emulation layer and so it is just like it's working on a Unix environment.
Have you tried building the application and seeing if it works?

Resources