How to compile Qt 3.3.6 for use in VC2012? - qt

I need to compile Qt 3.3.6 on my Win 7 PC to use it in combination with my MSVC2012 C++ compiler (MSVS 2012 Professional).
The simple reason is that I have a Qt 3.3.6 license and a lot of Qt 3.3.6 source code. So, a Qt upgrade is not an option. "Google" does not help...
Edited:16/11/10 1:40 pm
I already tried to compile it by starting a shell via VS2012 (Tools/VisualStudioCommandPrompt) and changing the cwd to the Qt directory containing the appropriate Makefile:
C:\Qt\3.3.6>bin\configure.exe -redo -spec win32-msvc2012
License file not found in C:/Users/mdew
Enterprise modules will not be available.
QMAKESPEC...................win32-msvc
Maketool....................nmake
[...list of all the installed programs...]
Configuration:
nocrosscompiler
dialogs
iconview
kernel
styles
tools
widgets
workspace
minimal-config
small-config
medium-config
large-config
full-config
release
thread
no-gif
zlib
jpeg
mng
png
bigcodecs
no-tablet
Debug symbols...............no
Thread support..............yes
Accessibility support.......no
Big Textcodecs..............yes
Tablet support..............no
STL support.................yes
Additional exports..........no
Exception support...........yes
RTTI support................yes
OpenGL support..............no
Image formats:
GIF support.............no
MNG support.............qt
JPEG support............qt
PNG support.............qt
Styles:
Windows.................yes
Windows XP..............no
Motif...................yes
Platinum................yes
MotifPlus...............yes
CDE.....................yes
SGI.....................yes
Sql Drivers:
ODBC....................no
MySQL...................no
OCI.....................no
PostgreSQL..............no
TDS.....................no
DB2.....................no
SQLite..................no
Interbase...............no
Sources are in..............C:\Qt\3.3.6
Install prefix..............C:\Qt\3.3.6
Headers installed to........C:\Qt\3.3.6\include
Libraries installed to......C:\Qt\3.3.6\lib
Plugins installed to........C:\Qt\3.3.6\plugins
Binaries installed to.......C:\Qt\3.3.6\bin
Docs installed to...........C:\Qt\3.3.6\doc
Data installed to...........C:\Qt\3.3.6
Translations installed to...C:\Qt\3.3.6\translations
Creating qmake...
Microsoft (R) Program Maintenance Utility Version 11.00.61030.0
Copyright (C) Microsoft Corporation. All rights reserved.
cd qmake
NMAKE : fatal error U1077: 'cd' : return code '0x1'
Stop.
Building qmake failed, return code 2
So, my attempt to compile it via MSVS2012 failed. NMAKE gets in trouble.
What am I doing wrong?
Thank you in advance for any hint!
BR mdew

have tried to compile Qt 3.3.6 from source with MSVC2015 and I've success.
Download Qt 3 source from https://sourceforge.net/projects/qtwin/files/Unofficial%20Qtwin/qt-win-3.3.6-6/
you must have QTDIR environment variable
set QTDIR=<your path to Qt 3 folder>
make sure bin folder is in your PATH
set PATH=%QTDIR%\bin;%PATH%
replace PATH_MAX with MAX_PATH in following files:
src\tools\qdir_win.cpp
src\tools\qdir.cpp
comment or remove
#include <winable.h>
from
src\kernel\qaccessible_win.cpp
run
configure.bat --help
configure.exe and link_includes.exe will be generated in bin folder.
cd bin
configure.exe -no-dsp -v
if you get errors saing error C3688: invalid literal suffix 'QTDLL_POSTFIX'
delete all QTDLL_POSTFIX in this files:
qmake\generators\win32\borland_bmake.cpp
qmake\generators\win32\mingw_make.cpp
qmake\generators\win32\msvc_dsp.cpp
qmake\generators\win32\msvc_nmake.cpp
qmake\generators\win32\msvc_vcproj.cpp
and change
QString dllStem = stem + QTDLL_POSTFIX;
to
QString dllStem = stem;
in
qmake\generators\win32\winmakefile.cpp
rerun
configure.exe -no-dsp -v
it should now compile successfully

Related

Unable to build project with JOM

I'm trying to build a project with MSVC 2013 and Qt Creator 4.4.0 with JOM and was having issues to configure JOM. So, I tried to erase Qt Creator's configuration files completely and start from scratch.
In the fresh Qt configuration, after I opened the project, I set the CMake (3.9.3) location and ran CMake on the project. Unfortunately, by default, the Qt 5.6.3 Kit seems to choose the NMake generator instead of the NMake JOM generator. After deleting the build directory, I changed the generator to NMake JOM in the Kit configurations, but met the following error message:
CMake Error: Generator: execution of make failed. Make command was: "jom" "/NOLOGO" "cmTC_276f9\fast"
Any idea of why this is happening? As far as I remember, Qt Creator is supposed to build the projects with JOM by default.
I had the same exact problem. Add the location of jom.exe (typically it is path like [...]\Qt5.12.1\Tools\QtCreator\bin\) to your PATH.

Cmake can't find Qt OpenGL library

I'm trying to compile a project using cmake. The instructions given to me was that Qt 4.8 is needed. Downloaded it from qt-project.org/downloads. Compiled and installed Qt 4.8:
mazdak#lnxamindai> qmake -query
QT_INSTALL_PREFIX:/usr/local/Trolltech/Qt-4.8.5
QT_INSTALL_DATA:/usr/local/Trolltech/Qt-4.8.5
QT_INSTALL_DOCS:/usr/local/Trolltech/Qt-4.8.5/doc
QT_INSTALL_HEADERS:/usr/local/Trolltech/Qt-4.8.5/include
QT_INSTALL_LIBS:/usr/local/Trolltech/Qt-4.8.5/lib
QT_INSTALL_BINS:/usr/local/Trolltech/Qt-4.8.5/bin
QT_INSTALL_PLUGINS:/usr/local/Trolltech/Qt-4.8.5/plugins
QT_INSTALL_IMPORTS:/usr/local/Trolltech/Qt-4.8.5/imports
QT_INSTALL_TRANSLATIONS:/usr/local/Trolltech/Qt-4.8.5/translations
QT_INSTALL_CONFIGURATION:/etc/xdg
QT_INSTALL_EXAMPLES:/usr/local/Trolltech/Qt-4.8.5/examples
QT_INSTALL_DEMOS:/usr/local/Trolltech/Qt-4.8.5/demos
QMAKE_MKSPECS:/usr/local/Trolltech/Qt-4.8.5/mkspecs
QMAKE_VERSION:2.01a
QT_VERSION:4.8.5
However, when compiling the project I received the following error:
root#lnxamindai> cmake .
-- Setting flags for GNU GCC
-- REQUIRED_VARS (missing: QTMOBILITY_INCLUDE_DIR QTMOBILITY_MULTIMEDIAKIT_INCLUDE_DIR QTMOBILITY_MULTIMEDIAKIT_LIBRARY VERSION_VAR QTMOBILITY_VERSION)
Qt QTOPENGL library not found.
-- Buiding ManyEarsLib Library...
-- Buiding RTAudio Library...
-- Found jack: /usr/lib/libjack.so
ALSA lib : -lasound -lpthread
Qt QTOPENGL library not found.
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
OPENGL_INCLUDE_DIR (ADVANCED)
used as include directory in directory /home/mazdak/dev/ManyEars/manyears/QtGUI
QTMOBILITY_MULTIMEDIAKIT_LIBRARY (ADVANCED)
linked by target "ManyEars" in directory /home/mazdak/dev/ManyEars/manyears/QtGUI
-- Configuring incomplete, errors occurred!
CMakeLists.txt:
(...)
IF (NOT MANYEARS_GUI_DISABLED)
SET(QT_USE_QTNETWORK TRUE)
SET(QT_USE_QTSVG TRUE)
SET(QT_USE_QTXML TRUE)
SET(QT_USE_QTSCRIPT TRUE)
SET(QT_USE_QTOPENGL TRUE)
SET(QT_USE_QTMULTIMEDIA TRUE)
find_package(QtMobility COMPONENTS MultimediaKit)
find_package(Qt4 4.8.0 QUIET)
if (QTMOBILITY_FOUND)
MESSAGE("QT_MOBILITY_INCLUDE_DIR : ${QTMOBILITY_INCLUDE_DIRS} QT_MOBILITY_LIB: ${QTMOBILITY_LIBRARIES}")
ENDIF (QTMOBILITY_FOUND)
if(QT4_FOUND AND (QT_QTMULTIMEDIA_FOUND OR QTMOBILITY_FOUND))
include(${QT_USE_FILE})
else(QT4_FOUND AND (QT_QTMULTIMEDIA_FOUND OR QTMOBILITY_FOUND))
MESSAGE("WARNING : ManyEars GUI will not be compiled because Qt4 not found or obsolete. You need Qt 4.8 or higher.Try using the latest QtSDK from http://qt-project.org")
MESSAGE("DEBUG: QT4_FOUND: ${QT4_FOUND} QT_MULTIMEDIA_FOUND: ${QT_QTMULTIMEDIA_FOUND} QT_MOBILITY_FOUND: ${QTMOBILITY_FOUND}")
SET(MANYEARS_GUI_DISABLED TRUE)
endif(QT4_FOUND AND (QT_QTMULTIMEDIA_FOUND OR QTMOBILITY_FOUND))
ELSE (NOT MANYEARS_GUI_DISABLED)
MESSAGE("ManyEars GUI disabled.")
ENDIF (NOT MANYEARS_GUI_DISABLED)
#Files excluded from package
set(CPACK_SOURCE_IGNORE_FILES
"build"
"bin"
${CPACK_SOURCE_IGNORE_FILES}
".svn"
)
#include files
(...)
IF (UNIX)
#########################################
# Packaging stuff for sources (All UNIX)
#########################################
SET(CPACK_SOURCE_GENERATOR "TGZ")
SET(CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/COPYING.TXT")
SET(CPACK_PACKAGE_NAME "ManyEars")
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "ManyEars")
SET(CPACK_PACKAGE_VENDOR "Francois Grondin, Dominic Letourneau")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/README.TXT")
SET(CPACK_PACKAGE_CONTACT "blablablabla")
(...)
ENDIF(UNIX)
(...)
INCLUDE(CPack)
This is confusing me, shouldn't the OpenGL library be installed?
This is confusing me, shouldn't the OpenGL library be installed?
It's not complaining about OpenGL. It's complainting about Qt's OpenGL module QtOpenGL which is a different thing. Most likely your custom build of Qt doesn't include the QtOpenGL module. You've to go back building Qt and take extra care that you enable build of the QtOpenGL module.
After some research I found out that I needed to install some development packages if I was compiling from the source code.
apt-get install libfontconfig1-dev libfreetype6-dev libx11-dev libxext-dev libxfixes-dev libxi-dev libxrender-dev libxcb1-dev libx11-xcb-dev libxcb-glx0-dev libxcb-keysyms1-dev libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev libxcb-sync0-dev libxcb-xfixes0-dev libxcb-shape0-dev libxcb-randr0-dev libxcb-render-util0-dev
When configuring the Qt source code I had forgot to specify that I wanted to install the OpenGL module and the Multimedia Kit. I just naturally ran "configure" without any options and hoped for the best.
./configure --help
Specifies that I needed -multimedia and -opengl.
When I executed configure with the correct options the issue was resolved.
./configure -multimedia -opengl
Note that the multimedia kit needs gstreamer installed.

Can't Install QtMobility [Windows 64-bit]

I've downloaded and installed the QT SDK and downloaded the QT Mobility source.
Following the provided instructions, I navigated to my QtMobility directory via the Visual Studio Command Prompt (2010)... note, this is the QtMobility dir with the bin, plugins, examples, etc. folders.
D:\
cd D:\Files\Downloads\QtMobility
configure
Regardless of whether I gave configure a -prefix parameter or not, the following output was displayed:
Checking available Qt
4.8.2
Checking make
... Unknown target environment .
Cannot find 'nmake', 'mingw32-make' or 'make' in your PATH
Aborting.
Of course, I then went to see if my computer had nmake in its PATH: the directory is added as follows:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin
I went to CMD and typed in "nmake /?" to receive proper output.
What am I doing wrong? When I try to simply run nmake in the QTMobility directory, it displays:
NMAKE : fatal error U1064: MAKEFILE not found and no target specified
Stop.
Help, please! Thank you. :) I will continue attempting debugs on my own...
I suppose this is late but you could simply run the visual studio command prompt, as it has specific env. variables preset to find nmake, etc.

compiling musescore for uCLinux with QT and cmake

I've try few things but I still have this error when trying to cmake for blackfin:
CMake Error at CMakeLists.txt:116 (message):
Fatal error: QT (version >= 4.5.0) required. Cmake tries to detect QT4 by
searching for 'qmake' in your PATH.If you have QT4 installed, make sure
qmake is found in your PATH. If you compiled QT4 yourself make sure your
new qmake ist found _first_ in your PATH.
I'm trying to compile the source of musescore 0.9.5 to keep it compatible with the existing version of QT in uClinux options
What I did is to compile the uClinux kernel with QT lib so I can have the suitable embedded QT.
then I modified the Makefile of musescore to build with uclinux compilers. I've try different things so I show here the latest trial:
bfin:
mkdir build;
mkdir install; \
cd build;
cmake -DCMAKE_TOOLCHAIN_FILE=bfin.cmake -DCMAKE_VERBOSE_MAKEFILE=TRUE -\
DQT_QMAKE_EXECUTABLE=/home/william/Development_new/Music_Recognition/code/uCLin\
ux/rev2011R1/uclinux-dist/lib/qt-embedded/build-qt-embedded-linux-opensource-sr\
c-4.5.1/bin -libdir=/home/william/Development_new/Music_Recognition/cod\
e/uCLinux/rev2011R1/uclinux-dist/lib/qt-embedded/build-qt-embedded-linux-openso\
urce-src-4.5.1/lib \
-DCMAKE_INSTALL_PREFIX="${PREFIX}" \
mscore;
in the CMakeLists.txt I did add:
link_directories(/home/william/Development_new/Music_Recognition/code/uCLinux/r\
ev2011R1/uclinux-dist/lib/qt-embedded/build-qt-embedded-linux-opensource-src-4.\
5.1/bin)
SET(CMAKE_MODULE_PATH /home/william/Development_new/Music_Recognition/code/uCLi\
nux/rev2011R1/uclinux-dist/lib/qt-embedded/build-qt-embedded-linux-opensource-s\
rc-4.5.1/bin)
SET(CMAKE_PREFIX_PATH /home/william/Development_new/Music_Recognition/code/uCLi\
nux/rev2011R1/uclinux-dist/lib/qt-embedded/build-qt-embedded-linux-opensource-s\
rc-4.5.1/bin)
SET(QT_QMAKE_EXECUTABLE /home/william/Development_new/Music_Recognition/code/uC\
Linux/rev2011R1/uclinux-dist/lib/qt-embedded/build-qt-embedded-linux-opensource\
-src-4.5.1/bin)
my bfin.cmake look like that:
# this one is important
SET(CMAKE_SYSTEM_NAME Linux)
#this one not so much
SET(CMAKE_SYSTEM_VERSION 1)
#
SET (BFIN "/opt/uClinux/bfin-uclinux")
# specify the cross compiler
SET(CMAKE_C_COMPILER ${BFIN}/bin/bfin-uclinux-gcc)
SET(CMAKE_CXX_COMPILER ${BFIN}/bin/bfin-uclinux-g++)
SET(CMAKE_LINKER ${BFIN}/bin/bfin-uclinux-ld)
#/opt/uClinux/bfin-uclinux/bfin-uclinux/runtime/usr/lib
LINK_DIRECTORIES("${BFIN}/usr/lib")
SET(CMAKE_FIND_ROOT_PATH
/opt/uClinux/bfin-uclinux/bfin-uclinux
/opt/uClinux/bfin-linux-uclibc
/opt/uClinux/bfin-linux-uclibc/bfin-linux-uclibc/runtime)
# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
Thanks in advance for the help,
William
You need to put qmake in your $PATH. If you prefer to use QT_QMAKE_EXECUTABLE it has to point to the actual qmake binary and not the directory.
That being said, MuseScore 0.9.5 is a very very old version of MuseScore, the current version is 1.1 and 1.2 is coming soon. Check http://musescore.org for more information about MuseScore and don't hesitate to contact the developers on #musescore on freenode.net or on the developer mailing list at http://musescore.org/mailing-list

Qt 4.5.2 - linux - change library root

I have 2 versions of Qt for different arm devices and different toolchains: Qt 4.5.2 and Qt 4.7.3. Both versions are supposed to be placed in /opt/onyx/arm directory :(
The following error is occurred if I move the 1st Qt build in another directory (/usr/arm-marvell-linux-gnueabi) and run qmake:
#!/bin/sh
export QTDIR=/usr/arm-marvell-linux-gnueabi
/usr/arm-marvell-linux-gnueabi/bin/qmake -o Makefile.qt.onyx.a6x -spec qws/arm-marvell-linux-gnueabi-g++ project.pro
./run_qmake1.sh
Could not find mkspecs for your QMAKESPEC(qws/arm-marvell-linux-gnueabi-g++) after trying:
/opt/onyx/arm/mkspecs
Error processing project file: project.pro
What could be the issue and how can I resolve the /opt/onyx/arm conflict?
I would recommend grepping through /usr/arm-marvell-linux-gnueabi for any references to /opt/onyx. If you can't successfully change them (because they're in a binary), you could use symlinks to switch toolchains as needed.

Resources