PRG for 32bit & 64bit

PRG for 32bit & 64bit

Postby Marc Vanzegbroeck » Wed Mar 23, 2016 7:23 pm

Hello,

I have create a library that I use for all my programs, and want to use it also for my 64bit programs.
What is the best way to use some prg files for both 32bit, and 64bit. I only want to maintain 1 set op PRG's.
In my old FWH-library I could create the .OBJ-files with -o option,in an other directory than the PRG-files.
But now, if I want to use that option in HARBOUR 64bit, I get a message thet this is an old option that will be deleted.

I can create a bat-file that copy each time all my PRG-files from one directory to an other (for use of 64bit). So I only modify the PRG's in the main directory, or is there a better way?

Thanks
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: PRG for 32bit & 64bit

Postby TimStone » Wed Mar 23, 2016 7:52 pm

Marc,

I maintain one code set of .prg files, all in a Source folder.

I have 3 builds currently: xHarbour ( .com ), Visual Studio IDE ( with Harbour ), and essentially a Ultra Edit Studio make file that uses VC++ 2013 and Harbour. These are all 32 bit. No matter what build I create ( all determined by their own configurations ), I only have one set of source files to maintain.

Now I am planning to also add Visual Studio 2015 Community into the process, with the FWH 64 and Harbour 64 libs. I will be using the VS 2015 IDE to build this. My initial work shows I should be able to accomplish this. Again, all of my source .prg files will be in 1 folder, and thus I will only have one set of files to maintain.

The key is to use the right linker and compiler for 32 or 64 bit. Let each output their own .c and .obj files, and link in the proper .lib files. The end result will be the .exe you want.

My biggest problem right now is in finding the right supplemental libs. I have a few 3rd party programs that may have issues and are too costly to update to 64 bit.

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

Re: PRG for 32bit & 64bit

Postby Antonio Linares » Wed Mar 23, 2016 8:17 pm

Marc,

I have create a library that I use for all my programs, and want to use it also for my 64bit programs.
What is the best way to use some prg files for both 32bit, and 64bit. I only want to maintain 1 set op PRG's.


Use a makefile that creates a library for 32 bits and another library for 64 bits using the same PRGs
regards, saludos

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

Re: PRG for 32bit & 64bit

Postby Marc Vanzegbroeck » Thu Mar 24, 2016 8:03 am

Antonio,

What is the command and options I have to add for creating a LIB-file via the VS2015 LIB.
For the 32bit, I use BCC. I use tlib libname -+object,textfile,libname
the help for the lib of VS2015 is
Code: Select all  Expand view
usage: LIB [options] [files]

   options:

      /DEF[:filename]
      /ERRORREPORT:{NONE|PROMPT|QUEUE|SEND}
      /EXPORT:symbol
      /EXTRACT:membername
      /INCLUDE:symbol
      /LIBPATH:dir
      /LIST[:filename]
      /LTCG
      /MACHINE:{ARM|ARM64|EBC|X64|X86}
      /NAME:filename
      /NODEFAULTLIB[:library]
      /NOLOGO
      /OUT:filename
      /REMOVE:membername
      /SUBSYSTEM:{BOOT_APPLICATION|CONSOLE|EFI_APPLICATION|
                  EFI_BOOT_SERVICE_DRIVER|EFI_ROM|EFI_RUNTIME_DRIVER|
                  NATIVE|POSIX|WINDOWS|WINDOWSCE}[,#[.##]]
      /VERBOSE
      /WX[:NO]
 
Regards,
Marc

FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Re: PRG for 32bit & 64bit

Postby Antonio Linares » Thu Mar 24, 2016 8:16 am

Marc,

"$(VCINSTALLDIR)"bin\x86_amd64\lib yourlib64.lib /OUT:yourlib64.lib yourobj.obj

to create the lib for the first time you have to use a def file:

if not exist yourlib64.lib "$(VCINSTALLDIR)"bin\x86_amd64\lib /DEF:yourlib64.def /OUT:yourlib64.lib

Where yourlib64.def contains:
Code: Select all  Expand view
LIBRARY yourlib64

DESCRIPTION 'This is my 64 bits library'

EXPORTS
           dummy      @1
regards, saludos

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 119 guests