Get real date from the Internet

Re: Get real date from the Internet

Postby Enrico Maria Giordano » Fri Sep 30, 2022 3:01 pm

I need the source code of the program you are trying to compile. Your batch file is for Harbour while the problem is with xHarbour. Anyway, I have no problem: this program works fine with Harbour and xHarbour:

Code: Select all  Expand view
#include "FiveWin.ch"

function Main()

   MsgInfo( Now() )

return nil

#pragma BEGINDUMP

#ifdef _CRT_SECURE_NO_WARNINGS
#undef _CRT_SECURE_NO_WARNINGS
#endif
#define _CRT_SECURE_NO_WARNINGS 1

#include <hbapi.h>

#ifndef __BORLANDC__
   #define _WIN32_WINNT 0x0502
#endif

#include <stdio.h>
#include <stdlib.h>
#include <time.h>

#ifdef __BORLANDC__
   #include <winsock2.h>
#endif

#include <ws2tcpip.h>

HB_FUNC( NOW )
{
    struct addrinfo hints;
    struct addrinfo *result;
    int sockfd;
    int rv;
    char buf[ 64 ];
    time_t now = time(NULL);
    char str[ 26 ];
    WSADATA wsaData;  

    WSAStartup(MAKEWORD(2,2), &wsaData);

    memset(&hints, 0, sizeof(struct addrinfo));
    hints.ai_family = AF_INET; /* Allow IPv4 */
    hints.ai_socktype = SOCK_STREAM; /* Stream socket */
    hints.ai_flags = AI_CANONNAME; /* Return canonical name */
   
    rv = getaddrinfo("www.google.com", "http", &hints, &result);
    if (rv != 0) {
        fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(rv));
        exit(1);
    }
   
    /* Create socket */
    sockfd = socket(result->ai_family, result->ai_socktype, result->ai_protocol);
    if (sockfd == -1) {
        perror("socket");
        exit(1);
    }
   
    /* Connect */
    if (connect(sockfd, result->ai_addr, result->ai_addrlen) == -1) {
        perror("connect");
        exit(1);
    }
   
    /* Get time */
    snprintf(buf, sizeof(buf), "GET / HTTP/1.0\r\n\r\n");
    send(sockfd, buf, strlen(buf), 0);
    recv(sockfd, buf, sizeof(buf), 0);
    ctime_s( str, 26, &now );
    snprintf(buf, sizeof( buf ), "Current time: %s", str );
   
    closesocket(sockfd);
    freeaddrinfo(result);
   
    hb_retc( buf );
}

#pragma ENDDUMP
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Get real date from the Internet

Postby Antonio Linares » Fri Sep 30, 2022 10:04 pm

Dear Enrico,

I am happy that finaly!!! we have found the way to reset the environment after using MS vcvarsall.bat

1. There is an error in both buildh32.bat and buildh64.bat as they use "path" where "Path" should be used
2. setlocal and endlocal must be used before and after using vcvarsall.bat

I have been trying to solve this for a long time :-)
buildh32.bat
Code: Select all  Expand view
@ECHO OFF
CLS
ECHO ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
ECHO ³ FiveWin for Harbour 22.06 (VS32bits) Jun. 2022  Harbour development power  ³Ü
ECHO ³ (c) FiveTech 1993-2022 for Microsoft Windows 9X/NT/200X/ME/XP/Vista/7/8/10 ³Û
ECHO ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ
ECHO ÿ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß

if A%1 == A GOTO :SINTAX
if NOT EXIST %1.prg GOTO :NOEXIST

set oldpath=%Path%
set oldinclude=%include%
set oldlib=%lib%
set oldlibpath=%libpath%
@set current_dir=%cd%
setlocal
call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x86
if "%FWDIR%" == "" set FWDIR=.\..
if "%HBDIR%" == "" set HBDIR=c:\harbour

ECHO Compiling...

@set fwh=%FWDIR%
@set hdir=%HBDIR%
@set hdirl=%hdir%\lib\win\msvc

@cd %current_dir%
%hdir%\bin\win\msvc\harbour %1 /n /i%fwh%\include;%hdir%\include /w /p %2 %3 > comp.log 2> warnings.log
IF ERRORLEVEL 1 GOTO COMPILEERROR
@type comp.log
@type warnings.log

cl.exe -nologo -c -O2  -W4 -wd4127 /I%hdir%\include %1.c
:ENDCOMPILE

IF EXIST %1.rc rc -r -d__FLAT__ %1
IF EXIST %1.rc IF NOT EXIST %1.res rc -r -d__FLAT__ %1

echo %1.obj  > msvc.tmp

echo %fwh%\lib\FiveH32.lib %fwh%\lib\FiveHC32.lib %fwh%\lib\libmysql32.lib  >> msvc.tmp

echo %fwh%\lib\hbhpdf32.lib >> msvc.tmp
echo %fwh%\lib\libhpdf32.lib >> msvc.tmp
echo %hdirl%\hbrtl.lib  >> msvc.tmp
echo %hdirl%\hbvm.lib  >> msvc.tmp
echo %hdirl%\gtgui.lib  >> msvc.tmp
echo %hdirl%\hblang.lib  >> msvc.tmp
echo %hdirl%\hbmacro.lib  >> msvc.tmp
echo %hdirl%\hbrdd.lib  >> msvc.tmp
echo %hdirl%\rddntx.lib  >> msvc.tmp
echo %hdirl%\rddcdx.lib  >> msvc.tmp
echo %hdirl%\rddfpt.lib  >> msvc.tmp
echo %hdirl%\hbsix.lib  >> msvc.tmp
echo %hdirl%\hbdebug.lib  >> msvc.tmp
echo %hdirl%\hbcommon.lib  >> msvc.tmp
echo %hdirl%\hbpp.lib  >> msvc.tmp
echo %hdirl%\hbcpage.lib  >> msvc.tmp
echo %hdirl%\hbwin.lib  >> msvc.tmp
echo %hdirl%\hbcplr.lib  >> msvc.tmp
echo %hdirl%\hbpcre.lib >> msvc.tmp
echo %hdirl%\hbct.lib  >> msvc.tmp
echo %hdirl%\xhb.lib  >> msvc.tmp
echo %hdirl%\png.lib  >> msvc.tmp
echo %hdirl%\hbzlib.lib  >> msvc.tmp
echo %hdirl%\hbziparc.lib >> msvc.tmp
echo %hdirl%\hbmzip.lib >> msvc.tmp
echo %hdirl%\minizip.lib >> msvc.tmp
echo %hdirl%\hbtip.lib >> msvc.tmp
echo %hdirl%\hbzebra.lib >> msvc.tmp

rem Uncomment these two lines to use Advantage RDD
rem echo %hdirl%\rddads.lib >> msvc.tmp
rem echo %hdirl%\ace32.lib >> msvc.tmp

echo kernel32.lib  >> msvc.tmp
echo user32.lib    >> msvc.tmp
echo gdi32.lib     >> msvc.tmp
echo winspool.lib  >> msvc.tmp
echo comctl32.lib  >> msvc.tmp
echo comdlg32.lib  >> msvc.tmp
echo advapi32.lib  >> msvc.tmp
echo shell32.lib   >> msvc.tmp
echo ole32.lib     >> msvc.tmp
echo oleaut32.lib  >> msvc.tmp
echo uuid.lib      >> msvc.tmp
echo odbc32.lib    >> msvc.tmp
echo odbccp32.lib  >> msvc.tmp
echo iphlpapi.lib  >> msvc.tmp
echo mpr.lib       >> msvc.tmp
echo version.lib   >> msvc.tmp
echo wsock32.lib   >> msvc.tmp
echo msimg32.lib   >> msvc.tmp
echo oledlg.lib    >> msvc.tmp
echo psapi.lib     >> msvc.tmp
echo gdiplus.lib   >> msvc.tmp
echo winmm.lib     >> msvc.tmp
echo vfw32.lib     >> msvc.tmp
echo runtimeobject.lib >> msvc.tmp
echo ws2_32.lib    >> msvc.tmp
echo shlwapi.lib   >> msvc.tmp
echo strmiids.lib  >> msvc.tmp

IF EXIST %1.res echo %1.res >> msvc.tmp

@link @msvc.tmp /nologo /subsystem:windows /NODEFAULTLIB:msvcrt

IF ERRORLEVEL 1 GOTO LINKERROR
ECHO * Application successfully built *
@set include=%oldinclude%
@set lib=%oldlib%
@set libpath=%oldlibpath%
@set oldpath=%Path%
@set oldinclude=""
@set oldlib=""
@set oldlibpath=""
@set Path=%oldpath%
endlocal
%1
GOTO EXIT
ECHO

rem delete temporary files
@del %1.c
@del msvc.tmp

:COMPILEERROR
@type comp.log
@type warnings.log
ECHO * Compiling errors *
GOTO EXIT

:LINKERROR
ECHO * Linking errors *
GOTO EXIT

:SINTAX
ECHO    SYNTAX: Build [Program]     {-- No especifiques la extensi?n PRG
ECHO                                {-- Don't specify .PRG extension
GOTO EXIT

:NOEXIST
ECHO The specified PRG %1 does not exist

:EXIT
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Get real date from the Internet

Postby Enrico Maria Giordano » Fri Sep 30, 2022 10:15 pm

Great! So, all is fine now with the date program, right?
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Get real date from the Internet

Postby Antonio Linares » Fri Sep 30, 2022 10:34 pm

Yes Enrico, thank you, and as a gift we have finally found how to reset the environment (cmd set) after using vcvars.all that MS forces to be used

viewtopic.php?f=3&t=42255&start=0
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Get real date from the Internet

Postby Enrico Maria Giordano » Fri Sep 30, 2022 10:36 pm

I don't use vcvars.all, it is not required at all.
User avatar
Enrico Maria Giordano
 
Posts: 8710
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Get real date from the Internet

Postby Antonio Linares » Fri Sep 30, 2022 10:39 pm

Dear Enrico,

you come the Borland way and I fully understand you

but if you start using MSVC 2022 more and more you will find that MS forces the use of vcvars32.bat

Maybe not for you but when building a github open source project, etc. Microsoft likes it that way :-)

Now we know how to fix the mess that vcvars32.bat creates :-) (MS should do it automatically but it does not)
https://stackoverflow.com/questions/14969399/how-to-reset-environment-after-running-vcvars32-bat

This made me re open a cmd window lots of times because after x calls to vcvars32.bat the cmd becomes unusable.
Now that tedious task is over :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Re: Get real date from the Internet

Postby Horizon » Mon Oct 03, 2022 10:28 am

Antonio Linares wrote:This version removes all the warnings with MSVC 2022 and also works with Borland !!!
Code: Select all  Expand view
#include "FiveWin.ch"

function Main()

   MsgInfo( Now() )

return nil

#pragma BEGINDUMP

#ifdef _CRT_SECURE_NO_WARNINGS
#undef _CRT_SECURE_NO_WARNINGS
#endif
#define _CRT_SECURE_NO_WARNINGS 1

#include <hbapi.h>

#ifndef __BORLANDC__
   #define _WIN32_WINNT 0x0502
#endif

#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <ws2tcpip.h>

HB_FUNC( NOW )
{
    struct addrinfo hints;
    struct addrinfo *result;
    int sockfd;
    int rv;
    char buf[ 64 ];
    time_t now = time(NULL);
    char str[ 26 ];
    WSADATA wsaData;  

    WSAStartup(MAKEWORD(2,2), &wsaData);

    memset(&hints, 0, sizeof(struct addrinfo));
    hints.ai_family = AF_INET; /* Allow IPv4 */
    hints.ai_socktype = SOCK_STREAM; /* Stream socket */
    hints.ai_flags = AI_CANONNAME; /* Return canonical name */
   
    rv = getaddrinfo("www.google.com", "http", &hints, &result);
    if (rv != 0) {
        fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(rv));
        exit(1);
    }
   
    /* Create socket */
    sockfd = socket(result->ai_family, result->ai_socktype, result->ai_protocol);
    if (sockfd == -1) {
        perror("socket");
        exit(1);
    }
   
    /* Connect */
    if (connect(sockfd, result->ai_addr, result->ai_addrlen) == -1) {
        perror("connect");
        exit(1);
    }
   
    /* Get time */
    snprintf(buf, sizeof(buf), "GET / HTTP/1.0\r\n\r\n");
    send(sockfd, buf, strlen(buf), 0);
    recv(sockfd, buf, sizeof(buf), 0);
    ctime_s( str, 26, &now );
    snprintf(buf, sizeof( buf ), "Current time: %s", str );
   
    closesocket(sockfd);
    freeaddrinfo(result);
   
    hb_retc( buf );
}

#pragma ENDDUMP
 


Hi Antonio,

I can compile this code without any error with buildh32.bat in sample directory.

I copy this code in my app and compile my all app. These errors has given me.

Code: Select all  Expand view
       cl.exe -c -TP -W3 /GS- /GA -IC:\Harbour\include -I"C:\Program Files (x86)\Windows Kits\10\bin\x86"\include -I"C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build"\include Obj\EKLE.c -FoObj\EKLE.obj
Microsoft (R) C/C++ Optimizing Compiler Version 19.33.31630 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

EKLE.c
.\Ekle.prg(52): warning C4005: '_WIN32_WINNT': macro redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared\sdkddkver.h(218): note: see previous definition of '_WIN32_WINNT'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared\ws2def.h(103): warning C4005: 'AF_IPX': macro redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(457): note: see previous definition of 'AF_IPX'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared\ws2def.h(136): warning C4005: 'AF_MAX': macro redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(476): note: see previous definition of 'AF_MAX'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared\ws2def.h(187): warning C4005: 'SO_DONTLINGER': macro redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(399): note: see previous definition of 'SO_DONTLINGER'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared\ws2def.h(240): error C2011: 'sockaddr': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(482): note: see declaration of 'sockaddr'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared\ws2def.h(442): error C2143: syntax error: missing '}' before 'constant'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared\ws2def.h(442): error C2059: syntax error: 'constant'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared\ws2def.h(496): error C2143: syntax error: missing ';' before '}'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared\ws2def.h(496): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared\ws2def.h(496): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared\ws2def.h(577): warning C4005: 'IN_CLASSA': macro redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(284): note: see previous definition of 'IN_CLASSA'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared\ws2def.h(583): warning C4005: 'IN_CLASSB': macro redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(290): note: see previous definition of 'IN_CLASSB'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared\ws2def.h(589): warning C4005: 'IN_CLASSC': macro redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(296): note: see previous definition of 'IN_CLASSC'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared\ws2def.h(600): warning C4005: 'INADDR_ANY': macro redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(301): note: see previous definition of 'INADDR_ANY'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared\ws2def.h(602): warning C4005: 'INADDR_BROADCAST': macro redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(303): note: see previous definition of 'INADDR_BROADCAST'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared\ws2def.h(638): error C2011: 'sockaddr_in': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(309): note: see declaration of 'sockaddr_in'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(136): error C2011: 'fd_set': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(65): note: see declaration of 'fd_set'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(156): warning C4005: 'FD_CLR': macro redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(94): note: see previous definition of 'FD_CLR'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(171): warning C4005: 'FD_SET': macro redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(99): note: see previous definition of 'FD_SET'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(180): error C2011: 'timeval': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(108): note: see declaration of 'timeval'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(236): error C2011: 'hostent': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(164): note: see declaration of 'hostent'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(249): error C2011: 'netent': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(177): note: see declaration of 'netent'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(256): error C2011: 'servent': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(184): note: see declaration of 'servent'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(268): error C2011: 'protoent': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(196): note: see declaration of 'protoent'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(364): error C2011: 'WSAData': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(319): note: see declaration of 'WSAData'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(462): error C2011: 'sockproto': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(491): note: see declaration of 'sockproto'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(504): error C2011: 'linger': 'struct' type redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(528): note: see declaration of 'linger'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(517): warning C4005: 'SOMAXCONN': macro redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(541): note: see previous definition of 'SOMAXCONN'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(552): warning C4005: 'FD_READ': macro redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(559): note: see previous definition of 'FD_READ'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(555): warning C4005: 'FD_WRITE': macro redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(560): note: see previous definition of 'FD_WRITE'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(558): warning C4005: 'FD_OOB': macro redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(561): note: see previous definition of 'FD_OOB'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(561): warning C4005: 'FD_ACCEPT': macro redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(562): note: see previous definition of 'FD_ACCEPT'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(564): warning C4005: 'FD_CONNECT': macro redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(563): note: see previous definition of 'FD_CONNECT'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(567): warning C4005: 'FD_CLOSE': macro redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(564): note: see previous definition of 'FD_CLOSE'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(1625): error C2375: 'accept': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(739): note: see declaration of 'accept'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(1647): error C2375: 'bind': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(744): note: see declaration of 'bind'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(1668): error C2375: 'closesocket': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(749): note: see declaration of 'closesocket'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(1685): error C2375: 'connect': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(751): note: see declaration of 'connect'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(1706): error C2375: 'ioctlsocket': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(756): note: see declaration of 'ioctlsocket'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(1729): error C2375: 'getpeername': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(761): note: see declaration of 'getpeername'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(1750): error C2375: 'getsockname': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(766): note: see declaration of 'getsockname'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(1771): error C2375: 'getsockopt': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(771): note: see declaration of 'getsockopt'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(1796): error C2375: 'htonl': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(778): note: see declaration of 'htonl'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(1813): error C2375: 'htons': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(780): note: see declaration of 'htons'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(1831): error C2375: 'inet_addr': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(782): note: see declaration of 'inet_addr'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(1849): error C2375: 'inet_ntoa': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(784): note: see declaration of 'inet_ntoa'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(1949): error C2375: 'listen': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(786): note: see declaration of 'listen'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(1968): error C2375: 'ntohl': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(790): note: see declaration of 'ntohl'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(1985): error C2375: 'ntohs': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(792): note: see declaration of 'ntohs'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(2002): error C2375: 'recv': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(794): note: see declaration of 'recv'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(2025): error C2375: 'recvfrom': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(800): note: see declaration of 'recvfrom'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(2052): error C2375: 'select': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(808): note: see declaration of 'select'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(2077): error C2375: 'send': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(815): note: see declaration of 'send'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(2100): error C2375: 'sendto': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(821): note: see declaration of 'sendto'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(2127): error C2375: 'setsockopt': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(829): note: see declaration of 'setsockopt'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(2152): error C2375: 'shutdown': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(836): note: see declaration of 'shutdown'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(2172): error C2375: 'socket': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(840): note: see declaration of 'socket'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(2197): error C2375: 'gethostbyaddr': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(847): note: see declaration of 'gethostbyaddr'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(2219): error C2375: 'gethostbyname': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(852): note: see declaration of 'gethostbyname'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(2236): error C2375: 'gethostname': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(854): note: see declaration of 'gethostname'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(2276): error C2375: 'getservbyport': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(858): note: see declaration of 'getservbyport'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(2295): error C2375: 'getservbyname': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(862): note: see declaration of 'getservbyname'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(2314): error C2375: 'getprotobynumber': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(866): note: see declaration of 'getprotobynumber'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(2331): error C2375: 'getprotobyname': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(868): note: see declaration of 'getprotobyname'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(2351): error C2375: 'WSAStartup': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(872): note: see declaration of 'WSAStartup'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(2371): error C2375: 'WSACleanup': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(876): note: see declaration of 'WSACleanup'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(2388): error C2375: 'WSASetLastError': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(878): note: see declaration of 'WSASetLastError'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(2405): error C2375: 'WSAGetLastError': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(880): note: see declaration of 'WSAGetLastError'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(2426): error C2375: 'WSAIsBlocking': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(882): note: see declaration of 'WSAIsBlocking'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(2444): error C2375: 'WSAUnhookBlockingHook': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(884): note: see declaration of 'WSAUnhookBlockingHook'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(2462): error C2375: 'WSASetBlockingHook': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(886): note: see declaration of 'WSASetBlockingHook'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(2480): error C2375: 'WSACancelBlockingCall': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(888): note: see declaration of 'WSACancelBlockingCall'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(2498): error C2375: 'WSAAsyncGetServByName': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(890): note: see declaration of 'WSAAsyncGetServByName'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(2526): error C2375: 'WSAAsyncGetServByPort': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(898): note: see declaration of 'WSAAsyncGetServByPort'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(2554): error C2375: 'WSAAsyncGetProtoByName': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(906): note: see declaration of 'WSAAsyncGetProtoByName'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(2580): error C2375: 'WSAAsyncGetProtoByNumber': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(913): note: see declaration of 'WSAAsyncGetProtoByNumber'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(2606): error C2375: 'WSAAsyncGetHostByName': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(920): note: see declaration of 'WSAAsyncGetHostByName'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(2632): error C2375: 'WSAAsyncGetHostByAddr': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(927): note: see declaration of 'WSAAsyncGetHostByAddr'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(2662): error C2375: 'WSACancelAsyncRequest': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(936): note: see declaration of 'WSACancelAsyncRequest'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(2680): error C2375: 'WSAAsyncSelect': redefinition; different linkage
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(938): note: see declaration of 'WSAAsyncSelect'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(4206): error C2059: syntax error: '}'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock2.h(4206): error C2143: syntax error: missing ';' before '}'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared\ws2ipdef.h(42): error C2143: syntax error: missing ';' before '{'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared\ws2ipdef.h(42): error C2447: '{': missing function header (old-style formal list?)
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared\ws2ipdef.h(135): warning C4005: 'IP_TOS': macro redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(349): note: see previous definition of 'IP_TOS'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared\ws2ipdef.h(136): warning C4005: 'IP_TTL': macro redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(348): note: see previous definition of 'IP_TTL'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared\ws2ipdef.h(137): warning C4005: 'IP_MULTICAST_IF': macro redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(343): note: see previous definition of 'IP_MULTICAST_IF'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared\ws2ipdef.h(138): warning C4005: 'IP_MULTICAST_TTL': macro redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(344): note: see previous definition of 'IP_MULTICAST_TTL'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared\ws2ipdef.h(139): warning C4005: 'IP_MULTICAST_LOOP': macro redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(345): note: see previous definition of 'IP_MULTICAST_LOOP'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared\ws2ipdef.h(140): warning C4005: 'IP_ADD_MEMBERSHIP': macro redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(346): note: see previous definition of 'IP_ADD_MEMBERSHIP'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared\ws2ipdef.h(141): warning C4005: 'IP_DROP_MEMBERSHIP': macro redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(347): note: see previous definition of 'IP_DROP_MEMBERSHIP'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\shared\ws2ipdef.h(142): warning C4005: 'IP_DONTFRAGMENT': macro redefinition
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\winsock.h(350): note: see previous definition of 'IP_DONTFRAGMENT'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(733): error C2061: syntax error: identifier 'MULTICAST_MODE_TYPE'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(740): error C2065: 'PIP_MSFILTER': undeclared identifier
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(740): error C2146: syntax error: missing ';' before identifier 'Filter'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(740): error C2065: 'Filter': undeclared identifier
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(742): error C2065: 'SourceCount': undeclared identifier
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(743): error C2065: 'Filter': undeclared identifier
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(743): error C2065: 'SourceList': undeclared identifier
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(744): error C2065: 'WSASetLastError': undeclared identifier
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(748): error C2065: 'IP_MSFILTER': undeclared identifier
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(748): error C2065: 'SourceCount': undeclared identifier
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(749): error C2065: 'Filter': undeclared identifier
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(749): error C2065: 'PIP_MSFILTER': undeclared identifier
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(749): error C2146: syntax error: missing ';' before identifier 'HeapAlloc'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(750): error C2065: 'Filter': undeclared identifier
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(751): error C2065: 'WSASetLastError': undeclared identifier
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(755): error C2065: 'Filter': undeclared identifier
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(756): error C2065: 'Filter': undeclared identifier
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(757): error C2065: 'Filter': undeclared identifier
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(757): error C2065: 'FilterMode': undeclared identifier
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(758): error C2065: 'Filter': undeclared identifier
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(758): error C2065: 'SourceCount': undeclared identifier
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(759): error C2065: 'SourceCount': undeclared identifier
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(760): error C2065: 'Filter': undeclared identifier
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(760): error C2065: 'SourceList': undeclared identifier
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(760): error C2065: 'SourceCount': undeclared identifier
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(760): error C2660: 'memcpy': function does not take 2 arguments
c:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\include\vcruntime_string.h(43): note: see declaration of 'memcpy'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(764): error C2065: 'Filter': undeclared identifier
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(767): error C2065: 'Filter': undeclared identifier
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(779): error C2061: syntax error: identifier 'MULTICAST_MODE_TYPE'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(786): error C2065: 'PIP_MSFILTER': undeclared identifier
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(786): error C2146: syntax error: missing ';' before identifier 'Filter'
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(786): error C2065: 'Filter': undeclared identifier
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(788): error C2065: 'SourceCount': undeclared identifier
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(789): error C2065: 'Filter': undeclared identifier
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(789): error C2065: 'SourceList': undeclared identifier
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(790): error C2065: 'WSASetLastError': undeclared identifier
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(794): error C2065: 'IP_MSFILTER': undeclared identifier
C:\Program Files (x86)\Windows Kits\10\\include\10.0.19041.0\\um\ws2tcpip.h(794): fatal error C1003: error count exceeds 100; stopping compilation
 



Where could I have gone wrong?
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: Get real date from the Internet

Postby Horizon » Wed Oct 05, 2022 8:01 pm

:shock:
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: Get real date from the Internet

Postby Horizon » Tue Nov 01, 2022 10:35 am

Hi Antonio,

Have you add this function to fwh? if yes, can you send me libs please?

Thanks.
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: Get real date from the Internet

Postby Antonio Linares » Wed Nov 02, 2022 5:54 am

Dear Hakan,

If we include the source code of function Now() inside FWH, then when building a PRG that uses such function we get this:
LINK : warning LNK4217: symbol '___acrt_iob_func' defined in 'libucrt.lib(_file.obj)' is imported by 'FiveHC32.lib(NOW.obj)' in function '_HB_FUN_NOW'
LINK : warning LNK4217: symbol '___stdio_common_vfprintf' defined in 'libucrt.lib(output.obj)' is imported by 'FiveHC32.lib(NOW.obj)' in function '__vfprintf_l'
LINK : warning LNK4217: symbol '___stdio_common_vsprintf' defined in 'libucrt.lib(output.obj)' is imported by 'FiveHC32.lib(NOW.obj)' in function '_snprintf'
LINK : warning LNK4217: symbol '_exit' defined in 'libucrt.lib(exit.obj)' is imported by 'FiveHC32.lib(NOW.obj)' in function '_HB_FUN_NOW'
LINK : warning LNK4217: symbol '__time64' defined in 'libucrt.lib(time.obj)' is imported by 'FiveHC32.lib(NOW.obj)' in function '_HB_FUN_NOW'
FiveHC32.lib(NOW.obj) : error LNK2019: unresolved external symbol __imp__perror referenced in function _HB_FUN_NOW
FiveHC32.lib(NOW.obj) : error LNK2019: unresolved external symbol __imp___ctime64_s referenced in function _HB_FUN_NOW
horizon.exe : fatal error LNK1120: 2 unresolved externals


Still we don't know how to solve this. So in the meantime, you have to include function Now() in one of your PRGs
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Get real date from the Internet

Postby Antonio Linares » Wed Nov 02, 2022 8:50 am

Problem solved. We included the C code inside a pragma BEGINDUMP ENDDUMP and those errors are gone :-)

function Now() is now part of FWH. We are publishing a new version today
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Get real date from the Internet

Postby Horizon » Wed Nov 02, 2022 8:53 am

Antonio Linares wrote:Problem solved. We included the C code inside a pragma BEGINDUMP ENDDUMP and those errors are gone :-)

function Now() is now part of FWH. We are publishing a new version today


Thank you.
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: Get real date from the Internet

Postby Horizon » Thu Jan 05, 2023 8:06 am

Hi Antonio,

Code: Select all  Expand view
   rv = getaddrinfo("www.google.com", "http", &hints, &result);


Is it possible to give another web site as a parameter like "www.google.com.tr"

Thanks.
Regards,

Hakan ONEMLI

Harbour & MSVC 2022 & FWH 23.04
Horizon
 
Posts: 1322
Joined: Fri May 23, 2008 1:33 pm

Re: Get real date from the Internet

Postby Antonio Linares » Thu Jan 05, 2023 8:20 am

Dear Hakan,

> rv = getaddrinfo("www.google.com", "http", &hints, &result);

Simply modify the function source code with this:

rv = getaddrinfo( ( char * ) hb_parc( 1 ), "http", &hints, &result);
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42080
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 50 guests