FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour Migraci贸n desde xHarbour+BCC a Harbour+MSVC
Posts: 248
Joined: Wed Jan 11, 2006 11:30 AM
Re: Migraci贸n desde xHarbour+BCC a Harbour+MSVC
Posted: Fri Feb 27, 2009 08:36 AM
Maestro ;

En Vc2005 y Vc2008 no se usa single-thread, agora debe usar solamente la LibcMt.Lib ( multi-threaded ).

La Libc.lib deve ser ignorada :

$(VCDIR)\bin\link @msvc.tmp /NODEFAULTLIB:LIBC.LIB /nologo /subsystem:windows /force:multiple >

http://msdn.microsoft.com/pt-br/library/6wtdswk0(VS.80).aspx

Saluds, Ale
aleseribeli@hotmail.com

FwH, Hb Svn, ADS 8.1, ADS 10, Pelles C, FwPPC, MsVc 2008, MsVc 2010
"Conhecimento, voc锚 n茫o subtrai quando divide; mas soma e multiplica."
**---M谩rio Persona---**
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Migraci贸n desde xHarbour+BCC a Harbour+MSVC
Posted: Fri Feb 27, 2009 10:29 AM

Ale,

Si, cierto, gracias :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Migraci贸n desde xHarbour+BCC a Harbour+MSVC
Posted: Fri Feb 27, 2009 12:29 PM

Kleyber,

Una vez construyas Harbour con esta nueva version de VC, puedes construir aplicaciones con FWH usando las librerias de FWH existentes. Lo hemos probado y funciona bien :-)

Es decir, VC (2008) mantiene compatibilidad con VC98. Posiblemente la unica incompatibilidad sea con los modulos en C++ que se usan en FWH (ActiveX, GIFs).

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 581
Joined: Tue Oct 11, 2005 11:28 AM
Re: Migraci贸n desde xHarbour+BCC a Harbour+MSVC
Posted: Fri Feb 27, 2009 12:41 PM
Antonio Linares wrote:Kleyber,

Una vez construyas Harbour con esta nueva version de VC, puedes construir aplicaciones con FWH usando las librerias de FWH existentes. Lo hemos probado y funciona bien :-)

Es decir, VC (2008) mantiene compatibilidad con VC98. Posiblemente la unica incompatibilidad sea con los modulos en C++ que se usan en FWH (ActiveX, GIFs).


Entonces eso quiere decir que puedo usar con las libs de FWH 8.02 que uso? Y cuales son las clases que deberia cambiar para que no tenga incompatibilidad con el VC Express?

Saludos
Kleyber Derick



FWH / xHb / xDevStudio / SQLLIB
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Migraci贸n desde xHarbour+BCC a Harbour+MSVC
Posted: Fri Feb 27, 2009 12:48 PM

Kleyber,

> Entonces eso quiere decir que puedo usar con las libs de FWH 8.02 que uso?

Si. FiveHM.lib y FiveHCM.lib

> Y cuales son las clases que deberia cambiar para que no tenga incompatibilidad con el VC Express?

En principio ninguna :-) Acabamos de probar los ActiveX y funcionan bien!

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 581
Joined: Tue Oct 11, 2005 11:28 AM
Re: Migraci贸n desde xHarbour+BCC a Harbour+MSVC
Posted: Fri Feb 27, 2009 12:56 PM

Gracias Antonio. Lo voy a probar ahora mismo.

Saludos,

Kleyber Derick



FWH / xHb / xDevStudio / SQLLIB
Posts: 248
Joined: Wed Jan 11, 2006 11:30 AM
Re: Migraci贸n desde xHarbour+BCC a Harbour+MSVC
Posted: Fri Feb 27, 2009 12:59 PM

Maestro,

Usted puede enviarme el make correcto que podremos usar con FWH+Hb_svn+WC2008 con los flags necesarios y un ejemplo de como generar una lib desde 1 prg y 1 fichero C?

Asi podremos regenerar nuestras clases personales !

Saluds, Ale

aleseribeli@hotmail.com

FwH, Hb Svn, ADS 8.1, ADS 10, Pelles C, FwPPC, MsVc 2008, MsVc 2010
"Conhecimento, voc锚 n茫o subtrai quando divide; mas soma e multiplica."
**---M谩rio Persona---**
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Migraci贸n desde xHarbour+BCC a Harbour+MSVC
Posted: Fri Feb 27, 2009 01:13 PM
Ale,

Para hacer un checkout de Harbour nosotros hemos usado este bat:

checkout.bat
Code (fw): Select all Collapse
c:\"Program Files"\svn\bin\svn co https://harbour-project.svn.sourceforge.net/svnroot/harbour-project/trunk/harbour harbour

Usando este SVN que no requiere instalacion:
www.fivetechsoft.com/files/software/svn.zip

Luego para construir Harbour, hemos usado este fichero BAT que hemos copiado en donde esta make_vc.bat

makevc.bat
Code (fw): Select all Collapse
SET LIB=c:\vc2008\lib
SET INCLUDE=c:\vc2008\include
SET PATH=c:\vc2008\bin;%PATH%

SET HB_CC_NAME=vc
SET HB_ARCHITECTURE=w32
SET HB_GT_LIB=gtgui
SET HB_GT_DEFAULT=gui
SET HB_VISUALC_VER=60
SET HB_BUILD_MODE=c
SET C_USR= -DHARBOUR_MAIN_WIN -DHB_DYNLIB -DHB_FM_STATISTICS_OFF
SET HB_BUILD_DLL=no
SET HB_MAKE_PROGRAM=c:\vc2008\bin\nmake.exe

if A%1 == A GOTO :BUILD
make_vc %1

:BUILD
make_vc


Este mismo fichero BAT hay que copiarlo a la carpeta contrib y modificarlo para que llame a make_vc_all en vez de make_vc. Asi construye todas las librerias de contribuciones.

En un proximo mensaje explicamos como compilar un PRG, a C, a OBJ y reemplazarlo en una libreria.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Migraci贸n desde xHarbour+BCC a Harbour+MSVC
Posted: Sat Feb 28, 2009 08:32 AM

Asi se puede, despues de compilar un PRG, generar el OBJ y reemplazarlo en una libreria:

c:\VC2008\bin\cl -c -Ic:\harbour\include -Ic:\VC2008\include file.c
c:\VC2008\bin\Lib MyLib.lib /OUT:MyLib.lib file.obj

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 581
Joined: Tue Oct 11, 2005 11:28 AM
Re: Migraci贸n desde xHarbour+BCC a Harbour+MSVC
Posted: Mon Mar 02, 2009 07:24 PM

Antonio, muchas gracias por el aporte. Voy a testar aqui Harbour+MSVC+FWH y te comento los resultados.

Saludos,

Kleyber Derick



FWH / xHb / xDevStudio / SQLLIB
Posts: 581
Joined: Tue Oct 11, 2005 11:28 AM
Re: Migraci贸n desde xHarbour+BCC a Harbour+MSVC
Posted: Wed Mar 04, 2009 06:46 PM
Antonio,

Bueno, te comento mis resultados. He hecho este bat para la reconstrucci贸n de la lib FIVEHM.LIB:

Code (fw): Select all Collapse
cls
if exist *.c 聽 del *.c
if exist *.obj del *.obj
if exist *.prg del *.prg

copy \fwh802\source\classes\*.prg
copy \fwh802\source\function\*.prg
copy \fwh\source\function\*.c
copy \fwh802\source\winapi\*.prg
copy \fwh\source\winapi\*.c

if "%CC_DIR%" 聽== "" set CC_DIR=%ProgramFiles%\Microsoft Visual Studio 9.0\VC

pause
for %%f in (*.prg) do c:\harbour\bin\harbour %%f /n /ic:\fwh\include;c:\harbour\include 
pause
for %%f in (*.c) 聽 do "%CC_DIR%\bin\cl" -c -Ic:\harbour\include -I"%CC_DIR%\include" %%f 
pause
for %%f in (*.obj) do "%CC_DIR%\bin\Lib" fivehm.lib /OUT:fivehm.lib %%f


Pero no he logrado generar la lib. He notado que durante la compilaci贸n, si existe algun erro en un prg o en un c el bat no se detiene y la compilacion continua hasta el final, mismo con los errores mostrados. Que hago mal?

Saludos,
Kleyber Derick



FWH / xHb / xDevStudio / SQLLIB
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Migraci贸n desde xHarbour+BCC a Harbour+MSVC
Posted: Wed Mar 04, 2009 07:09 PM
Kleyber,

> Pero no he logrado generar la lib.

La libreria tiene que existir previamente. Tienes que crearla usando un fichero DEF:

lib.exe /def:mylib.def /out:mylib.lib

mylib.def es suficiente con que contenga esto
Code (fw): Select all Collapse
LIBRARY 聽 聽 MYLIB.LIB

EXPORTS


>
He notado que durante la compilaci贸n, si existe algun erro en un prg o en un c el bat no se detiene y la compilacion continua hasta el final, mismo con los errores mostrados.
>

habria que ver la forma de usar el errorlevel para detener un for dentro del BAT. Un error genera un errorlevel 1.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 581
Joined: Tue Oct 11, 2005 11:28 AM
Re: Migraci贸n desde xHarbour+BCC a Harbour+MSVC
Posted: Wed Mar 04, 2009 07:26 PM

Si, verdad, pero no estoy mirando como poner esto. Y es cierto que existen alguns prgs que tienen errores... Desafortunadamente el FIVEHM.LIB y el FIVEHCM.LIB de la versi贸n 8.02 no son compatibles con el VC Express que tengo aqui. Por esto necesito hacer la regeneraci贸n de la lib FIVEHM. Lo que hago?

Saludos,

Kleyber Derick



FWH / xHb / xDevStudio / SQLLIB
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: Migraci贸n desde xHarbour+BCC a Harbour+MSVC
Posted: Wed Mar 04, 2009 09:06 PM

Kleyber,

> no son compatibles con el VC Express

Por que ? Que errores te aparecen ? De enlazado ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 581
Joined: Tue Oct 11, 2005 11:28 AM
Re: Migraci贸n desde xHarbour+BCC a Harbour+MSVC
Posted: Wed Mar 04, 2009 10:50 PM
Antonio

Antonio Linares wrote:
Por que ? Que errores te aparecen ? De enlazado ?


Exactamente. Intent茅 compilar el BROWSE.PRG de la carpeta SAMPLES y el resultado es esto:

Code (fw): Select all Collapse
脷脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛驴
鲁 FiveWin for Harbour 8.02 (MSVC++) Fev. 2008 聽 聽 聽Harbour development power 鲁脺
鲁 (c) FiveTech, 1993-2008 聽 聽 for Microsoft Windows 9X/NT/200X/ME/XP/Vista 鲁脹
脌脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脵脹
每 脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽
Setting environment for using Microsoft Visual Studio 2008 x86 tools.
Compiling...

..\include\FiveWin.ch(81) Warning W0001 聽Redefinition or duplicate definition of #define HB_SYMBOL_UNUSED
browse.c
Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1

Copyright (C) Microsoft Corporation. 聽All rights reserved.


FiveHCM.lib(CURSORS.obj) : warning LNK4006: _HB_FUN_CURSORNO already defined in FiveHM.lib(CONTROL.obj); second definition ignored
hbrtl.lib(tget.obj) : warning LNK4006: _HB_FUN_GETNEW already defined in FiveHM.lib(TCLIPGET.obj); second definition ignored
gtgui.lib(gtgui.obj) : warning LNK4006: _HB_FUN_HB_GT_GUI_DEFAULT already defined in FiveHM.lib(ERRSYSW.obj); second definition ignored
FiveHM.lib(HARBOUR.obj) : error LNK2001: unresolved external symbol _HB_FUN_HB_DBG_VMVARSLEN
FiveHM.lib(HARBOUR.obj) : error LNK2001: unresolved external symbol _HB_FUN_HB_DBG_VMVARLGET
FiveHM.lib(HARBOUR.obj) : error LNK2001: unresolved external symbol _HB_FUN_HB_DBG_VMPARLLIST
FiveHM.lib(HARBOUR.obj) : error LNK2001: unresolved external symbol _HB_FUN_HB_DBG_VMSTKLCOUNT
FiveHCM.lib(CURSORS.obj) : error LNK2019: unresolved external symbol _GetGuiResources referenced in function _HB_FUN_GETGUIRESOURCES
browse.exe : fatal error LNK1120: 5 unresolved externals
* Linking errors *


Y el BUILDHM.BAT que tengo es este:

Code (fw): Select all Collapse
@ECHO OFF
CLS
ECHO 脷脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛驴
ECHO 鲁 FiveWin for Harbour 8.02 (MSVC++) Fev. 2008 聽 聽 聽Harbour development power 鲁脺
ECHO 鲁 (c) FiveTech, 1993-2008 聽 聽 for Microsoft Windows 9X/NT/200X/ME/XP/Vista 鲁脹
ECHO 脌脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脛脵脹
ECHO 每 脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽脽

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

REM ***
REM *** Adaptado para uso do FWH & MSVC Express 2008 por Vailton Renato
REM ***
call "%ProgramFiles%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86

if "%CC_DIR%" 聽== "" set CC_DIR=%ProgramFiles%\Microsoft Visual Studio 9.0\VC
if "%SDK_DIR%" == "" set SDK_DIR=%ProgramFiles%\Microsoft SDKs\Windows\v6.0A
if "%HBDIR%" 聽 == "" set HBDIR=c:\harbour

ECHO Compiling...

if exist %HBDIR%\bin\harbour.exe 聽 聽set hdir=%HBDIR%\bin
if exist %HBDIR%\bin\vc\harbour.exe set hdir=%HBDIR%\bin\vc

if exist %HBDIR%\lib\hbvm.lib 聽 聽 聽 set hdirl=%HBDIR%\lib
if exist %HBDIR%\lib\vc\hbvm.lib 聽 聽set hdirl=%HBDIR%\lib\vc

set include=%CC_DIR%\include;%HBDIR%\include;%include%
set lib=%CC_DIR%\lib;%SDK_DIR%\lib;%hdir%\lib;%lib%

"%hdir%\harbour" %1 /n /i..\include;%HBDIR%\include /w /p %2 %3 > comp.log
IF ERRORLEVEL 1 GOTO COMPILEERROR
type comp.log

"%CC_DIR%\bin\cl" -TP -W3 -c /GA %1.c
:ENDCOMPILE

IF EXIST %1.rc "%SDK_DIR%\bin\rc" -r -d__FLAT__ %1

echo %1.obj 聽> msvc.tmp
echo ..\lib\FiveHM.lib ..\lib\FiveHCM.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

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

echo "%CC_DIR%\lib\libcmt.lib" 聽>> msvc.tmp
echo "%SDK_DIR%\lib\kernel32.lib" 聽>> msvc.tmp
echo "%SDK_DIR%\lib\user32.lib" 聽 聽>> msvc.tmp
echo "%SDK_DIR%\lib\gdi32.lib" 聽 聽 >> msvc.tmp
echo "%SDK_DIR%\lib\winspool.lib" 聽>> msvc.tmp
echo "%SDK_DIR%\lib\comctl32.lib" 聽>> msvc.tmp
echo "%SDK_DIR%\lib\comdlg32.lib" 聽>> msvc.tmp
echo "%SDK_DIR%\lib\advapi32.lib" 聽>> msvc.tmp
echo "%SDK_DIR%\lib\shell32.lib" 聽 >> msvc.tmp
echo "%SDK_DIR%\lib\ole32.lib" 聽 聽 >> msvc.tmp
echo "%SDK_DIR%\lib\oleaut32.lib" 聽>> msvc.tmp
echo "%SDK_DIR%\lib\uuid.lib" 聽 聽 聽>> msvc.tmp
echo "%SDK_DIR%\lib\odbc32.lib" 聽 聽>> msvc.tmp
echo "%SDK_DIR%\lib\odbccp32.lib" 聽>> msvc.tmp
echo "%SDK_DIR%\lib\iphlpapi.lib" 聽>> msvc.tmp
echo "%SDK_DIR%\lib\mpr.lib" 聽 聽 聽 >> msvc.tmp
echo "%SDK_DIR%\lib\version.lib" 聽 >> msvc.tmp
echo "%SDK_DIR%\lib\wsock32.lib" 聽 >> msvc.tmp
echo "%SDK_DIR%\lib\msimg32.lib" 聽 >> msvc.tmp

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

"%CC_DIR%\bin\link" @msvc.tmp /NODEFAULTLIB:LIBC.LIB /nologo /subsystem:windows /force:multiple /NODEFAULTLIB:libcmt

IF ERRORLEVEL 1 GOTO LINKERROR
ECHO * Application successfully built *
%1
GOTO EXIT
ECHO

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

:COMPILEERROR
@type comp.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


Que hago ahora?

Saludos,
Kleyber Derick



FWH / xHb / xDevStudio / SQLLIB