MSVC buildh32.bat

MSVC buildh32.bat

Postby Jimmy » Sun Oct 16, 2022 8:08 am

hi,

there is a file c:\fwh\samples\buildh32.bat

i guess it is for 32 Bit ... but how to use under 32 Bit OS :?:

VisualStudioSetup say "need 64 Bit" ... is there a 32 Bit Version :idea:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: MSVC buildh32.bat

Postby Antonio Linares » Sun Oct 16, 2022 9:13 am

Dear Jimmy,

Are you using Visual Studio Community 2022 ?
regards, saludos

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

Re: MSVC buildh32.bat

Postby Jimmy » Sun Oct 16, 2022 9:23 am

Antonio Linares wrote:Are you using Visual Studio Community 2022 ?

Yes on 64 Bit OS
but it seems not possible on 32 Bit OS to install Visual Studio Community 2022
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: MSVC buildh32.bat

Postby Antonio Linares » Sun Oct 16, 2022 3:03 pm

Dear Jimmy,

I use Windows 11 64 bits, sorry I have not tested it lately on Windows 32 bits
regards, saludos

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

Re: MSVC buildh32.bat

Postby TimStone » Sun Oct 16, 2022 11:38 pm

You use VS Community 2022 on the 64 bit OS only.

However, you can build both 32 bit and 64 bit versions with that install.

When building my program, I can use the VS IDE to build either one. I use those builds for testing because it is very quick.

For distribution product, I'm not using Buildh32.bat, but with my application, I use a .bat plus .mak file. I have one for 32 bit and one for 64 bit. I use the exact same code source. It is only in configuring, and also selecting either the directory of 32 bit, or 64 bit, libraries. I have no problems with either build.

This is the 32 bit .bat file:
Code: Select all  Expand view  RUN

@set oldpath=%path%
@set oldinclude=%include%
@set oldlib=%lib%
@set oldlibpath=%libpath%

if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x86

call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\Hostx86\x86\nmake" -fMLS32.mak

@set path=%oldpath%
@set include=%oldinclude%
@set lib=%oldlib%
@set libpath=%oldlibpath%
@set oldpath=""
@set oldinclude=""
@set oldlib=
@set oldlibpath=


And the setup portion of the .mak file:
Code: Select all  Expand view  RUN


HBDIR=c:\harbour
FWDIR=c:\fwh
VCDIR="c:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\Hostx32\x32"
SDKDIR="c:\Program Files (x86)\Windows Kits\10"
RCDIR="c:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x32"
PRLIB="c:\Projects\Libs"
 


This is the 64 bit .bat file
Code: Select all  Expand view  RUN

@set oldpath=%path%
@set oldinclude=%include%
@set oldlib=%lib%
@set oldlibpath=%libpath%

if exist "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x86_x64

call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\Hostx64\x64\nmake" -fMLS64.mak

@set path=%oldpath%
@set include=%oldinclude%
@set lib=%oldlib%
@set libpath=%oldlibpath%
@set oldpath=""
@set oldinclude=""
@set oldlib=
@set oldlibpath=


And the setup section of the 64 bit .mak file:
Code: Select all  Expand view  RUN


HBDIR=c:\Harbour64
FWDIR=c:\fwh64
VCDIR="c:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.30.30705\bin\Hostx64\x64"
SDKDIR="c:\Program Files (x86)\Windows Kits\10"
RCDIR="c:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64"
PRLIB="c:\Projects\Libs"

 


When specifying the .prg files, they will be the same for both .mak files, but when specifying the .lib files to be used, you will need to be sure you use the correct directories and file names. For example, Fiveh32.lib vs. Fiveh64.lib. Some .libs will be OK for both.

I hope this helps.
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA

Re: MSVC buildh32.bat

Postby Jimmy » Mon Oct 17, 2022 6:11 am

hi Tim,
TimStone wrote:You use VS Community 2022 on the 64 bit OS only.

ah, i understand ... need to use 64 Bit OS to build 32 Bit App ;)
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: MSVC buildh32.bat

Postby Enrico Maria Giordano » Mon Oct 17, 2022 7:46 am

[quote="TimStone"]
Code: Select all  Expand view  RUN
call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.33.31629\bin\Hostx86\x86\nmake" -fMLS32.mak


Why not "Hostx64" for x86 build?
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: MSVC buildh32.bat

Postby Antonio Linares » Mon Oct 17, 2022 7:47 am

Dear Enrico,

I guess nmake works the same for both architectures

just guessing
regards, saludos

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

Re: MSVC buildh32.bat

Postby Enrico Maria Giordano » Mon Oct 17, 2022 7:49 am

Hi Antonio, I don't understand your answer... ?
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: MSVC buildh32.bat

Postby Enrico Maria Giordano » Mon Oct 17, 2022 7:51 am

I meant that you can use Hostx64 for both x64 and x86 build. You only have to run it on a 64bit system.
User avatar
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: MSVC buildh32.bat

Postby TimStone » Mon Oct 17, 2022 5:16 pm

Enrico,

That works fine. I guess I was just working from habit with the older versions. I just tested to be sure.

Tim
Tim Stone
http://www.MasterLinkSoftware.com
http://www.autoshopwriter.com
timstone@masterlinksoftware.com
Using: FWH 23.10 with Harbour 3.2.0 / Microsoft Visual Studio Community 2022-24 32/64 bit
User avatar
TimStone
 
Posts: 2944
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA


Return to FiveWin for Harbour/xHarbour

Who is online

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