moving to MSVC 32 bits

User avatar
lucasdebeltran
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am
Contact:

moving to MSVC 32 bits

Post by lucasdebeltran »

Hello,

I am going to move to MSVC and I think it is a good idea to start a new topic with the questions I have, so it would be very usefull for further users.

In first place, Antonio please would be possible for FW 13.02 to have updated Harbour build and fwh\makes\msmakes.zip please?.

What version of MSVC should I use, 2010 or 2010?.

Also, I please need the make file for making a lib. This is how I build it under BCC:
REM @echo off
cls

del obj\*.* /q
del lib\*.lib

rem

rem


SET HB_DIR=c:\harbour
SET BCC_DIR=c:\bcc582
SET FW_DIR=c:\FWH


if "%1" == "clean" goto CLEAN
if "%1" == "CLEAN" goto CLEAN

:BUILD


%BCC_DIR%\bin\make -fLIB.mak %1 %2 %3 >> make_libh.log

if errorlevel 1 goto BUILD_ERR

:BUILD_OK

goto EXIT

:BUILD_ERR

notepad make_libh.log
goto EXIT

:CLEAN

if exist lib\*.lib del lib\*.lib
if exist source\obj\*.obj del source\obj\*.obj

goto EXIT

:EXIT

del *.log

The lib.mak file:

Code: Select all

# Libray directories & filenames #############################################

LIB_NAME         = lib\custom_fivewin.lib
LIB_PRG_DIR      = source
LIB_OBJ_DIR      = obj
LIB_INCLUDE_DIR  = include


# LIBRARY PRG files (your PRG files go here) #################################

LIB_PRG_LIST =  rpreview.prg \
        meter.prg  \
                msgget.prg \
        varios.prg \
                xbrowse.prg \
                report.prg \
                errsysw.prg 


LIB_C_LIST = funcionesc.c

# Make directives ############################################################

.autodepend
.swap
.suffixes: .prg .hrb .c

# Paths for dependent files ##################################################

.path.prg = $(LIB_PRG_DIR)
.path.c   = $(LIB_PRG_DIR)
.path.hrb = $(LIB_OBJ_DIR)
.path.obj = $(LIB_OBJ_DIR)

# Contruction of the rest dependency lists ###################################

LIB_PRGS  = $(LIB_PRG_LIST)
LIB_C     = $(LIB_C_LIST)
LIB_HRB   = $(LIB_PRG_LIST:.prg=.hrb)
LIB_OBJS  = $(LIB_PRG_LIST:.prg=.obj) $(LIB_C_LIST:.c=.obj)

# FiveWin directories & flags ################################################

FW_INCLUDE_DIR = $(FW_DIR)\include
FW_LIB_DIR     = $(FW_DIR)\lib

# Harbour directories & flags ################################################

HARBOUR_INCLUDE_DIR = $(HB_DIR)\include
HARBOUR_EXE_DIR     = $(HB_DIR)\bin
HARBOUR_LIB_DIR     = $(HB_DIR)\lib
HARBOUR_FLAGS       = -i$(LIB_INCLUDE_DIR);$(HARBOUR_INCLUDE_DIR);$(FW_INCLUDE_DIR) -n -m -w -es2 -gc0
HARBOUR_EXE         = $(HARBOUR_EXE_DIR)\harbour.exe

# Borlanc directories & flags ################################################

BORLANDC_INCLUDE_DIR = $(BCC_DIR)\include
BORLANDC_EXE_DIR     = $(BCC_DIR)\bin
BORLANDC_LIB_DIR     = $(BCC_DIR)\lib
BORLANDC_COMP_FLAGS  = -c -O2 -I$(HARBOUR_INCLUDE_DIR);$(BORLANDC_INCLUDE_DIR)
BORLANDC_COMP_EXE    = $(BORLANDC_EXE_DIR)\bcc32.exe
BORLANDC_LIB_EXE     = $(BORLANDC_EXE_DIR)\tlib.exe

# Dependencies ###############################################################

all: $(LIB_OBJS) $(LIB_HRB) $(LIB_NAME)

# Implicit Rules #############################################################

.prg.hrb:
   $(HARBOUR_EXE) $(HARBOUR_FLAGS) $** -o$@

.c.obj:
   $(BORLANDC_COMP_EXE) $(BORLANDC_COMP_FLAGS) -D__HARBOUR__;HB_API_MACROS -o$@ $**
   $(BORLANDC_LIB_EXE) $(LIB_NAME) -+ $@,,

.hrb.obj:
   $(BORLANDC_COMP_EXE) $(BORLANDC_COMP_FLAGS) -o$@ $**
   $(BORLANDC_LIB_EXE) $(LIB_NAME) -+ $@,,


 


Thanks a lot. Best regards,
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: moving to MSVC 32 bits

Post by Antonio Linares »

Lucas,

This is the last Harbour for MSVC build that we published:

http://code.google.com/p/harbour-and-xh ... =microsoft

No one else asked for a newer version, so I am happy that you ask for it :-) I think that Microsoft C is a great compiler, and it is available for free, though it is not open source.

If you are using Windows 8, then MSVC 2012 would seem the right choice. But you can keep using MSVC 2010, if you want to. Which one do you prefer ? :-)
regards, saludos

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

Re: moving to MSVC 32 bits

Post by Antonio Linares »

Lucas,

In FWH\makes\vs2010_make.zip you have a make file for MS VC 2010.

Its quite simple to adapt it to build a library :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
lucasdebeltran
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am
Contact:

Re: moving to MSVC 32 bits

Post by lucasdebeltran »

Antonio,

As you use MSVC 2010 I think I will use same version, 2010.

Could you please provide the .zip file as this one http:... (edited by A.L.)

And also, can you provide please rc.exe to compile .rc files please?.


Finally, when you have time I would appreciate the help with the make for the .lib. The flags are different for making an .exe than a .lib.

Thank you very much. Also I hope this post will help users to move to MSVC and, also, prepare the road for FWH64 ;).
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: moving to MSVC 32 bits

Post by Antonio Linares »

Lucas,

You should use MSVC 2010 express installer. As it is, from Microsoft. We are not allowed to provide those files in any way.

If we did it, sometimes in the past, is because they were not easily available, just to help users. When an official installer works fine, we always recommend to use the original files from the manufacturer (Microsoft in this case).
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
lucasdebeltran
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am
Contact:

Re: moving to MSVC 32 bits

Post by lucasdebeltran »

Antonio,

Thank you, it was for avoiding installing such garbage of the full product.

When you have time, please I would appreciate the make file for building a .lib. Also, it will be very important for users.

Thanks.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
lucasdebeltran
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am
Contact:

Re: moving to MSVC 32 bits

Post by lucasdebeltran »

When you have time, please I would appreciate the make file for building a .lib with MSVC2010
Thank you so much.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: moving to MSVC 32 bits

Post by Antonio Linares »

Lucas,

go.bat

Code: Select all

c:\"Program Files (x86)\Microsoft Visual Studio 10.0"\VC\bin\nmake -ftest.mak
test.mak

Code: Select all

HBDIR=c:\harbour
FWDIR=c:\fwh
VCDIR="c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC"
SDKDIR="c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A"

.SUFFIXES: .prg .c .obj

test.lib : one.obj two.obj three.obj
   if not exist test.lib $(VCDIR)\bin\lib /DEF:test.def /OUT:test.lib
   $(VCDIR)\bin\lib test.lib /OUT:test.lib one.obj two.obj three.obj
   
one.obj   : one.c
two.obj   : two.c
three.obj : three.c

one.c   : one.prg
two.c   : two.prg
three.c : three.prg

.prg.c:
   $(HBDIR)\bin\harbour $< /n /i$(FWDIR)\include;$(HBDIR)\include

.c.obj:
   SET PATH=$(VCDIR)\bin
   cl.exe -c -TP -W3 -I$(HBDIR)\include -I$(SDKDIR)\include -I$(VCDIR)\include $<
 
test.def

Code: Select all

LIBRARY test

EXPORTS
           dummy      @1
regards, saludos

Antonio Linares
www.fivetechsoft.com
nnicanor
Posts: 296
Joined: Fri Apr 23, 2010 4:30 am
Location: Colombia

Re: moving to MSVC 32 bits

Post by nnicanor »

I can send to you xdevstudio configured to suport harbour and xHarbour for BCC and MVC

Regards,
Nicanor Martinez M.
Auditoria y Sistemas Ltda.
MicroExpress Ltda.
FW + FWH + XHARBOUR + HARBOUR + PELLES C + XDEVSTUDIO + XEDIT + BCC + VC_X86 + VCC_X64 + MINGW + R&R Reports + FastReport + Tdolphin + ADO + MYSQL + MARIADB + ORACLE
nnicanor@yahoo.com
User avatar
lucasdebeltran
Posts: 1303
Joined: Tue Jul 21, 2009 8:12 am
Contact:

Re: moving to MSVC 32 bits

Post by lucasdebeltran »

Nicanor,

The script posted by Antonio works fine.

The only problem is to indicate a different directory for sources and objs:
http://forums.fivetechsupport.com/viewforum.php?f=6


That´s the remaining issue to rebuild my App.

Thanks a lot.
Muchas gracias. Many thanks.

Un saludo, Best regards,

Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]

Implementando MSVC 2010, FWH64 y ADO.

Abandonando uso xHarbour y SQLRDD.
nnicanor
Posts: 296
Joined: Fri Apr 23, 2010 4:30 am
Location: Colombia

Re: moving to MSVC 32 bits

Post by nnicanor »

This is an example script to compile application using make from borland and compiling with MSVC


c:\bcc58\bin\make -K -fmakefile0.mak


makefile0.mak

Code: Select all


#Microsoft make sample, (c) FiveTech Software 2005

HBDIR=c:\devel\hb\hb21
VCDIR=c:\devel\c\vc2008
FWDIR=c:\devel\fwh\fwh

.SUFFIXES: .prg .c .obj .rc .res

controleshm.exe : .\resource2\controles.res .\obj\controles.obj .\obj\wbrwlineh_vc.obj .\obj\updftp2.obj .\obj\xbrowse1105.obj .\obj\wbrowseh.obj .\obj\dic.obj .\obj\dsay.obj .\obj\empresas.obj .\obj\errsysw.obj .\obj\fastreph.obj .\obj\femail.obj .\obj\fwcal.obj .\obj\gestionreportes.obj .\obj\mysql_utils.obj .\obj\procesos.obj .\obj\quickwin.obj .\obj\rddarray.obj .\obj\recursosn.obj .\obj\sayref.obj .\obj\setbrw.obj .\obj\tcb1007.obj .\obj\tcbrowse.obj .\obj\testfile2.obj .\obj\testxbr3.obj .\obj\tfilexls.obj .\obj\tmultiuse.obj .\obj\tsysinfo.obj .\obj\usuarios.obj .\obj\xlserror.obj .\obj\xlsfunc.obj .\resource2\controles.res
   echo .\obj\controles.obj .\obj\wbrwlineh_vc.obj .\obj\xbrowse1105.obj .\obj\wbrowseh.obj .\obj\updftp2.obj .\obj\dic.obj .\obj\dsay.obj .\obj\empresas.obj .\obj\errsysw.obj .\obj\fastreph.obj .\obj\femail.obj .\obj\fwcal.obj .\obj\gestionreportes.obj .\obj\mysql_utils.obj .\obj\procesos.obj .\obj\quickwin.obj .\obj\rddarray.obj .\obj\recursosn.obj .\obj\sayref.obj .\obj\setbrw.obj .\obj\tcb1007.obj .\obj\tcbrowse.obj .\obj\testfile2.obj .\obj\testxbr3.obj .\obj\tfilexls.obj .\obj\tmultiuse.obj .\obj\tsysinfo.obj .\obj\usuarios.obj .\obj\xlserror.obj .\obj\xlsfunc.obj > msvc.tmp
   echo $(FWDIR)\lib\FiveHM.lib $(FWDIR)\lib\FiveHCM.lib >> msvc.tmp
   echo $(HBDIR)\lib\mvc\dolphinhm.lib >> msvc.tmp
   echo $(HBDIR)\lib\mvc\libmysqlm.lib >> msvc.tmp
   echo $(HBDIR)\lib\mvc\xhb.lib       >> msvc.tmp
   echo $(HBDIR)\lib\mvc\hbrtl.lib     >> msvc.tmp
   echo $(HBDIR)\lib\mvc\hbvm.lib      >> msvc.tmp
   echo $(HBDIR)\lib\mvc\gtgui.lib     >> msvc.tmp
   echo $(HBDIR)\lib\mvc\hblang.lib    >> msvc.tmp
   echo $(HBDIR)\lib\mvc\hbmacro.lib   >> msvc.tmp
   echo $(HBDIR)\lib\mvc\hbrdd.lib     >> msvc.tmp
   echo $(HBDIR)\lib\mvc\rddntx.lib    >> msvc.tmp
   echo $(HBDIR)\lib\mvc\rddcdx.lib    >> msvc.tmp
   echo $(HBDIR)\lib\mvc\rddfpt.lib    >> msvc.tmp
   echo $(HBDIR)\lib\mvc\hbsix.lib     >> msvc.tmp
   echo $(HBDIR)\lib\mvc\hbct.lib      >> msvc.tmp
   echo $(HBDIR)\lib\mvc\hbdebug.lib   >> msvc.tmp
   echo $(HBDIR)\lib\mvc\hbcommon.lib  >> msvc.tmp
   echo $(HBDIR)\lib\mvc\hbpp.lib      >> msvc.tmp
   echo $(HBDIR)\lib\mvc\hbcpage.lib   >> msvc.tmp
   echo $(HBDIR)\lib\mvc\hbwin.lib     >> msvc.tmp
   echo $(HBDIR)\lib\mvc\hbcplr.lib    >> msvc.tmp
   echo $(HBDIR)\lib\mvc\hbpcre.lib    >> msvc.tmp
   echo $(VCDIR)\lib\kernel32.lib      >> msvc.tmp
   echo $(VCDIR)\lib\user32.lib        >> msvc.tmp
   echo $(VCDIR)\lib\gdi32.lib         >> msvc.tmp
   echo $(VCDIR)\lib\winspool.lib      >> msvc.tmp
   echo $(VCDIR)\lib\comctl32.lib      >> msvc.tmp
   echo $(VCDIR)\lib\comdlg32.lib      >> msvc.tmp
   echo $(VCDIR)\lib\advapi32.lib      >> msvc.tmp
   echo $(VCDIR)\lib\shell32.lib       >> msvc.tmp
   echo $(VCDIR)\lib\ole32.lib         >> msvc.tmp
   echo $(VCDIR)\lib\oleaut32.lib      >> msvc.tmp
   echo $(VCDIR)\lib\uuid.lib          >> msvc.tmp
   echo $(VCDIR)\lib\odbc32.lib        >> msvc.tmp
   echo $(VCDIR)\lib\odbccp32.lib      >> msvc.tmp
   echo $(VCDIR)\lib\iphlpapi.lib      >> msvc.tmp
   echo $(VCDIR)\lib\mpr.lib           >> msvc.tmp
   echo $(VCDIR)\lib\WinMM.Lib         >> msvc.tmp
   echo $(VCDIR)\lib\psapi.lib         >> msvc.tmp
   echo $(VCDIR)\lib\mem32i.lib        >> msvc.tmp
   echo $(VCDIR)\lib\send32i.lib       >> msvc.tmp
   echo $(VCDIR)\lib\libcmt.Lib        >> msvc.tmp
   echo $(VCDIR)\lib\OLDNAMES.Lib      >> msvc.tmp
   echo $(VCDIR)\lib\version.lib       >> msvc.tmp
   echo $(VCDIR)\lib\wsock32.lib       >> msvc.tmp
   echo $(VCDIR)\lib\msimg32.lib       >> msvc.tmp
   echo $(VCDIR)\lib\oledlg.lib        >> msvc.tmp

   IF EXIST .\resource2\controles.res echo .\resource2\controles.res >> msvc.tmp

   SET LIB=$(VCDIR)\lib
   $(VCDIR)\bin\link @msvc.tmp /nologo /subsystem:windows /force:multiple /ignore:4006 /NODEFAULTLIB:libc /OUT:bin\controlesHm.exe > link.log

   @type link.log
   @copy msvc.tmp msvc.log
   @del msvc.tmp


.\obj\controles.c         : .\source\prg\controles.prg
.\obj\dic.c               : .\source\prg\dic.prg
.\obj\dsay.c              : .\source\prg\dsay.prg
.\obj\empresas.c          : .\source\prg\empresas.prg
.\obj\errsysw.c           : .\source\prg\errsysw.prg
.\obj\fastreph.c          : .\source\prg\fastreph.prg
.\obj\femail.c            : .\source\prg\femail.prg
.\obj\fwcal.c             : .\source\prg\fwcal.prg
.\obj\gestionreportes.c   : .\source\prg\gestionreportes.prg
.\obj\mysql_utils.c       : .\source\prg\mysql_utils.prg
.\obj\procesos.c          : .\source\prg\procesos.prg
.\obj\quickwin.c          : .\source\prg\quickwin.prg
.\obj\rddarray.c          : .\source\prg\rddarray.prg
.\obj\recursosn.c         : .\source\prg\recursosn.prg
.\obj\sayref.c            : .\source\prg\sayref.prg
.\obj\setbrw.c            : .\source\prg\setbrw.prg
.\obj\tcb1007.c           : .\source\prg\tcb1007.prg
.\obj\tcbrowse.c          : .\source\prg\tcbrowse.prg
.\obj\testfile2.c         : .\source\prg\testfile2.prg
.\obj\testxbr3.c          : .\source\prg\testxbr3.prg
.\obj\tfilexls.c          : .\source\prg\tfilexls.prg
.\obj\tmultiuse.c         : .\source\prg\tmultiuse.prg
.\obj\tsysinfo.c          : .\source\prg\tsysinfo.prg
.\obj\usuarios.c          : .\source\prg\usuarios.prg
.\obj\xlserror.c          : .\source\prg\xlserror.prg
.\obj\xlsfunc.c           : .\source\prg\xlsfunc.prg
.\obj\xbrowse1105.c       : .\source\prg\xbrowse1105.prg
.\obj\updftp2.c           : .\source\prg\updftp2.prg
.\obj\wbrowseh.c          : .\source\prg\wbrowseh.prg
.\obj\wbrwlineh_vc.obj    : .\source\c\wbrwlineh_vc.c
.\resource2\controles.res : .\resource2\controles.rc

.c.obj :
 $(VCDIR)\bin\cl -c -W3 -GA -D__FLAT__ -D_CRT_SECURE_NO_WARNINGS -D__MVC__ -D__HARBOUR__ -I$(HBDIR)\include -I$(VCDIR)\include -I$(VCDIR)\sdk\include -Fo$@ $<
# $(VCDIR)\bin\cl -c -TP -W3 -GA -D__FLAT__ -D_CRT_SECURE_NO_WARNINGS -D__HARBOUR__ -I$(HBDIR)\include -I$(VCDIR)\include -I$(VCDIR)\sdk\include -Fo$@ $<

.prg.c :
   $(HBDIR)\bin\mvc\harbour -o$@ -d__MVC__ $< /n /i$(FWDIR)\include;$(HBDIR)\include;c:\fuentes\librerias\recurlib\include;c:\tdolphing\include

#.c.obj :
#   $(VCDIR)\bin\cl -c -TP -W3 -GA -D_CRT_SECURE_NO_WARNINGS -I$(VCDIR)\include -I$(VCDIR)\sdk\include -I$(HBDIR)\include -Fo$@ $<

.rc.res:
   $(VCDIR)\bin\rc -r -d__FLAT__ -I$(VCDIR)\include -I$(VCDIR)\sdk\include -Fo$@ $<




 
Nicanor Martinez M.
Auditoria y Sistemas Ltda.
MicroExpress Ltda.
FW + FWH + XHARBOUR + HARBOUR + PELLES C + XDEVSTUDIO + XEDIT + BCC + VC_X86 + VCC_X64 + MINGW + R&R Reports + FastReport + Tdolphin + ADO + MYSQL + MARIADB + ORACLE
nnicanor@yahoo.com
User avatar
Rimantas
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Re: moving to MSVC 32 bits

Post by Rimantas »

Antonio Linares wrote:Lucas,
In FWH\makes\vs2010_make.zip you have a make file for MS VC 2010.
Its quite simple to adapt it to build a library :-)

Hi Antonio !

Can you send to me this zip ? I have Fwh 11.12 and here it's msmake.zip in \makes folder. I want to try VC with Fwh ...

With best regards and thanks in advance ! Rimantas
Rimantas U.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: moving to MSVC 32 bits

Post by Antonio Linares »

Rimantas,

Already sent to your email
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Rimantas
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Re: moving to MSVC 32 bits

Post by Rimantas »

Antonio Linares wrote:Rimantas,
Already sent to your email
Many thanks to you Antonio !

Problems ... :) . Reviewing mak file , I found that :

SDKDIR="c:\Program Files\Microsoft SDKs\Windows\v7.0A"
echo $(SDKDIR)\lib\kernel32.lib >> msvc.tmp

I was in surprise , that mine downloaded VS2010_express install do not installed SDK . In mine case is only one folder ( \VS10\SDK\v3.5\Bin ) and empty ... May you direct link from which I can download true VS2010 express ?

With best regards !

P.S.: Now I found that this instalation is for trial ( 30 days ) ... :)
Rimantas U.
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: moving to MSVC 32 bits

Post by Antonio Linares »

regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply