FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Error al Compilar con MSVC 2019
Posts: 719
Joined: Fri May 12, 2017 02:50 PM
Error al Compilar con MSVC 2019
Posted: Sun Apr 24, 2022 09:42 PM
Hola Amigos.

Te estoy probando compilar un programa de prueba.

Instale Nuevamente una versi贸n Microsoft Visual Studio 2019 32 Bits.

. Compile un PRG con "hbmk2", archivo HBP, Funciono Perfecto.

. El mismo PRG, lo compilo con MSVC, usando el "buildh32.bat", genera el EXE, pero al ejecutarlo, no realiza ninguna accion, que es mostrar una pantalla con Gets.
Revise los archivo que se generan y dentro de ellos, hay uno "PPO", dentro del codigo hay un error, que quizas es el motivo que no se ejecute correctamente.

Saludos

Antonio

Archivo PPOr:
Code (fw): Select all Collapse
#line 90 "c:\util\fwh22.03\include\FiveWin.ch"
聽 聽 聽 聽 聽EXTERNAL FW_GT


extern errorsys


static aFwStack 聽 聽 聽:= {}
static _fwhtmp_ 聽 聽 聽:= nil
#line 4 "ingreso5.prg"
FUNCTION Ingre()
聽 聽 聽 聽 聽 聽 聽 聽 聽 Local oFont1,oUser,cUser,oPass,cPass,oDlg2,oBmp1,oCod_usu1,oCla_usu1,lSalir := .F.
聽 聽 聽 聽 聽 聽 聽 聽 聽Local oFont2,oFont3,oFont4,oFont5,oTitu,oFont6
聽 聽 聽 聽 聽 聽 聽 聽 Local Mensa,Ing_1:=0,Ing_2:=1
聽 聽 聽 聽 聽 聽 聽 聽 聽Local Cod_usu1,Cla_usu1,Per_agr1,Per_mod1,Per_eli1,Per_ver1,Per_imp1,Tip_usu1
聽 聽 聽 聽 聽 聽 聽 聽 聽Public Nro_usu1
聽 聽 聽 聽 聽 聽 聽 聽 聽Mensa=""




聽 聽 聽 聽 聽 聽 聽 聽 聽Set( 27, "ON" )
聽 聽 聽 聽 聽 聽 聽 聽Cod_usu1:=Spac(5)
聽 聽 聽 聽 聽 聽 聽 聽Cla_usu1:=Spac(5)
聽 聽 聽 聽 聽 聽 聽 聽 SetGetColorFocus( ( 156 + ( 252 * 256 ) + ( 137 * 65536 ) ) )
聽 聽 聽 聽 聽 聽 聽 聽 聽oFont2 := TFont():New( "TAHOMA", 0, -15,, .T.,,,,,,,,,,,,, )
聽 聽 聽 聽 聽 聽 聽 聽 聽oFont4 := TFont():New( "TAHOMA", 0, -14,, .T.,,,,,,,,,,,,, )
聽 聽 聽 聽 聽 聽 聽 聽 聽oFont5 := TFont():New( "TAHOMA", 0, 30,, .T.,,,,,,,,,,,,, )

聽 聽 聽 聽 聽 聽 聽 聽 聽oFont1 := TFont():New( "Arial", 0, 35,, .T.,,,,,,,,,,,,, )

聽 聽 聽 聽 聽 聽 聽 聽oDlg2 = TDialog():New(,,,,,,, .F., nOr( 2147483648, 268435456, 4194304 ),,,,, .T.,, oFont2,, 350, 250, .F.,, "oDlg2", nil, .T., )

聽 聽 聽 聽 聽 聽 聽 聽 聽otitu := TSay():New( 00, 15, {|| " INGRESO A SISTEMA "}, oDlg2,, oFont5, .T., .F., .F., .T., ( 0 + ( 100 * 256 ) + ( 0 * 65536 ) ),,,, .F., .F., .F., .F., .F., .F., .F., "otitu",, .F., )

聽 聽 聽 聽 聽 聽 聽 聽 TSay():New( 070, 020, {|| "Usuario"}, oDlg2,,, .F., .T., .F., .T.,,, 90, 20, .F., .F., .F., .F., .F., .F., .F.,,, .F., )
聽 聽 聽 聽 聽 聽 聽 聽TSay():New( 130, 020, {|| "Clave"}, oDlg2,,, .F., .T., .F., .T.,,, 90, 20, .F., .F., .F., .F., .F., .F., .F.,,, .F., )

聽 聽 聽 聽 聽 聽 聽 聽 聽oCod_Usu1 := TGet():New( 070, 140, { | u | If( PCount()==0, Cod_Usu1, Cod_Usu1:= u ) }, oDlg2, 100, 22, "@!",, ( 0 + ( 0 * 256 ) + ( 128 * 65536 ) ),, oFont2, .F.,, .T.,, .T.,, .F., .F.,, .F., .F., .F.,, .F.,,,,,,, "oCod_Usu1",, nil, nil, nil, nil, nil,,,,, .F.,,,,,,,,,,,,,,,,,,,,,, "Cod_Usu1",, nil )
聽 聽 聽 聽 聽 聽 聽 聽 聽oCla_Usu1 := TGet():New( 130, 140, { | u | If( PCount()==0, Cla_Usu1, Cla_Usu1:= u ) }, oDlg2, 100, 22, "@!",, ( 0 + ( 0 * 256 ) + ( 128 * 65536 ) ),, oFont2, .F.,, .T.,, .T.,, .F., .F.,, .F., .T.,,,,,,,,,, "oCla_Usu1",,,,,,, nil,,,, .F.,,,,,,,,,,,,,,,,,,,,,, "Cla_Usu1",, )



聽 聽 聽 聽 聽 聽 聽 聽 TBtnBmp():New( 180, 240, 75, 50, "#8028",,,, {|Self|(Ing_1:=0,Ing_2:=0,oDlg2:End())}, oDlg2,,, .F., .F., "SALIR", oFont4,,, !.F.,, .T.,,, .F., "SALIR DEL SISTEMA", !.F.,, .T., .F., .F.,,, .F., )
聽 聽 聽 聽 聽 聽 聽 聽 聽TBtnBmp():New( 180, 050, 75, 50, "#8023",,,,, oDlg2,,, .F., .F., "ACEPTAR", oFont4,,, !.F.,, .T.,,, .F.,, !.F.,, .F., .F., .F.,,, .F., )


聽 聽 聽 聽 聽 聽 聽 聽 oDlg2:Activate( oDlg2:bLClicked, oDlg2:bMoved, oDlg2:bPainted, .T.,,,, oDlg2:bRClicked,,,,, @oDlg2, )
聽 聽 聽 聽 聽 聽 聽 聽 聽If( HB_ISOBJECT( oFont1 ), oFont1:End(), ) ; oFont1 := nil ; If( HB_ISOBJECT( oFont2 ), oFont2:End(), ) ; oFont2 := nil ; If( HB_ISOBJECT( oFont4 ), oFont4:End(), ) ; oFont4 := nil ; If( HB_ISOBJECT( oFont5 ), oFont5:End(), ) ; oFont5 := nil ; If( HB_ISOBJECT( oFont3 ), oFont3:End(), ) ; oFont3 := nil


聽 Return(Ing_1)

PRG
Code (fw): Select all Collapse
#include "FiveWin.ch"


FUNCTION Ingre()
聽 聽 聽聽 聽聽 聽 聽 聽 聽Local oFont1,oUser,cUser,oPass,cPass,oDlg2,oBmp1,oCod_usu1,oCla_usu1,lSalir := .f.
聽 聽 聽 聽 聽 聽 聽 聽 聽Local oFont2,oFont3,oFont4,oFont5,oTitu,oFont6
聽 聽 聽 聽 聽 聽 聽 聽 Local Mensa,Ing_1:=0,Ing_2:=1
聽 聽 聽 聽 聽 聽 聽 聽 聽Local Cod_usu1,Cla_usu1,Per_agr1,Per_mod1,Per_eli1,Per_ver1,Per_imp1,Tip_usu1 聽// Variables de Ingreso y Permisos
聽 聽 聽 聽 聽 聽 聽 聽 聽Public Nro_usu1
聽 聽 聽 聽 聽 聽 聽 聽 聽Mensa=""




聽 聽 聽 聽 聽 聽 聽 聽 聽SET CONFIRM ON
聽 聽 聽 聽 聽 聽 聽Cod_usu1:=Spac(5)
聽 聽 聽 聽 聽 聽 聽Cla_usu1:=Spac(5)
聽 聽 聽 聽 聽 聽 聽 聽 SetGetColorFocus( RGB(156,252,137) )
聽 聽 聽聽 聽聽 聽 聽 聽 DEFINE FONT oFont2 NAME "TAHOMA" SIZE 0,-15 聽BOLD
聽 聽 聽聽 聽聽 聽 聽 聽 DEFINE FONT oFont4 NAME 'TAHOMA' SIZE 0,-14 聽 BOLD
聽 聽 聽聽 聽聽 聽 聽 聽 DEFINE FONT oFont5 NAME 'TAHOMA' SIZE 0,30 聽 BOLD

聽 聽 聽聽 聽聽 聽 聽 聽 Define Font oFont1 Name "Arial" Size 0,35 聽 聽BOLD

聽 聽聽聽 聽 聽 聽 DEFINE DIALOG oDlg2 SIZE 350,250 PIXEL TRUEPIXEL FONT oFont2 聽 STYLE nOr( WS_POPUP, WS_VISIBLE, WS_DLGFRAME )

聽 聽 聽聽 聽聽 聽 聽 聽 @ 00,15 SAY otitu PROMPT " INGRESO A SISTEMA " 聽PIXEL OF oDlg2 CENTER COLORS RGB(0,100,0) 聽 FONT oFont5

聽 聽 聽 聽 聽 聽 聽 聽 @ 070,020 SAY "Usuario" 聽 聽 聽 SIZE 90,20 PIXEL OF oDlg2 聽RIGHT
聽 聽聽聽 聽 聽 聽 @ 130,020 SAY "Clave" 聽 聽 聽 聽 聽 SIZE 90,20 PIXEL OF oDlg2 聽RIGHT

聽 聽 聽聽 聽聽 聽 聽 聽 @ 070,140 GET oCod_Usu1 聽 聽Var Cod_Usu1 聽 SIZE 100,22 PIXEL OF oDlg2 聽 PICTURE "@!" UPDATE 聽 聽 聽 聽 聽COLOR RGB(0,0,128) 聽 FONT oFont2
聽 聽 聽聽 聽聽 聽 聽 聽 @ 130,140 GET oCla_Usu1 聽 聽Var Cla_Usu1 聽 SIZE 100,22 PIXEL OF oDlg2 聽 PICTURE "@!" UPDATE PASSWORD COLOR RGB(0,0,128) 聽 FONT oFont2

聽 聽 聽 聽 聽 聽 聽 聽 @ 180,240 BTNBMP SIZE 75, 50 PROMPT "SALIR" 聽OF oDlg2 PIXEL 2007 Resource "#8028" 聽FONT oFont4;
聽 聽聽聽 聽 聽 聽 聽 聽 聽 聽 ToolTip 聽"SALIR DEL SISTEMA";
聽 聽聽 聽 聽聽 聽 聽 聽 聽 聽 ACTION (Ing_1:=0,Ing_2:=0,oDlg2:End())
聽 聽 聽聽 聽聽 聽 聽 聽 @ 180,050 BTNBMP 聽SIZE 75, 50 PROMPT "ACEPTAR" OF oDlg2 2007 Resource "#8023" FONT oFont4


聽 聽 聽 聽 聽 聽 聽 聽 ACTIVATE DIALOG oDlg2 CENTERED
聽 聽 聽聽 聽聽 聽 聽 聽 RELEASE FONT oFont1,oFont2,oFont4,oFont5 ,oFont3


聽 Return(Ing_1)


BAT
Code (fw): Select all Collapse
@ECHO OFF
CLS
ECHO 脷脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛驴
ECHO 鲁 FiveWin for Harbour 22.03 (VS32bits) Mar. 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%
if exist "%ProgramFiles%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" call "%ProgramFiles%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
if exist "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" call "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" x86
if "%FWDIR%" == "" set FWDIR=c:\util\fwh22.03
if "%HBDIR%" == "" set HBDIR=C:\Util\harbour_win32_msvc_2020_10_19
ECHO Compiling...

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

@cd %current_dir%
%hdir%\bin\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 -TP -W3 -c /GS- /I%hdir%\include /GA %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 path=%oldpath%
@set include=%oldinclude%
@set lib=%oldlib%
@set libpath=%oldlibpath%
@set oldpath=""
@set oldinclude=""
@set oldlib=""
@set oldlibpath=""
%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
FWH 22.10 - HARBOUR - PELLES C
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Error al Compilar con MSVC 2019
Posted: Sun Apr 24, 2022 09:47 PM

> dentro del codigo hay un error

Cual es ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 719
Joined: Fri May 12, 2017 02:50 PM
Re: Error al Compilar con MSVC 2019
Posted: Sun Apr 24, 2022 10:53 PM
Antonio Linares wrote:> dentro del codigo hay un error

Cual es ?


Maestro Antonio

Muchas gracias por su respuesta.

Era tan simple, si no llamaba la funci贸n, como se iba a ejecutar!!!!

El mismo programa, la misma funci贸n, en el EXE con "hbmk2", si funciona, pero para "MSVC", tuve que cambiar el nombre de la funci贸n a "Main()".

Muchas gracias Maestro Antonio.

Saludos

Antonio
FWH 22.10 - HARBOUR - PELLES C
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Error al Compilar con MSVC 2019
Posted: Mon Apr 25, 2022 08:24 AM

muy bien :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion