Error when compiling the driver for MYSQL for QT - c++

I am trying to build the MYSQL driver for QT so I can include it in my projects. I am using QT 5.5.1, MYSQL 5.7, and MinGW 4.9.2 32 bit. I open the ".pro" file from the driver source code in the QT Creator and add INCLUDEPATH += C:/Program Files (x86)/MySQL/MySQL Server 5.7/include and
QMAKE_LIBDIR += C:/Program Files (x86)/MySQL/MySQL Server 5.7/lib/libmysql.lib to the project file and attempt to build. I get one error in response.
This is the error:
error: mysql.append(\lib\libmysql.lib): No such file or directory
This is the compiler output:
g++ -Wl,-s -shared -Wl,-subsystem,windows
-Wl,--out-implib,C:\Qt\5.5\Src\qtbase\plugins\sqldrivers\libqsqlmysql.a
-o ........\plugins\sqldrivers\qsqlmysql.dll .obj/release/main.o .obj/release/qsql_mysql.o .obj/release/moc_qsql_mysql_p.o
-LC:\Program -LFiles -L(x86)\MySQL\MySQL -LServer -L5.7\lib\libmysql.lib mysql.append(\lib\libmysql.lib) -Ls:/lib -LC:/Qt/5.5/mingw492_32/lib -lQt5Sql -lQt5Core .obj\release\qsqlmysql_resource_res.o g++: error:
mysql.append(\lib\libmysql.lib): No such file or directory
Makefile.Release:81: recipe for target
'........\plugins\sqldrivers\qsqlmysql.dll' failed mingw32-make[1]:
* [........\plugins\sqldrivers\qsqlmysql.dll] Error 1 mingw32-make[1]: Leaving directory
'C:/Qt/5.5/Src/qtbase/src/plugins/sqldrivers/mysql' mingw32-make: *
[release-all] Error 2 makefile:38: recipe for target 'release-all'
failed 11:55:06: The process
"C:\Qt\Tools\mingw492_32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project mysql (kit: Desktop Qt 5.5.1
MinGW 32bit) When executing step "Make"
What can I do to stop this error?

Related

Setting up SDL2 on Windows with VS Code and mingw

I'm trying to setup SDL2 on windows with vs code and mingw. I have some example code and both the include and lib folders in a src folder in my project. I also have a MakeFile:
When I open a terminal and type "make" I get the following error.
g++ -Isrc/Include -Lsrc/lib -o main main.cpp -lmingw64 -lSDL2main -lSDL2
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmingw64: No such file or directory
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:2: all] Error 1
My include path in the C/C++ Configurations Extension is "${workspaceFolder}/**".
I also looked in my mingw folder and found the g++.exe I think I need but am not sure why it's saying there is no such file or directory.

Building OpenCV using makefile throwing error?

I was trying to setup OpenCV environment using MingW64 and visual studio code,
Work done so far
Installed and set environment CMake
Installed OpenCV 4.5.2
OpenCV Makefile generation
using CMake Build from source(openCV directory)
specified the generator for the project
configured the compiler type and makefile type
Enabled precompiled header
Confusing part
when I entered the command mingw32-make for compilation in directory where the makefile is generated
It worked until 67% after that:
[ 67%] Built target pch_Generate_opencv_test_dnn
Scanning dependencies of target opencv_test_dnn
[ 67%] Building CXX object modules/dnn/CMakeFiles/opencv_test_dnn.dir/test/npy_blob.cpp.obj
In file included from <command-line>:0:0:
D:/opencv/build/modules/dnn/test_precomp.hpp:50:10: fatal error: test_common.hpp: No such file or directory
#include "test_common.hpp"
^~~~~~~~~~~~~~~~~
compilation terminated.
mingw32-make[2]: *** [modules\dnn\CMakeFiles\opencv_test_dnn.dir\build.make:82: modules/dnn/CMakeFiles/opencv_test_dnn.dir/test/npy_blob.cpp.obj] Error 1
mingw32-make[1]: *** [CMakeFiles\Makefile2:3429: modules/dnn/CMakeFiles/opencv_test_dnn.dir/all] Error 2
mingw32-make: *** [Makefile:181: all] Error 2
thank you

Building QtWebKit with QT 5.6 on Mac 10.11

I'm trying to build Qt 5.6.0 (new release) with Qt Webkit on Mac OS 10.11 and I have a compiling error when I try.
I downloaded the tar.gz source of 5.6.0, then I downloaded QtWebkit source from Community folder for 5.6.0. I added the qtwebkit folder in the same folder of qtbase like previous version. Anything else is needed?
I'm using this configure:
OPENSSL_LIBS='-L/usr/local/opt/openssl/lib -lssl -lcrypto' ./configure -nomake examples -opensource -openssl-linked -I /usr/local/opt/openssl/include
After a few hour of compilation, I have this error message:
.pch/debug/QtWebKitWidgets_debug/c++.pch
../include/QtWebKitWidgets/QtWebKitWidgetsDepends:7:10: fatal error: 'QtWebKit/QtWebKit' file not found
#include <QtWebKit/QtWebKit>
^
1 error generated.
make[4]: *** [.pch/debug/QtWebKitWidgets_debug/c++.pch] Error 1
make[3]: *** [debug-all] Error 2
make[2]: *** [sub-widgetsapi-pri-make_first-ordered] Error 2
make[1]: *** [sub-Source-QtWebKit-pro-make_first-ordered] Error 2
make: *** [module-qtwebkit-make_first] Error 2
Thanks for your help
I found the issue while searching some mailing: http://lists.qt-project.org/pipermail/development/2016-March/025358.html
The tarball was not properly made and the synqct step is missing.
To fix, create an empty .git folder (in qtwidget) and execute qmake, then manually execute syncqt for Qtwebkit:
cd qtwidget
mkdir .git
qmake
syncqt.pl Source -version 5.6.0

Unrecognized Command Line Option '-WI'

I'm trying to set up my Qt for college and I'm running into some issues. I'm running Windows 8, and I'm not sure which version of Qt or QtCreator but not the latest - we were given the version installer so we must use this one, although I did install the latest MinGW myself before the QtCreator setup.
I tried some demo code in QtCreator and I got the error "Unrecognized Command Line Option "-WI" when I try run the following code.
#include <QtCore/QCoreApplication>
#include <QtGui/QMessageBox>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QMessageBox msgBox;
msgBox.setText("This is some text.");
msgBox.exec();
return a.exec();
}
I need to do my assignment and I'm not sure how I can do it when I'm getting all of these strange errors.
Any help would be appreciated.
Thanks in advance!
* EDIT *
This is the error output that I can find in QtCreator during the build process.
Running build steps for project TestProject...
Configuration unchanged, skipping qmake step.
Starting: "C:/MinGW/bin/mingw32-make.exe" -w
mingw32-make: Entering directory 'C:/Users/Nick/Documents/Qt Projects/TestProject-build-desktop'
C:/MinGW/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory 'C:/Users/Nick/Documents/Qt Projects/TestProject-build-desktop'
g++ -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc -Wl,-subsystem,console -mthreads -Wl -o debug\TestProject.exe debug/main.o -L"c:\Qt\2010.04\qt\lib" -lQtCored4
Makefile.Debug:73: recipe for target 'debug\TestProject.exe' failed
mingw32-make[1]: Leaving directory 'C:/Users/Nick/Documents/Qt Projects/TestProject-build-desktop'
Makefile:34: recipe for target 'debug' failed
mingw32-make: Leaving directory 'C:/Users/Nick/Documents/Qt Projects/TestProject-build-desktop'
g++: error: unrecognized command line option '-Wl'
mingw32-make[1]: *** [debug\TestProject.exe] Error 1
mingw32-make: *** [debug] Error 2
The process "C:/MinGW/bin/mingw32-make.exe" exited with code %2.
Error while building project TestProject (target: Desktop)
When executing build step 'Make'
Here are the contents of the .pro file generated by QtCreator :
QT += core
QT -= gui
TARGET = TestProject
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
As Mats says the problem is the extra -Wl in the command line.
This is due to a bug in the QT conf files, and thankfully this can be fixed "permanently" (locally).
You need to edit one (possibly both) of these files (often in C:\Qt\2010.02\qt\mkspecs):
mkspecs\default\qmake.conf
mkspecs\win32-g++\qmake.conf
changing this:
QMAKE_LFLAGS = -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
QMAKE_LFLAGS_EXCEPTIONS_ON = -mthreads -Wl
to this:
QMAKE_LFLAGS = -Wl,-enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
QMAKE_LFLAGS_EXCEPTIONS_ON = -mthreads
because somehow the -Wl, from the start of the first line is wrongly on the end of the second line.
After this edit, if you clean and then rebuild your project you will no longer see the error.
Notes:
this same bug causes this issue too, so thanks to leemes for his answer there)
it is fixed in Qt since version 4.7 I believe
The problem is clearly:
g++ -enable-stdcall-fixup -Wl,-enable-auto-import
-Wl,-enable-runtime-pseudo-reloc -Wl,-subsystem,console -mthreads -Wl -o debug\TestProject.exe debug/main.o -L"c:\Qt\2010.04\qt\lib" -lQtCored4
I'm not sure exaclty how this is compiled, but to me it looks like a makefile with -Wl${somestuff} and for some reason ${somestuff} is not defined. Either that, or there is a spurious -Wl in the commendline for the link command, but that seems less likely.

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'