Failure on building Qt5 from source on Windows - c++

As I would like to build my Windows version of Qt5 application (C++) statically, I downloaded the source of Qt5 from git. Installed all dependencies like Python, Perl, etc. When I ran the following command
configure.bat -static -opensource -release -nomake examples -nomake tests -platform win32-g++ -c++11 -opengl desktop -no-icu -skip qtwebkit
Everything was fine and the config program said "Qt is now configured for building. Just run mingw32-make."
When I execute as requested, it ran for minutes but result in a following error at the end.
mingw32-make[4]: Entering directory 'c:/Users/lmh/Desktop/proj/QT/qt5-real/qtbas
e/src/tools/moc'
g++ -Wl,--gc-sections -Wl,-s,--gc-sections -Wl,-subsystem,console -o ../../../bi
n/moc.exe .obj/release/moc.o .obj/release/preprocessor.o .obj/release/generator.
o .obj/release/parser.o .obj/release/token.o .obj/release/main.o -LC:/Users/lmh
/Desktop/proj/QT/qt5-real/qtbase/lib -lQt5Bootstrap -luser32 -lole32 -ladvapi32
-lshell32 -lz
C:/Users/lmh/Desktop/proj/QT/qt5-real/qtbase/lib/libQt5Bootstrap.a: could not re
ad symbols: Archive has no index; run ranlib to add one
collect2.exe: error: ld returned 1 exit status
Makefile.Release:100: recipe for target '../../../bin/moc.exe' failed
mingw32-make[4]: *** [../../../bin/moc.exe] Error 1
mingw32-make[4]: Leaving directory 'c:/Users/lmh/Desktop/proj/QT/qt5-real/qtbase
/src/tools/moc'
Makefile:34: recipe for target 'release' failed
mingw32-make[3]: *** [release] Error 2
mingw32-make[3]: Leaving directory 'c:/Users/lmh/Desktop/proj/QT/qt5-real/qtbase
/src/tools/moc'
Makefile:84: recipe for target 'sub-moc-make_first' failed
mingw32-make[2]: *** [sub-moc-make_first] Error 2
mingw32-make[2]: Leaving directory 'c:/Users/lmh/Desktop/proj/QT/qt5-real/qtbase
/src'
Makefile:41: recipe for target 'sub-src-make_first' failed
mingw32-make[1]: *** [sub-src-make_first] Error 2
mingw32-make[1]: Leaving directory 'c:/Users/lmh/Desktop/proj/QT/qt5-real/qtbase
'
Makefile:50: recipe for target 'module-qtbase-make_first' failed
mingw32-make: *** [module-qtbase-make_first] Error 2
Did anyone encounter similar problem before? I have used similar approach to compile source on Linux, I do not understand why it failed on Windows. I would be glad to know what is wrong with my approach. Thank you very much.

Related

C++ application failing to build with 'cannot find -lmysqlpp' but it appears to be there

I'm trying to build an application with Netbeans and getting the following error:
/usr/bin/ld: cannot find -lmysqlpp
I believe this exists as per the below screen shots;
and here in my includes from Netbeans;
The below is the full output from Netbeans;
cd '/media/psf/DL/DL_src/FEC_src/docugirl'
/usr/bin/make -f Makefile CONF=Debug
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/media/psf/DL/DL_src/FEC_src/docugirl'
"/usr/bin/make" -f nbproject/Makefile-Debug.mk /app/bin/docugirl
make[2]: Entering directory '/media/psf/DL/DL_src/FEC_src/docugirl'
mkdir -p /app/bin
g++ -o /app/bin/docugirl build/Debug/GNU-Linux/docugirl.o -lm -lpthread /pcli/library/libcore.a /pcli/library/libsdd.a -lmysqlpp
/usr/bin/ld: cannot find -lmysqlpp
collect2: error: ld returned 1 exit status
make[2]: *** [nbproject/Makefile-Debug.mk:67: /app/bin/docugirl] Error 1
make[2]: Leaving directory '/media/psf/DL/DL_src/FEC_src/docugirl'
make[1]: *** [nbproject/Makefile-Debug.mk:59: .build-conf] Error 2
make[1]: Leaving directory '/media/psf/DL/DL_src/FEC_src/docugirl'
make: *** [nbproject/Makefile-impl.mk:40: .build-impl] Error 2
BUILD FAILED (exit value 2, total time: 472ms)
For completeness, the source exists on a remote Debian server (as has previous successfully created and built mysql type applications).
So, I'm a little confused, I thought and assumed that I had the necessary mysql stuff in order to build this, I am able to build other mysql applications with this setup. Is this mysqlpp different/additional to the /usr/include/mysql and /usr/include/mysql++?
The /usr/include/mysql links to /usr/include/mariadb
Any help would be greatly appreciated here, thanks in advance...
#HEKTO This was indeed the problem but it seemed that the current release of Debian (10.5) did not include the libmysql++-dev package, the reasons for which are as yet unknown to me and although I had copied the mysql++ header files across, the libmysqlpp.so was indeed not there. In this instance, I resorted to using a previous release, although I believe the next release will include this.
See here: https://packages.debian.org/stretch/libmysql++-dev

compilation of Qt 5 fails under make in debian64

I tried to make qt 5.4.1 with openSsl configuration but i got some errors during make it.
I configured it as bellow :
OPENSSL_LIBS='-L/usr/local/ssl/lib -lssl -lcrypto' ./configure -prefix $PWD/qtbase -opensource -debug-and-release -nomake tests -openssl-linked -I/usr/local/ssl/include -L/usr/local/ssl/lib
and then make.
the last 10 line of output is:
/usr/bin/ld: /usr/local/ssl/lib/libssl.a(s2_srvr.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/local/ssl/lib/libssl.a: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
make[3]: *** [../../lib/libQt5Network.so.5.4.1] Error 1
make[3]: Leaving directory `/mnt/l/software/qt-everywhere-opensource-src-5.4.1/qtbase/src/network'
make[2]: *** [sub-network-make_first] Error 2
make[2]: Leaving directory `/mnt/l/software/qt-everywhere-opensource-src-5.4.1/qtbase/src'
make[1]: *** [sub-src-make_first] Error 2
make[1]: Leaving directory `/mnt/l/software/qt-everywhere-opensource-src-5.4.1/qtbase'
make: *** [module-qtbase-make_first] Error 2
To link a static library into a shared library on x86_64, the static library needs to be compiled with -fPIC. You could now build OpenSSL manually with -fPIC set, but that'd be a bit of a hassle.
I'd suggest to configure Qt with -openssl instead of -openssl-linked. Then SSL won't be linked at compile time but loaded dynamically (dlopen) at runtime. It's the usual way to handle OpenSSL in Qt, also because of the incompabilities between the OpenSSL and GPL licenses.

Apache Thrift compilation error

I am trying to build apache thrift from source. After executing ./configure (which doesn't give any errors). However, when I execute make I get the following error:
/bin/bash ../../../libtool --tag=CXX --mode=link g++ -Wall -g -O2 -L/usr/lib -o Benchmark Benchmark.o libtestgencpp.la -lssl -lcrypto -lrt -lpthread
libtool: link: cannot find the library `RPC/thrift-0.9.1/lib/cpp/libthrift.la' or unhandled argument `RPC/thrift-0.9.1/lib/cpp/libthrift.la'
make[4]: *** [Benchmark] Error 1
make[4]: Leaving directory `/home/user/Documents/thrift-0.9.1/lib/cpp/test'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/user/Documents/thrift-0.9.1/lib/cpp'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/user/Documents/thrift-0.9.1/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/user/Documents/thrift-0.9.1'
make: *** [all] Error 2
Does anyone have any idea why this error occurs and how do I fix it?
Have you resolved this? I am currently successfully building the tarball of 0.93 on Ubuntu trusty (14.04) on x86 and arm architectures.
I would suggest trying the 0.93 tarball, and using cmake instead of ./configure (as that's worked better for me). Your mileage may vary, of course.

llvm error: linking error to libLTO.so

During compilation of llvm I get following error:
llvm[2]: ======= Finished Linking Debug+Asserts Executable llvm-config
llvm[2]: Installing Debug+Asserts /usr/local/bin/llvm-config
make[2]: Leaving directory `/usr/bin/tools/llvm-config'
make[2]: Entering directory `/usr/bin/tools/lto'
llvm[2]: Compiling LTODisassembler.cpp for Debug+Asserts build (PIC)
llvm[2]: Compiling lto.cpp for Debug+Asserts build (PIC)
llvm[2]: Linking Debug+Asserts Shared Library libLTO.so
collect2: ld terminated with signal 9 [Killed]
make[2]: *** [/usr/bin/Debug+Asserts/lib/libLTO.so] Error 1
make[2]: Leaving directory `/usr/bin/tools/lto'
make[1]: *** [install] Error 1
make[1]: Leaving directory `/usr/bin/tools'
make: *** [install] Error 1
I do configure llvm by giving path of gcc & g++ compilers.
I don't get any error during configuration; but during build same error persist with clang also. I am using Ubntu-12.10 32 bit.
OK, so to solve this problem, I referred to llvm.org and during configuration added few options as follows:
sudo ./configure CC="/usr/bin/gcc" CXX="/usr/bin/g++" --enable-optimization --enable-jit --enable-debug-runtime --enable-targets=all
And I ran a build as SuperUser.
I faced the same error using Ubuntu 13.04 (arch: x86_64). The following error
collect2: ld terminated with signal 9 [Killed]
was an issue with memory usage. I was indeed using a Koding.com cloud VM with 1GB RAM.
I tried the compilation on my laptop as a normal user and the compilation finished without any issues. I used:
$ ./configure
$ make -j4

Audiere incomplete universal character name \U Error

Hey so I'm trying to make a music player using QT and Audiere. First I installed Audiere and put the header file in the compiler's include folder. Then I added the .lib file to the QT project. I wrote the following code:
AudioDevicePtr device(OpenDevice());
if(!device){
//failure
}
SampleSource* source = OpenSampleSource("C:\Users\Amenechi\Downloads\LMFAO - Sexy And I Know It");
OutputStreamPtr stream(OpenSound(device,source,true));
if(!stream){
//failure
}
stream->setRepeat(true);
stream->setVolume(0.5f);
stream->play();
But I get this error:
http://s20.postimage.org/u1yxk0d0s/Untitled.jpg
Now I'm not sure where it went wrong, maybe i installed the audiere library incorrectly?
EDIT:
Hey here's the compile output if that helps.
07:37:45: Running steps for project QTunesV2...
07:37:45: Configuration unchanged, skipping qmake step.
07:37:45: Starting: "C:\Qt\Qt5.0.1\Tools\MinGW\bin\mingw32-make.exe"
C:/Qt/Qt5.0.1/Tools/MinGW/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory 'C:/Qt/Qt5.0.1/Tools/QtCreator/bin/QTunesV1/QTunesV2-build-Desktop_Qt_5_0_1_MinGW_32bit-Debug'
g++ -Wl,-subsystem,windows -mthreads -o debug\QTunesV2.exe debug/main.o debug/mainwindow.o debug/moc_mainwindow.o -lmingw32 -lqtmaind -LC:/Qt/Qt5.0.1/Tools/QtCreator/bin/QTunesV1/QTunesV2/../../ -laudiered -LC:\Qt\Qt5.0.1\5.0.1\mingw47_32\lib -lQt5Widgetsd -lQt5Guid -lQt5Cored -llibEGLd -llibGLESv2d -lgdi32 -luser32
c:/qt/qt5.0.1/tools/mingw/bin/../lib/gcc/i686-w64-mingw32/4.7.2/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -laudiered
collect2.exe: error: ld returned 1 exit status
Makefile.Debug:80: recipe for target 'debug\QTunesV2.exe' failed
mingw32-make[1]: *** [debug\QTunesV2.exe] Error 1
mingw32-make[1]: Leaving directory 'C:/Qt/Qt5.0.1/Tools/QtCreator/bin/QTunesV1/QTunesV2-build-Desktop_Qt_5_0_1_MinGW_32bit-Debug'
mingw32-make: *** [debug] Error 2
makefile:34: recipe for target 'debug' failed
07:37:45: The process "C:\Qt\Qt5.0.1\Tools\MinGW\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project QTunesV2 (kit: Desktop Qt 5.0.1 MinGW 32bit)
When executing step 'Make'