MSVC buildh32.bat

Post Reply
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

MSVC buildh32.bat

Post by Jimmy »

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
Antonio Linares
Site Admin
Posts: 42595
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 38 times
Been thanked: 86 times
Contact:

Re: MSVC buildh32.bat

Post by Antonio Linares »

Dear Jimmy,

Are you using Visual Studio Community 2022 ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: MSVC buildh32.bat

Post by Jimmy »

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
Antonio Linares
Site Admin
Posts: 42595
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 38 times
Been thanked: 86 times
Contact:

Re: MSVC buildh32.bat

Post by Antonio Linares »

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
TimStone
Posts: 2956
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Has thanked: 25 times
Been thanked: 2 times
Contact:

Re: MSVC buildh32.bat

Post by TimStone »

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


@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



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


@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



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
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: MSVC buildh32.bat

Post by Jimmy »

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
Enrico Maria Giordano
Posts: 8765
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 5 times
Contact:

Re: MSVC buildh32.bat

Post by Enrico Maria Giordano »

[quote="TimStone"]

Code: Select all | Expand

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
Antonio Linares
Site Admin
Posts: 42595
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 38 times
Been thanked: 86 times
Contact:

Re: MSVC buildh32.bat

Post by Antonio Linares »

Dear Enrico,

I guess nmake works the same for both architectures

just guessing
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Enrico Maria Giordano
Posts: 8765
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 5 times
Contact:

Re: MSVC buildh32.bat

Post by Enrico Maria Giordano »

Hi Antonio, I don't understand your answer... ?
User avatar
Enrico Maria Giordano
Posts: 8765
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Has thanked: 1 time
Been thanked: 5 times
Contact:

Re: MSVC buildh32.bat

Post by Enrico Maria Giordano »

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
TimStone
Posts: 2956
Joined: Fri Oct 07, 2005 1:45 pm
Location: Trabuco Canyon, CA USA
Has thanked: 25 times
Been thanked: 2 times
Contact:

Re: MSVC buildh32.bat

Post by TimStone »

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
Post Reply