Error al Compilar con MSVC 2019

Error al Compilar con MSVC 2019

Postby remtec » Sun Apr 24, 2022 9: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: Select all  Expand view

#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: Select all  Expand view

#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: Select all  Expand view

@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
remtec
 
Posts: 717
Joined: Fri May 12, 2017 2:50 pm

Re: Error al Compilar con MSVC 2019

Postby Antonio Linares » Sun Apr 24, 2022 9:47 pm

> dentro del codigo hay un error

Cual es ?
regards, saludos

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

Re: Error al Compilar con MSVC 2019

Postby remtec » 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
remtec
 
Posts: 717
Joined: Fri May 12, 2017 2:50 pm

Re: Error al Compilar con MSVC 2019

Postby Antonio Linares » Mon Apr 25, 2022 8:24 am

muy bien :-)
regards, saludos

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


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 87 guests