FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour PRG for 32bit & 64bit
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
PRG for 32bit & 64bit
Posted: Wed Mar 23, 2016 07: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
Posts: 3022
Joined: Fri Oct 07, 2005 01:45 PM
Re: PRG for 32bit & 64bit
Posted: Wed Mar 23, 2016 07: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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: PRG for 32bit & 64bit
Posted: Wed Mar 23, 2016 08: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
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Re: PRG for 32bit & 64bit
Posted: Thu Mar 24, 2016 08: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 (fw): Select all Collapse
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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: PRG for 32bit & 64bit
Posted: Thu Mar 24, 2016 08: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 (fw): Select all Collapse
LIBRARY yourlib64

DESCRIPTION 'This is my 64 bits library'

EXPORTS
           dummy      @1
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion