MySQL Forums
Forum List  »  Connector/C++

MySQL connector with MinGW and WxWidgets
Posted by: Simon Ferber
Date: September 15, 2014 06:04AM

Hello,

it seems that my former posting from friday isn't in the forums. Thus here is a new.

I need to write a Windows GUI applcation with MinGW/Cygwin which acts as a MySQL database client. As far as I understood I have to use the conncetor c/c++ and can't use neither from the binaries but have to compile them myself. Latter is what gives me headaches since more than a week now. The combination seem to be rather rare and there are just a few instruction (http://forums.mysql.com/read.php?117,426293,426927 and http://forums.mysql.com/read.php?117,425191,425191#msg-425191), but neither works. I've tried with MinGW, Cygwin and MSYS.

Latter instructions says: "Compiling mysql connector c++ works analogous to mysql connector c except that mysql_config needs to be in PATH for the configuration to work." Well, despite of the issue that the conncetor C doesn't build, there is no "mysql_config" on Windows. I have a "mysql_config.pl" only which doesn't seem to be compatible. In addition "boost" is needed but that is only a minor issue.

Here is what happens when I try to build the c++ connector...
D:\mysql-connector-c++-1.1.0>cmake -G "MinGW Makefiles"
CMake Warning (dev) in CMakeLists.txt:
Syntax Warning in cmake code at

D:/mysql-connector-c++-1.1.0/CMakeLists.txt:225:24

Argument not separated from preceding token by whitespace.
This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) in CMakeLists.txt:
Syntax Warning in cmake code at

D:/mysql-connector-c++-1.1.0/CMakeLists.txt:225:54

Argument not separated from preceding token by whitespace.
This warning is for project developers. Use -Wno-dev to suppress it.

-- The C compiler identification is GNU 4.9.1
-- The CXX compiler identification is GNU 4.9.1
-- Check for working C compiler: D:/MinGW/mingw32/bin/gcc.exe
-- Check for working C compiler: D:/MinGW/mingw32/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: D:/MinGW/mingw32/bin/g++.exe
-- Check for working CXX compiler: D:/MinGW/mingw32/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Environment compile flags:
-- Environment link flags:
-- Boost version: 1.56.0
-- BOOST_INCLUDE_DIRS=d:/boost_1_56_0
-- ENV{MYSQL_DIR} = D:\mysql
CMake Error at FindMySQL.cm:215 (MESSAGE):
mysql_config wasn't found, -DMYSQL_CONFIG_EXECUTABLE=...
Call Stack (most recent call first):
CMakeLists.txt:166 (INCLUDE)


CMake Error at FindMySQL.cm:217 (MESSAGE):
Cannot find MySQL. Include dir: D:/mysql/include library dir: cxxflags:
Call Stack (most recent call first):
CMakeLists.txt:166 (INCLUDE)


-- Configuring incomplete, errors occurred!
See also "D:/mysql-connector-c++-1.1.0/CMakeFiles/CMakeOutput.log".
See also "D:/mysql-connector-c++-1.1.0/CMakeFiles/CMakeError.log".

D:\mysql-connector-c++-1.1.0>


Here is what comes when I try to compile the c connector:
D:\mysql-connector-c-6.0.2.mingw-port>make
Scanning dependencies of target vio
[ 0%] Building C object vio/CMakeFiles/vio.dir/vio.c.obj
In file included from D:/mysql-connector-c-6.0.2.mingw-port/include/my_sys.h:36:
0,
from D:\mysql-connector-c-6.0.2.mingw-port\vio\vio_priv.h:21,
from D:\mysql-connector-c-6.0.2.mingw-port\vio\vio.c:23:
D:/mysql-connector-c-6.0.2.mingw-port/include/my_pthread.h:85:8: error: redefini
tion of 'struct timespec'
struct timespec {
^
In file included from D:/MinGW/mingw32/i686-w64-mingw32/include/sys/stat.h:26:0,

from D:/mysql-connector-c-6.0.2.mingw-port/include/config-win.h
:41,
from D:/mysql-connector-c-6.0.2.mingw-port/include/my_global.h:
74,
from D:\mysql-connector-c-6.0.2.mingw-port\vio\vio_priv.h:19,
from D:\mysql-connector-c-6.0.2.mingw-port\vio\vio.c:23:
D:/MinGW/mingw32/i686-w64-mingw32/include/sys/types.h:89:8: note: originally def
ined here
struct timespec {
^
In file included from D:/mysql-connector-c-6.0.2.mingw-port/include/my_sys.h:36:
0,
from D:\mysql-connector-c-6.0.2.mingw-port\vio\vio_priv.h:21,
from D:\mysql-connector-c-6.0.2.mingw-port\vio\vio.c:23:
D:/mysql-connector-c-6.0.2.mingw-port/include/my_pthread.h:121:0: warning: "ETIM
EDOUT" redefined
#define ETIMEDOUT 145 /* Win32 doesn't have this */
^
In file included from D:/mysql-connector-c-6.0.2.mingw-port/include/my_global.h:
468:0,
from D:\mysql-connector-c-6.0.2.mingw-port\vio\vio_priv.h:19,
from D:\mysql-connector-c-6.0.2.mingw-port\vio\vio.c:23:
D:/MinGW/mingw32/i686-w64-mingw32/include/errno.h:183:0: note: this is the locat
ion of the previous definition
#define ETIMEDOUT 138
^
D:\mysql-connector-c-6.0.2.mingw-port\vio\vio.c: In function 'vio_new':
D:\mysql-connector-c-6.0.2.mingw-port\vio\vio.c:167:20: warning: variable 'r' se
t but not used [-Wunused-but-set-variable]
ulong arg=0, r;
^
make[2]: *** [vio/CMakeFiles/vio.dir/vio.c.obj] Fehler 1
make[1]: *** [vio/CMakeFiles/vio.dir/all] Fehler 2
make: *** [all] Fehler 2

D:\mysql-connector-c-6.0.2.mingw-port>

It is pretty frustrating that neither instructions works. I even tried different combinations of MinGW/MSYS and their versions.

Any idea or is there a more recent manual?

Best
Simon

Options: ReplyQuote


Subject
Views
Written By
Posted
MySQL connector with MinGW and WxWidgets
4892
September 15, 2014 06:04AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.