[CONC-201] Can't compile on Win64 using MinGW Created: 2016-09-05  Updated: 2017-11-16

Status: Open
Project: MariaDB Connector/C
Component/s: None
Affects Version/s: 3.0.0
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Michiel Beijen Assignee: Georg Richter
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Windows 10 64-bit, MinGW



 Description   

I'm trying to compile the MariaDB Connector/C on Windows with MinGW - and I want to build it with MinGW because that's what StrawberryPerl is built with.

(By the way, I have similar issues using the 2.3.x libraries)

c:\work\mariadb-connector-c-3.0.0-alpha-src>cmake -G "MinGW Makefiles" -D"CMAKE_MAKE_PROGRAM:PATH=C:/strawberry/c/bin/dmake.exe"
...
c:\work\mariadb-connector-c-3.0.0-alpha-src>dmake
dmake:  makefile:  line 17:  Warning: -- Empty recipe for special or meta target .NOTPARALLEL
dmake:  libmariadb\CMakeFiles\mariadb_obj.dir\build.make:  line 12:  Warning: -- Empty recipe for special or meta target .DELETE_ON_ERROR
dmake:  libmariadb\CMakeFiles\mariadb_obj.dir\build.make:  line 12:  Warning: -- Empty recipe for special or meta target .DELETE_ON_ERROR
[  1%] Building C object libmariadb/CMakeFiles/mariadb_obj.dir/__/plugins/pvio/pvio_socket.c.obj
CreateProcess failed (2).
dmake:  Error executing 'cd /d C:\work\mariadb-connector-c-3.0.0-alpha-src\libmariadb && C:\Strawberry\c\bin\gcc.exe  -DHAVE_AURORA=1 -DHAVE_AUTH_CLEARTEXT=1 -DHAVE_AUTH_DIALOG=1 -DHAVE_AUTH_NATIVE=1 -DHAVE_AUTH_OLDPASSWORD=1 -DHAVE_DLOPEN -DHAVE_NPIPE=1 -DHAVE_REPLICATION=1 -DHAVE_SCHANNEL -DHAVE_SHMEM=1 -DHAVE_SOCKET=1 -DHAVE_SSL -DHAVE_TRACE_EXAMPLE=1 -D_CRT_SECURE_NO_WARNINGS @CMakeFiles/mariadb_obj.dir/includes_C.rsp -Wunused -Wno-uninitialized -O2 -g -DNDEBUG -DDBUG_OFF   -D ENABLED_LOCAL_INFILE -D HAVE_COMPRESS -D LIBMARIADB -D THREAD -o CMakeFiles\mariadb_obj.dir\__\plugins\pvio\pvio_socket.c.obj   -c C:\work\mariadb-connector-c-3.0.0-alpha-src\plugins\pvio\pvio_socket.c': No such file or directory
dmake:  Error code -1, while making 'libmariadb\CMakeFiles\mariadb_obj.dir\__\plugins\pvio\pvio_socket.c.obj'
dmake:  Error code 255, while making 'libmariadb\CMakeFiles\mariadb_obj.dir\all'
dmake:  Error code 255, while making 'all'



 Comments   
Comment by Georg Richter [ 2016-09-06 ]

Hi,

can you please try to reproduce with actual sources from github (https://github.com/MariaDB/mariadb-connector-c.git) ?
Thanks!

Comment by Michiel Beijen [ 2016-09-06 ]

That generates:

CMake Error at cmake/version_info.cmake:15 (STRING):
  string sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
  cmake/version_info.cmake:33 (GET_FILE_VERSION)
  libmariadb/CMakeLists.txt:351 (SET_VERSION_INFO)

Comment by Georg Richter [ 2016-09-06 ]

Looks like git is not or not correctly installed on your build machine. You can skip the version_check step by just renaming or deleting the .git directory in ${CMAKE_SOURCE_DIR}

Comment by Michiel Beijen [ 2016-09-06 ]

I'm not sure about it not being correctly installed, I use a VM specifically for this issue and I just downloaded the newest git from git-scm.com - however I did run the make in `cmd.exe` and not in `git-bash` because `git-bash` also has some unix-like tools and I did not want to interfere with that.

That said, after removing the `.git` directory I get these errors:

C:\work\mariadb-connector-c>dmake
dmake:  makefile:  line 17:  Warning: -- Empty recipe for special or meta target .NOTPARALLEL
dmake:  libmariadb\CMakeFiles\mariadb_obj.dir\build.make:  line 12:  Warning: -- Empty recipe for special or meta target .DELETE_ON_ERROR
Scanning dependencies of target mariadb_obj
dmake:  libmariadb\CMakeFiles\mariadb_obj.dir\build.make:  line 12:  Warning: -- Empty recipe for special or meta target .DELETE_ON_ERROR
[  1%] Building C object libmariadb/CMakeFiles/mariadb_obj.dir/__/plugins/pvio/pvio_socket.c.obj
In file included from C:/work/mariadb-connector-c/include/ma_global.h:25:0,
                 from C:\work\mariadb-connector-c\plugins\pvio\pvio_socket.c:27:
C:/work/mariadb-connector-c/include/ma_config_win.h:59:0: warning: "S_IROTH" redefined
 #define S_IROTH  S_IREAD  /* for my_lib */
 ^
In file included from C:/work/mariadb-connector-c/include/ma_config_win.h:30:0,
                 from C:/work/mariadb-connector-c/include/ma_global.h:25,
                 from C:\work\mariadb-connector-c\plugins\pvio\pvio_socket.c:27:
C:/Strawberry/c/x86_64-w64-mingw32/include/sys/stat.h:160:0: note: this is the location of the previous definition
 #define S_IROTH    (S_IRGRP >> 3)
 ^
In file included from C:\work\mariadb-connector-c\plugins\pvio\pvio_socket.c:27:0:
C:/work/mariadb-connector-c/include/ma_global.h:1093:18: error: operator '==' has no left operand
 #if SIZEOF_CHARP == SIZEOF_INT
                  ^
C:/work/mariadb-connector-c/include/ma_global.h:1095:20: error: operator '==' has no left operand
 #elif SIZEOF_CHARP == SIZEOF_LONG
                    ^
C:/work/mariadb-connector-c/include/ma_global.h:1097:20: error: operator '==' has no left operand
 #elif SIZEOF_CHARP == SIZEOF_LONG_LONG
                    ^
C:/work/mariadb-connector-c/include/ma_global.h:1100:2: error: #error sizeof(void *) is not sizeof(int, long or long long)
 #error sizeof(void *) is not sizeof(int, long or long long)
  ^
C:\work\mariadb-connector-c\plugins\pvio\pvio_socket.c: In function 'pvio_socket_change_timeout':
C:\work\mariadb-connector-c\plugins\pvio\pvio_socket.c:156:18: warning: variable 'tm' set but not used [-Wunused-but-set-variable]
   struct timeval tm;
                  ^
C:\work\mariadb-connector-c\plugins\pvio\pvio_socket.c: In function 'pvio_socket_async_write':
C:\work\mariadb-connector-c\plugins\pvio\pvio_socket.c:411:26: warning: pointer targets in passing argument 2 of 'send' differ in signedness [-Wpointer-sign]
   r= send(csock->socket, buffer, (int)length, 0);
                          ^
In file included from C:/work/mariadb-connector-c/include/ma_config_win.h:24:0,
                 from C:/work/mariadb-connector-c/include/ma_global.h:25,
                 from C:\work\mariadb-connector-c\plugins\pvio\pvio_socket.c:27:
C:/Strawberry/c/x86_64-w64-mingw32/include/winsock2.h:997:34: note: expected 'const char *' but argument is of type 'const uchar *'
   WINSOCK_API_LINKAGE int WSAAPI send(SOCKET s,const char *buf,int len,int flags);
                                  ^
C:\work\mariadb-connector-c\plugins\pvio\pvio_socket.c: In function 'pvio_socket_connect':
C:\work\mariadb-connector-c\plugins\pvio\pvio_socket.c:863:25: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       if (csock->socket == SOCKET_ERROR)
                         ^
C:\work\mariadb-connector-c\plugins\pvio\pvio_socket.c:901:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (csock->socket == SOCKET_ERROR)
                       ^
C:\work\mariadb-connector-c\plugins\pvio\pvio_socket.c: In function 'pvio_socket_close':
C:\work\mariadb-connector-c\plugins\pvio\pvio_socket.c:953:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (csock && csock->socket != -1)
                                ^
C:\work\mariadb-connector-c\plugins\pvio\pvio_socket.c: In function 'pvio_socket_shutdown':
C:\work\mariadb-connector-c\plugins\pvio\pvio_socket.c:1073:5: warning: implicit declaration of function 'CancelIoEx' [-Wimplicit-function-declaration]
     CancelIoEx((HANDLE)s, NULL);
     ^
dmake:  Error code 129, while making 'libmariadb\CMakeFiles\mariadb_obj.dir\__\plugins\pvio\pvio_socket.c.obj'
dmake:  Error code 255, while making 'libmariadb\CMakeFiles\mariadb_obj.dir\all'
dmake:  Error code 255, while making 'all'

Comment by Aleksey Midenkov [ 2017-11-16 ]

If it is git problem then error should clearly indicate it. "string sub-command REPLACE requires at least four arguments." doesn't help, but leads in wrong direction.

Generated at Thu Feb 08 03:03:36 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.