qmake hangs in windows 7 - windows

I have a strange error with qmake: To compile octomap, first I need to compile octovis code, accordingly with documentation I need to use:
cd octovis/src/extern/QGLViewer
qmake
mingw32-make
But when I use qmake, they just do nothing, seeing the task monitor the amount of memory used is constant and the amount of processor used is 0.
I tried to uninstall/reinstall QT and MinGW, and didn't work, I have change the version of QT (4.8.5, 4.8.6, 5.5) and MinGW and didn't work, I'm using windows 7 over 64 bits. I appreciate any solution.

I was able to generate the qmake files with no problem. make failed, but my environment is QT 5.5.1, which I doubt is compatible. I can tell you how my environment is set up, and that should get you going.
Go ahead and download QT Creator for whatever version of QT you require. This includes the appropriate mingw version, so they don't need to be downloaded separately. http://download.qt.io/archive/qt/
Find out what version of QT is recommended. It looks like 4.X, but I'm not 100 percent certain.
Add X:/QTCREATOR/QTVERSION/mingw/bin to your system path, with QTCREATOR being the root directory for QT Creator and QTVERSION being the version. These are included with the QT Creator install.
Also add X:/QTCREATOR/Tools/mingw/bin to your system path.
I'm assuming you have CMake already. That's obviously required.
This should have your build environment set up properly. You're sure to encounter other problems along the way.
The best option appears to just run it under Linux. There are pre-compiled binaries.

Related

Gstreamer on windows

I'd like to build application using Gstreamer 1.0 and GTK+-3.0 on Windows 8 (64bit).
I have sucessfully install and build GTK+-3.0, 32 bit version using Dev-C++ and Mingw 32-bit (there is no 64 bit version of GTK+). Everything works perferkt. It also installed pkg-config, I addeded it in %PATH% and it works.
I have installed gstreamer-1.0-devel-x86-1.4.4.msi and gstreamer-1.0-x86-1.4.4.msi from here
1) First problem: it installed itself into I:\gstreamer\ without asking me. I am very unhappy about it, I'd like have it on C:. But its not the biggest problem.
2) pkg-config do not know about gstreamer. I have found in I:\gstreamer\1.0\x86\lib\pkgconfig\ *.pc files, so I looked into gstreamer-1.0.pc and added to my projekt this options:
C compiler:
-I"I:/gstreamer/1.0/x86/include/gstreamer-1.0/"
Linker:
-L"I:/gstreamer/1.0/x86/lib" -lgstreamer-1.0
3) Now the program was compiled, but when I run it, it was not able to find gstreamer-1.0-0.dll. So i tried copy I:\gstreamer\1.0\x86\bin\gstreamer-1.0-0.dll into to the same directory as is my compiled file. Then it was not able to find libwinptread-1.dll. So I copied it also.
Then te program run, but it faild with some error like "cannot find entry point to windows thread ..." (I do not remember it exactly). So I copied ALL dll files from I:\gstreamer\1.0\x86\bin\ and then finally the program run.
But now it is not able to create elements:
source = gst_element_factory_make ("videotestsrc", "source");
//source is null
So, my question is, how to install gstreamer, that my program will find all dll files and will be able to create elements?
installing -- choose "custom install", there you can change the installation path.
for vs you can use *.props (gstreamer\1.0\x86\share\vs\2010\libs)
you need set Environment variable - GST_PLUGIN_SYSTEM_PATH_1_0 to plug-ins. For more details see http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gst-running.html

qmake install without sdk (Win)

I'm using qmake as build system in my project. And not using qt sdk. How correctly install qmake without sdk on clean mashine(win7 + msvc). Simple copy bin, mkspec dirrectories wrong result. I can't speciefied qmake tools in QtCreator (invalid profile).
Try this solution. Maybe you already test this method. It slightly different from that what you told in question. They use qt.conf for something. Sorry I don't know for what purpose

How to compile Qt for 64-bit Windows from a 32-bit environment with Visual C++ 2010 Express?

I am trying to compile the Qt library (I don't need the demos or examples) for 64-bit Windows. There are instructions here but I run into the error described in the comment below it. There doesn't seem to be a reference anywhere for how one might go about doing this process.
I am targetting Microsoft Visual C++ 2010 Express. It looks like I need Perl and the Windows SDK as well - how do I go about this process?
This process is quite tedious and time-consuming - but I will explain each step in detail here for the benefit of others who try to compile Qt in the future.
The first step is to install all of the prerequisites.
ActivePerl, which is used during the configuration process. You will need to restart after installing Perl since it modifies environment variables.
The Windows SDK 7.1 (formerly called the Platform SDK). Be sure to include the x64 libraries when you select the components to install.
Download the Qt source archive from the Qt Downloads page.
Extract the contents of the archive to an easy-to-remember location (like C:\). You need to remember this location later since we will be using it to set some environment variables.
Now open the Windows SDK 7.1 Command Prompt. Begin by setting the environment to 32-bit release mode (we need to build some of the tools as 32-bit applications):
setenv /release /x86
Set the following environment variables (example below assumes you extracted to C:\):
set QTDIR=C:\qt-everywhere-opensource-src-4.8.0
set PATH=%PATH%;%QTDIR%\bin
Now run cd %QTDIR% and specify the configuration options - example is included below:
configure -release -opensource -qt-zlib -qt-libpng -qt-libmng -qt-libtiff
-qt-libjpeg -qt-style-windowsxp -qt-style-windowsvista -platform
win32-msvc2010
Once the configuration process is complete, cd to the src directory and run:
qmake
nmake
This process may take a considerable amount of time, so now would be a good time to take a break and answer some questions here on Stack Overflow :)
The tools are now built and you need to compile Qt as a 64-bit library. Enter the following command:
setenv /x64
You will need to set the environment variables from step 5 again. Enter those commands now.
Run cd %QTDIR% and then rerun the configure command being sure to specify one additional option:
configure -release -opensource -qt-zlib -qt-libpng -qt-libmng -qt-libtiff
-qt-libjpeg -qt-style-windowsxp -qt-style-windowsvista -platform
win32-msvc2010 -no-qmake
The -no-qmake option is very important - it indicates that we want to skip the compilation of the qmake.exe program because we want to keep the 32-bit version.
Now things get really complicated here because of some dependency problems. The tools (like moc) that Qt needs to build the core library and some of the other components are listed as dependencies in the src.pro file. This means that the compiler will attempt to build them as 64-bit applications and then try to run them - which will of course fail on a 32-bit system. So what we need to do is edit src.pro and remove those dependencies ourselves. Scroll down near line 85 and look for a line that begins with:
!wince*:!ordered:!symbian-abld:!symbian-sbsv2 {
Each subsequent line in the section lists a sub-target and its dependencies. What you want to do now is remove all dependencies that begin with src_tools_. For example:
src_gui.depends = src_corelib src_tools_uic
Becomes:
src_gui.depends = src_corelib
There might be a better way of doing this, but I haven't figured it out yet :)
Now we cd into the src directory once again and run the following command
nmake sub-winmain sub-corelib sub-xml sub-network sub-sql sub-testlib
sub-gui sub-qt3support sub-activeqt sub-opengl sub-xmlpatterns sub-phonon
sub-multimedia sub-svg sub-script sub-declarative sub-webkit
sub-scripttools sub-plugins sub-imports
This builds only the Qt libraries and skips the tool dependencies. Note that this too may take a considerable amount of time.
You should now have 64-bit libraries in the lib folder that you can link against in your 64-bit Qt applications.
Edit: it turns out that even this wasn't enough since I still ran into some problems when linking the QtWebKit4.dll library (something about unresolved symbols). It turns out that someone else has already found the solution and you need to change QMAKE_HOST.arch to QMAKE_TARGET.arch in WebCore.pro.
Also, the above options will build QNetwork4.dll without OpenSSL support (you won't be able to access sites over HTTPS - even in a QWebView). This, thankfully isn't too hard to fix. Download and build OpenSSL for Win64 and append the options below to the command in step #9:
-openssl -I C:\OpenSSL\inc32 -L C:\OpenSSL\out32dll
(You'll have to change the paths if you installed OpenSSL somewhere other than C:\OpenSSL.)
Further edit: to save the trouble of doing this yourself, I have uploaded the compiled libraries here:
http://www.box.com/s/9710cbb278ef4890a7b5
As I mentioned in the comments to George Edison's answer, there is a bug in the Microsoft Visual C++ compiler that comes with the Windows SDK 7.1. For more information on this, see QTBUG-11445 and QTBUG-19175.
I have compiled the Qt 4.8.2 64-bit binaries following George's instructions, including the OpenSSH library. In addition, I applied Microsoft's hotfix to fix the compiler bug.
For your convenience, I have made the resulting 64-bit libraries available for download from here: https://www.box.com/s/8948c60c3cdd743ef83b

On OS X, what is the proper setting for $QTDIR?

I'm trying to install QtROOT, and as part of the installation (specifically, the readme file in the QtROOT tarball at http://root.bnl.gov/QtRoot/downloads/qtFullRoot.tar.gz), it mentions to make sure that QTDIR is set. I've installed from the Qt 4.6.3 SDK installation for Mac OS X, and I have no such environment variable set. I've tried googling to figure out where it should be set to, but the options I've found (such as /usr/local/qt) don't exist. What should this variable be set to?
OS X 10.6.4, Qt 4.6.3, ROOT 5.26/00, QtROOT... I have no idea. :P
Thanks,
Paul
Qt's packaged installer for OSX scatters things throughout the /Developer and /Library directories rather than installing to a self-contained location in /usr/local or /opt/local as you might expect it to do on other unix-based systems.
Incidentally, Qt follows Apple's way of doing things in this respect, so it's really not wrong -- it's just different -- but it does make some 3rd party Qt applications somewhat difficult to build on OSX.
The packaged Qt installer itself has the following to say on this topic:
After a successful install, you can find most new things in /Developer. Specifically things will be located in the following places:
Qt Designer, Qt Linguist: /Developer/Applications/Qt
Qt Documentation: /Developer/Documentation/Qt
Qt Examples: /Developer/Examples/Qt
Qt Plugins: /Developer/Applications/Qt/Plugins
Qt Frameworks: /Library/Frameworks
Qt Libraries: /usr/lib
qmake, moc, uic, etc.: /Developer/Tools/Qt (symlink to /usr/bin)
Uninstall script: /Developer/Tools/uninstall-qt.py
So, it does put the libs into '/usr/lib', and it symlinks the essential Qt tools (like qmake) into '/usr/bin'. This suggests that QTDIR could be set to '/usr'. In practice however, this doesn't work because the qt headers remain buried in '/Library/Frameworks/Qt*/Headers/*.h', while builds that rely on $QTDIR will end up looking for the qt headers in "${QTDIR}/include/" instead.
The easiest way around all this is to build Qt from source. The install location will default to something like /usr/local/Trolltech/Qt-4.6.3 (note the version number, and adjust accordingly). You can override the default install location by using the -prefix option on ./configure.
A simpler approach is to let macports build it for you. This is the approach I ended up taking (and with good success). Just install macports, if you don't already have it. Then:
> sudo port selfupdate
> sudo port install qt4-mac
Macports will work its magic, and when it's done Qt will be installed, in its entirety, at /opt/local/libexec/qt4-mac.
Regardless of how you build Qt, expect a full build to take several hours. It's a very large code base.
I didn't install Qt from the installer (but compiled it myself), so I don't know the default location.
However, where you installed Qt, there is your QTDIR.
Search for qmake, it should reside in some bin/ folder. one up is QTDIR ($QTDIR/bin/qmake).
Usually it's not necessary anymore to set QTDIR these days to build a Qt project, just qmake must be in the PATH, everything else found then. But some projects might require it though (if they use a custom build system that still uses QTDIR).
I need to install LiteIDE on my mac and in the install guide, the QTDIR is necessary. I install the qt with the homebrew by brew install qt --build-from-source, it takes about 2 hours in RMBP. After the install finished, there is still no QTDIR path. By checking the build_osx.sh, i know it's just the parent folder of bin. so i set the path by export QTDIR=/usr/local/Cellar/qt/4.8.6. Then run the ./build_osx.sh again. it works.
Hope this will be helpful.

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