ZOO-Project / ZOO-Project

Official ZOO-Project repository. Please submit pull requests to the 'main' branch.
http://zoo-project.org
MIT License
27 stars 29 forks source link

ZOO-KERNEL fails to compile with Visual Studio 2022 on Windows #106

Open jmckenna opened 1 month ago

jmckenna commented 1 month ago

Microsoft (R) Program Maintenance Utility Version 14.41.34120.0
Copyright (C) Microsoft Corporation.  All rights reserved.

service_internal.c

\zoo-project\zoo-kernel\service.h(82): warning C4244: '=': conversion from '__time64_t' to 'long', possible loss of data

service_internal.c(154): warning C4996: 'fileno': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _fileno. See online help for details.
service_internal.c(203): warning C4996: 'fileno': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _fileno. See online help for details.

service_internal.c(329): error C7664: '<': ordered comparison of pointer and integer zero ('HANDLE' and 'int')
service_internal.c(385): error C7664: '<': ordered comparison of pointer and integer zero ('HANDLE' and 'int')
service_internal.c(466): error C7664: '<': ordered comparison of pointer and integer zero ('HANDLE' and 'int')
service_internal.c(889): warning C4477: 'sprintf' : format string '%ld' requires an argument of type 'long', but variadic argument 2 has type '__int64'
service_internal.c(889): note: consider using '%lld' in the format string
service_internal.c(889): note: consider using '%I64d' in the format string
service_internal.c(894): warning C4244: 'argument': conversion from '__int64' to 'size_t', possible loss of data
service_internal.c(895): warning C4244: 'argument': conversion from '__int64' to 'size_t', possible loss of data

NMAKE : fatal error U1077 return code '0x2'
Stop.
jmckenna commented 1 month ago

I think I need to check that it is null, so instead of if(lockid<0) maybe if(lockid == NULL) ?

jmckenna commented 1 month ago

...that gets me a tiny bit further (2 files compiled? yikes)

service.c
zoo-project\zoo-kernel\service.h(82): warning C4244: '=': conversion from '__time64_t' to 'long', possible loss of data

sqlapi.c
zoo-project\zoo-kernel\service.h(82): warning C4244: '=': conversion from '__time64_t' to 'long', possible loss of data
C:\Program Files (x86)\Windows Kits\10\\include\10.0.22621.0\\um\winsvc.h(133): warning C4005: 'SERVICE_PAUSED': macro redefinition
\zoo-project\zoo-kernel\service.h(183): note: see previous definition of 'SERVICE_PAUSED'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\memory(3301): error C2027: use of undefined type 'GDALDoublePointsCache'
gdal-git-master\build\install\include\gdal_priv.h(1493): note: see declaration of 'GDALDoublePointsCache'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\memory(3301): note: the template instantiation context (the oldest one first) is
gdal-git-master\build\install\include\gdal_priv.h(1628): note: see reference to class template instantiation 'std::unique_ptr<GDALDoublePointsCache,std::default_delete<GDALDoublePointsCache>>' being compiled
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\memory(3337): note: see reference to class template instantiation 'std::default_delete<GDALDoublePointsCache>' being compiled
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\memory(3300): note: while compiling class template member function 'void std::default_delete<GDALDoublePointsCache>::operator ()(_Ty *) noexcept const'
        with
        [
            _Ty=GDALDoublePointsCache
        ]
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\memory(3412): note: see the first reference to 'std::default_delete<GDALDoublePointsCache>::operator ()' in 'std::unique_ptr<GDALDoublePointsCache,std::default_delete<GDALDoublePointsCache>>::~unique_ptr'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\memory(3301): error C2338: static_assert failed: 'can't delete an incomplete type'
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\include\memory(3302): warning C4150: deletion of pointer to incomplete type 'GDALDoublePointsCache'; no destructor called
gdal-git-master\build\install\include\gdal_priv.h(1493): note: see declaration of 'GDALDoublePointsCache'
NMAKE : fatal error U1077:  return code '0x2'
Stop.

It doesn't seem to like GDAL-master.

I think this would be a huge task, working through this (a month of effort?) Yikes.

jmckenna commented 1 month ago

I wonder if a system like CMake, for ZOO-Project, is a better plan, than me working a month on MSVC errors.

jmckenna commented 1 month ago

cross-referenced to MS4W's related ticket at https://ms4w.com/trac/ticket/305