Compilando el ERP.PRG que viene en fwh\sample, tengop estas incidencias con MSVC
FiveWin for Harbour 20.12 (MSVC++) Dic. 2019 Harbour development power Aplicacion Desarrollo.
Microsoft (R) Program Maintenance Utility Version 14.29.30038.1 Copyright (C) Microsoft Corporation. All rights reserved.
cl.exe -TP -W3 -c /GS- -I..\Harbour_msvc64\include -I..\mysql\Include /GA erp.c Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30038.1 for x64 Copyright (C) Microsoft Corporation. All rights reserved.
erp.c erp.prg(201): warning C4311: 'type cast': pointer truncation from 'MYSQL *' to 'long' erp.prg(201): warning C4302: 'type cast': truncation from 'MYSQL *' to 'long' erp.prg(208): warning C4312: 'type cast': conversion from 'long' to 'MYSQL *' of greater size erp.prg(215): warning C4311: 'type cast': pointer truncation from 'MYSQL *' to 'HB_BOOL' erp.prg(215): warning C4302: 'type cast': truncation from 'MYSQL *' to 'HB_BOOL' erp.prg(222): warning C4312: 'type cast': conversion from 'long' to 'MYSQL *' of greater size erp.prg(246): warning C4312: 'type cast': conversion from 'long' to 'MYSQL *' of greater size erp.prg(271): warning C4312: 'type cast': conversion from 'long' to 'void *' of greater size erp.prg(271): error C2664: 'int mysql_real_query(MYSQL *,const char *,unsigned long)': cannot convert argument 1 from 'void *' to 'MYSQL *' erp.prg(271): note: Conversion from 'void*' to pointer to non-'void' requires an explicit cast ..\mysql\Include\mysql.h(405): note: see declaration of 'mysql_real_query' erp.prg(278): warning C4312: 'type cast': conversion from 'long' to 'MYSQL *' of greater size erp.prg(278): warning C4311: 'type cast': pointer truncation from 'MYSQL_RES *' to 'long' erp.prg(278): warning C4302: 'type cast': truncation from 'MYSQL_RES *' to 'long' erp.prg(285): warning C4312: 'type cast': conversion from 'long' to 'MYSQL_RES *' of greater size erp.prg(292): warning C4312: 'type cast': conversion from 'long' to 'MYSQL_RES *' of greater size erp.prg(317): warning C4312: 'type cast': conversion from 'long' to 'MYSQL_RES *' of greater size erp.prg(324): warning C4312: 'type cast': conversion from 'long' to 'MYSQL *' of greater size erp.prg(331): warning C4312: 'type cast': conversion from 'long' to 'MYSQL *' of greater size erp.prg(338): warning C4312: 'type cast': conversion from 'long' to 'MYSQL *' of greater size erp.prg(338): warning C4311: 'type cast': pointer truncation from 'MYSQL_RES *' to 'long' erp.prg(338): warning C4302: 'type cast': truncation from 'MYSQL_RES *' to 'long' erp.prg(345): warning C4312: 'type cast': conversion from 'long' to 'MYSQL_RES *' of greater size erp.prg(352): warning C4312: 'type cast': conversion from 'long' to 'MYSQL *' of greater size NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\bin\HostX86\x64\cl.exe"' : return code '0x2' Stop. 'one.exe' is not recognized as an internal or external command, operable program or batch file.
C:\sistema64>
Es necesario hacer algun otro ajuste?
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Called from MYSQL_REAL_CONNECT(0) Called from TMYSQL:CONNECT(127) in erp.prg Called from MAIN(11) in erp.prg ------------------------------------------------------------------------
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Si el error se soluciona, entonces cambia todos los hb_parnl() a hb_parnll() y los hb_retnl() a hb_retnll()
Al tratarse de una aplicación de 64 bits hay que usar hb_parnll() y hb_retnll(). Lo correcto sería usar hb_parptr() y hb_retptr() que usan punteros con su tamaño correcto.
Si el error se soluciona, entonces cambia todos los hb_parnl() a hb_parnll() y los hb_retnl() a hb_retnll()
Al tratarse de una aplicación de 64 bits hay que usar hb_parnll() y hb_retnll(). Lo correcto sería usar hb_parptr() y hb_retptr() que usan punteros con su tamaño correcto.
Ahora ni siquiera lo compila
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
FiveWin for Harbour 20.12 (MSVC++) Dic. 2019 Harbour development power Aplicacion Desarrollo.
Microsoft (R) Program Maintenance Utility Version 14.29.30038.1 Copyright (C) Microsoft Corporation. All rights reserved.
cl.exe -TP -W3 -c /GS- -I..\Harbour_msvc64\include -I..\mysql\Include /GA erp.c Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30038.1 for x64 Copyright (C) Microsoft Corporation. All rights reserved.
erp.c erp.prg(201): warning C4311: 'type cast': pointer truncation from 'MYSQL *' to 'long' erp.prg(201): warning C4302: 'type cast': truncation from 'MYSQL *' to 'long' erp.prg(208): warning C4312: 'type cast': conversion from 'long' to 'MYSQL *' of greater size erp.prg(215): warning C4311: 'type cast': pointer truncation from 'MYSQL *' to 'HB_BOOL' erp.prg(215): warning C4302: 'type cast': truncation from 'MYSQL *' to 'HB_BOOL' erp.prg(222): warning C4312: 'type cast': conversion from 'long' to 'MYSQL *' of greater size erp.prg(246): warning C4312: 'type cast': conversion from 'long' to 'MYSQL *' of greater size erp.prg(272): error C3861: 'hb_parnlll': identifier not found erp.prg(280): warning C4311: 'type cast': pointer truncation from 'MYSQL_RES *' to 'long' erp.prg(280): warning C4302: 'type cast': truncation from 'MYSQL_RES *' to 'long' erp.prg(287): error C3861: 'hb_retnlll': identifier not found erp.prg(340): warning C4311: 'type cast': pointer truncation from 'MYSQL_RES *' to 'long' erp.prg(340): warning C4302: 'type cast': truncation from 'MYSQL_RES *' to 'long' NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\bin\HostX86\x64\cl.exe"' : return code '0x2' Stop. 'erp.exe' is not recognized as an internal or external command, operable program or batch file.
C:\sistema64>
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
FiveWin for Harbour 20.12 (MSVC++) Dic. 2019 Harbour development power Aplicacion Desarrollo.
Microsoft (R) Program Maintenance Utility Version 14.29.30038.1 Copyright (C) Microsoft Corporation. All rights reserved.
..\Harbour_msvc64\bin\harbour erp.prg /q0 /n /W -I..\Fwh64\include -I..\Harbour_msvc64\include -I..\mysql\Include erp.prg(131) Warning W0001 Method <GetDataBases()> not declared or declaration mismatch in class <TMySQL> erp.prg(145) Warning W0001 Method <GetTables()> not declared or declaration mismatch in class <TMySQL> cl.exe -TP -W3 -c /GS- -I..\Harbour_msvc64\include -I..\mysql\Include /GA erp.c Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30038.1 for x64 Copyright (C) Microsoft Corporation. All rights reserved.
erp.c erp.prg(201): warning C4311: 'type cast': pointer truncation from 'MYSQL *' to 'long' erp.prg(201): warning C4302: 'type cast': truncation from 'MYSQL *' to 'long' erp.prg(208): warning C4312: 'type cast': conversion from 'long' to 'MYSQL *' of greater size erp.prg(215): warning C4311: 'type cast': pointer truncation from 'MYSQL *' to 'HB_BOOL' erp.prg(215): warning C4302: 'type cast': truncation from 'MYSQL *' to 'HB_BOOL' erp.prg(222): warning C4312: 'type cast': conversion from 'long' to 'MYSQL *' of greater size erp.prg(246): warning C4312: 'type cast': conversion from 'long' to 'MYSQL *' of greater size erp.prg(272): error C2664: 'int mysql_real_query(MYSQL *,const char *,unsigned long)': cannot convert argument 1 from 'void *' to 'MYSQL *' erp.prg(272): note: Conversion from 'void*' to pointer to non-'void' requires an explicit cast ..\mysql\Include\mysql.h(405): note: see declaration of 'mysql_real_query' erp.prg(279): warning C4312: 'type cast': conversion from 'long' to 'MYSQL *' of greater size erp.prg(279): warning C4311: 'type cast': pointer truncation from 'MYSQL_RES *' to 'long' erp.prg(279): warning C4302: 'type cast': truncation from 'MYSQL_RES *' to 'long' erp.prg(286): warning C4312: 'type cast': conversion from 'long' to 'MYSQL_RES *' of greater size erp.prg(293): warning C4312: 'type cast': conversion from 'long' to 'MYSQL_RES *' of greater size erp.prg(318): warning C4312: 'type cast': conversion from 'long' to 'MYSQL_RES *' of greater size erp.prg(325): warning C4312: 'type cast': conversion from 'long' to 'MYSQL *' of greater size erp.prg(332): warning C4312: 'type cast': conversion from 'long' to 'MYSQL *' of greater size erp.prg(339): warning C4312: 'type cast': conversion from 'long' to 'MYSQL *' of greater size erp.prg(339): warning C4311: 'type cast': pointer truncation from 'MYSQL_RES *' to 'long' erp.prg(339): warning C4302: 'type cast': truncation from 'MYSQL_RES *' to 'long' erp.prg(346): warning C4312: 'type cast': conversion from 'long' to 'MYSQL_RES *' of greater size erp.prg(353): warning C4312: 'type cast': conversion from 'long' to 'MYSQL *' of greater size NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30037\bin\HostX86\x64\cl.exe"' : return code '0x2' Stop. 'erp.exe' is not recognized as an internal or external command, operable program or batch file.
C:\sistema64>
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code