Page 1 of 3

Convert DOS application(s) to Harbour <== LIB compatibility

Posted: Thu Jul 28, 2016 11:52 am
by elrosa
Hello!

We want to convert our existing DOS application(s) to Harbour. What is going to be our damage -which libraries, we use, are not compatible-


CA-Clipper (R) 5.3b (Rev. 338)
RMAKE 1.5
BLINKER DOS Extender and Windows Linker 7.00


This is our link script:

BLINKER incremental off
BLINKER EXECUTABLE CLIPPER F:127 E:2048
BLINKER EXECUTABLE EXTENDED
BLINKER EXECUTABLE ALIGNMENT 128
BLINKER PROCEDURE DEPTH 100
BLINKER host message off
BLINKER overlay opsize 50
BLINKER overlay pageframe ON
BLINKER cache XMS 400
BLINKER cache EMS 400

STACK 16000

#map s,a

OUTPUT ems.exe

FILE .\obj\ems
FILE .\obj\ems2
FILE .\obj\overige
FILE .\obj\tn
FILE .\obj\tn1
FILE .\obj\tn2
FILE .\obj\rl
FILE .\obj\rl2
FILE .\obj\rl3
FILE .\obj\pr
FILE .\obj\pr2
FILE .\obj\pr_toep
FILE .\obj\toep_br
FILE .\obj\callrap
FILE .\obj\or0
FILE .\obj\or1
FILE .\obj\or2
FILE .\obj\or3
FILE .\obj\or4
FILE .\obj\or5
FILE .\obj\nc_ver
FILE .\obj\nc_aan
FILE .\obj\prspec
FILE .\obj\ag
FILE .\obj\rd
FILE .\obj\hs
FILE .\obj\conver
FILE .\obj\rk
FILE .\obj\fax
#FILE .\obj\ethanol
//FILE .\obj\verp_bel
FILE .\obj\print
FILE .\obj\getsys
FILE .\obj\errorsy
FILE .\obj\oops
FILE .\obj\browse
FILE .\obj\euro
FILE .\obj\budget
FILE .\obj\html
FILE .\obj\div1
FILE .\obj\div2
FILE .\obj\div3
FILE .\obj\hmenu
FILE .\obj\kostpr
FILE .\obj\snelcalc
FILE .\obj\prbudget
FILE .\obj\brutow
FILE .\obj\monsters
FILE .\obj\alloc
FILE .\obj\pr_overz
FILE .\obj\vis
FILE .\obj\zeevrach
FILE .\obj\log_dien
FILE .\obj\dien_log
FILE .\obj\levtar
FILE .\obj\st
FILE .\obj\combi
FILE .\obj\combi2
FILE .\obj\reach
#FILE .\obj\party
FILE .\obj\pdf
FILE .\obj\rddsys
FILE .\obj\__wait_b
FILE ctintp
FILE ctusp
FILE ctrl
FILE alt
FILE shift
#FILE cld.lib
FILE .\obj\menuto
SEARCH blxclp53
LIB clipper
LIB dbfcdx
LIB _dbfcdx
LIB ctp
LIB ems
LIB pseudo
LIB prohp
LIB OSLib
LIB CPMI
LIB nanfor
LIB Ll
LIB Lfn

Please let us how much re-coding would be necessary… for example is the ProHP lib compatible?

Thanks in advantage.

Maarten

Re: Convert DOS application(s) to Harbour <== LIB compatibility

Posted: Thu Jul 28, 2016 12:27 pm
by Enrico Maria Giordano
elrosa wrote:Please let us how much re-coding would be necessary… for example is the ProHP lib compatible?
No Clipper 16 bit library is compatible with [x]Harbour (32 bit). Try to remove all the third party libraries from the script, look at the unresolved external that linker will list and report them here.

EMG

Re: Convert DOS application(s) to Harbour <== LIB compatibility

Posted: Thu Jul 28, 2016 12:36 pm
by elrosa
Hi Enrico,

thank you for the prompt reply.

We haven't purchased any software yet, because I want to know first what I am looking at (a lot of recode, impossible mission)

I tried HMG a while ago and encountered a lot of problems when trying to convert the Clipper app to 32/64 bits. The biggest issue I had was that the ProHP library wasn't compatible.

Maarten

Re: Convert DOS application(s) to Harbour <== LIB compatibility

Posted: Thu Jul 28, 2016 1:27 pm
by Enrico Maria Giordano
elrosa wrote:We haven't purchased any software yet,
You don't need to buy anything. Harbour or xHarbour are free opensource projects.

EMG

Re: Convert DOS application(s) to Harbour <== LIB compatibility

Posted: Thu Jul 28, 2016 3:09 pm
by elrosa
Try to remove all the third party libraries from the script
Well not quite sure if I blocked all 3 party libs and if they were all 3 party libs, but this is the output:

Code: Select all

BLINKER : 1115 : .\OBJ\EMS.OBJ(EMS) : 'LF_ISFILE' : unresolved external
BLINKER : 1115 : .\OBJ\EMS.OBJ(EMS) : 'LF_FERASE' : unresolved external
BLINKER : 1115 : .\OBJ\EMS.OBJ(EMS) : 'LF_FCREATE' : unresolved external
BLINKER : 1115 : .\OBJ\EMS.OBJ(EMS) : 'HP_SETPOS' : unresolved external
BLINKER : 1115 : .\OBJ\EMS.OBJ(EMS) : 'HP_FILLBOX' : unresolved external
BLINKER : 1115 : .\OBJ\EMS.OBJ(EMS) : 'HP_DATA' : unresolved external
BLINKER : 1115 : .\OBJ\EMS.OBJ(EMS) : 'HP_FEED' : unresolved external
BLINKER : 1115 : .\OBJ\EMS2.OBJ(EMS2) : 'SET2PRINT' : unresolved external
BLINKER : 1115 : .\OBJ\EMS2.OBJ(EMS2) : 'SET2SCREEN' : unresolved external
BLINKER : 1115 : .\OBJ\TN1.OBJ(TN1) : 'HP_PAGESIZ' : unresolved external
BLINKER : 1115 : .\OBJ\TN1.OBJ(TN1) : 'HPSTSIZE' : unresolved external
BLINKER : 1115 : .\OBJ\TN1.OBJ(TN1) : 'HP_LMISET' : unresolved external
BLINKER : 1115 : .\OBJ\TN1.OBJ(TN1) : 'HP_CENTER' : unresolved external
BLINKER : 1115 : .\OBJ\TN1.OBJ(TN1) : 'HP_RJUST' : unresolved external
BLINKER : 1115 : .\OBJ\TN1.OBJ(TN1) : 'HPREPLICAT' : unresolved external
BLINKER : 1115 : .\OBJ\TN1.OBJ(TN1) : 'HP_PITCH' : unresolved external
BLINKER : 1115 : .\OBJ\TN1.OBJ(TN1) : 'HPLCOUNT' : unresolved external
BLINKER : 1115 : .\OBJ\TN2.OBJ(TN2) : 'FT_LDAY' : unresolved external
BLINKER : 1115 : .\OBJ\TN2.OBJ(TN2) : 'FT_MADD' : unresolved external
BLINKER : 1115 : .\OBJ\RL.OBJ(RL) : 'OL_WINCBPA' : unresolved external
BLINKER : 1115 : .\OBJ\RL.OBJ(RL) : 'OL_WINCBCO' : unresolved external
BLINKER : 1115 : .\OBJ\PR.OBJ(PR) : 'LF_LIBVERS' : unresolved external
BLINKER : 1115 : .\OBJ\PR.OBJ(PR) : 'LL_LIBVERS' : unresolved external
BLINKER : 1115 : .\OBJ\PR.OBJ(PR) : 'LF_FRENAME' : unresolved external
BLINKER : 1115 : .\OBJ\PR.OBJ(PR) : 'LF_DIRECTO' : unresolved external
BLINKER : 1115 : .\OBJ\PR.OBJ(PR) : 'HP_ORIENT' : unresolved external
BLINKER : 1115 : .\OBJ\PR.OBJ(PR) : 'HP_ATSAY' : unresolved external
BLINKER : 1115 : .\OBJ\OR3.OBJ(OR3) : 'HP_BOX' : unresolved external
BLINKER : 1115 : .\OBJ\OR3.OBJ(OR3) : 'HP_VLINE' : unresolved external
BLINKER : 1115 : .\OBJ\OR3.OBJ(OR3) : 'HP_HLINE' : unresolved external
BLINKER : 1115 : .\OBJ\OR5.OBJ(OR5) : 'HPULSTR' : unresolved external
BLINKER : 1115 : .\OBJ\PRSPEC.OBJ(PRSPEC) : 'HP_RCPOS' : unresolved external
BLINKER : 1115 : .\OBJ\FAX.OBJ(FAX) : 'HP_LPI' : unresolved external
BLINKER : 1115 : .\OBJ\FAX.OBJ(FAX) : 'HP_SCALEF' : unresolved external
BLINKER : 1115 : .\OBJ\PRINT.OBJ(PRINT) : 'HP_INIT' : unresolved external
BLINKER : 1115 : .\OBJ\PRINT.OBJ(PRINT) : 'HP_SEND' : unresolved external
BLINKER : 1115 : .\OBJ\PRINT.OBJ(PRINT) : 'HP_COPIES' : unresolved external
BLINKER : 1115 : .\OBJ\PRINT.OBJ(PRINT) : 'HP_RESET' : unresolved external
BLINKER : 1115 : .\OBJ\PRINT.OBJ(PRINT) : '_HPGETLINE' : unresolved external
BLINKER : 1115 : .\OBJ\PRINT.OBJ(PRINT) : 'HPSIZES' : unresolved external
BLINKER : 1115 : .\OBJ\PRINT.OBJ(PRINT) : 'HPBOLD' : unresolved external
BLINKER : 1115 : .\OBJ\PRINT.OBJ(PRINT) : 'HP_SETRES' : unresolved external
BLINKER : 1115 : .\OBJ\PRINT.OBJ(PRINT) : 'HPDOWNLOAD' : unresolved external
BLINKER : 1115 : .\OBJ\PRINT.OBJ(PRINT) : 'HPTFMERROR' : unresolved external
BLINKER : 1115 : .\OBJ\PRINT.OBJ(PRINT) : 'HP_STMACRO' : unresolved external
BLINKER : 1115 : .\OBJ\PRINT.OBJ(PRINT) : 'HP_PRPCX' : unresolved external
BLINKER : 1115 : .\OBJ\PRINT.OBJ(PRINT) : 'HP_ENDMACR' : unresolved external
BLINKER : 1115 : .\OBJ\PRINT.OBJ(PRINT) : 'HP_CALLMAC' : unresolved external
BLINKER : 1115 : .\OBJ\PRINT.OBJ(PRINT) : 'PCXINFO' : unresolved external
BLINKER : 1115 : .\OBJ\PRINT.OBJ(PRINT) : 'HP_RASTDIR' : unresolved external
BLINKER : 1115 : .\OBJ\GETSYS.OBJ(GETSYS) : 'OL_YIELD' : unresolved external
BLINKER : 1115 : .\OBJ\MENUTO.OBJ(MENUTO) : 'FT_PUTKEY' : unresolved external
 
Libs blocked are:
  • #LIB prohp
    #LIB OSLib
    #LIB CPMI
    #LIB nanfor
    #LIB Ll
    #LIB Lfn

Re: Convert DOS application(s) to Harbour <== LIB compatibility

Posted: Thu Jul 28, 2016 3:40 pm
by Enrico Maria Giordano
LF_ISFILE try using FILE
'LF_FERASE try using FERASE
LF_FCREATE try using FCREATE
HP_SETPOS sorry I don't know the HP* functions
FT_LDAY
FT_MADD you can rewrite them using standard Clipper functions
OL_WINCBPA unknown
OL_WINCBCO unknown
LF_LIBVERS can't you remove it?
LL_LIBVERS can't you remove it?
LF_FRENAME try using FRENAME
LF_DIRECTO try using DIRECTORY
OL_YIELD not required
FT_PUTKEY try using KEYBOARD

EMG

Re: Convert DOS application(s) to Harbour <== LIB compatibility

Posted: Thu Jul 28, 2016 8:21 pm
by elrosa
LF_ is used in LIB Ll and LIB Lfn and is a good library for using long filenames when creating PDF or other files (csv for example). So not bounded to 8 characters when creating a file name.

Maarten

Re: Convert DOS application(s) to Harbour <== LIB compatibility

Posted: Fri Jul 29, 2016 12:23 pm
by elrosa
Oke, I am a newbee with Harbour... what to do if I am used to create Clipper app with rmake (*.rmk file) and blinker (*.lnk file) How to do it with Harbour?

Re: Convert DOS application(s) to Harbour <== LIB compatibility

Posted: Fri Jul 29, 2016 12:31 pm
by Enrico Maria Giordano
It depends on the C compiler you are using.

EMG

Re: Convert DOS application(s) to Harbour <== LIB compatibility

Posted: Fri Jul 29, 2016 12:59 pm
by elrosa
I downloaded harbour-3.0.0-win.exe, so that makes the MinGW compiler.

Re: Convert DOS application(s) to Harbour <== LIB compatibility

Posted: Fri Jul 29, 2016 1:06 pm
by Enrico Maria Giordano
So you have to look at the MinGW docs. I suggest to use a simple batch (COMPILE.BAT) that:

- set Harbour include directory
- compile any single PRG using HARBOUR.EXE
- compile any single C using MinGW
- link all the OBJs (or whatever extension for object files) using the linker of MinGW

EMG

Re: Convert DOS application(s) to Harbour <== LIB compatibility

Posted: Fri Jul 29, 2016 9:17 pm
by Antonio Linares
This is the buildg.bat that FWH provides:

Code: Select all

@ECHO OFF
CLS
ECHO ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
ECHO ³ FiveWin for Harbour 16.05 and GCC - May  2016   Harbour development power  ³Ü
ECHO ³ (c) FiveTech 1993-2016 for Microsoft Windows 9X/NT/200X/ME/XP/Vista/7/8/10 ³Û
ECHO ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ
ECHO ÿ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß

if A%1 == A GOTO :SINTAX
if NOT EXIST %1.prg GOTO :NOEXIST

ECHO Compiling...

if "%fwh%" == "" set fwh=.\..

set hdir=c:\harbour
set hdirc=%hdir%\bin\harbour.exe
set hlibs=%hdir%\lib\gcc
set mingw=c:\Qt\Tools\mingw491_32
set path=%mingw%\bin

%hdirc% %1 /n /i%fwh%\include;%hdir%\include /w /p %2 %3 > comp.log 2> warnings.log
IF ERRORLEVEL 1 GOTO COMPILEERROR
@type comp.log
@type warnings.log

%mingw%\bin\gcc -c %1.c -o%1.o -I%hdir%\include -I%mingw%\include -Wall
IF ERRORLEVEL 1 GOTO COMPILEERROR

if exist %1.rc %mingw%\bin\windres -D__FLAT__ -DDIALOG=DIALOGEX -i%1.rc -o_%1.o
IF ERRORLEVEL 1 GOTO RESOURCESERROR

if not exist %1.rc %mingw%\bin\gcc -o%1.exe %1.o -Wall -s -mwindows -L%mingw%\lib -L%hlibs% -L%fwh%\lib -Wl,--start-group -lfivehg -lfivehgc -lgtgui -luser32 -lwinspool -lkernel32 -lcomctl32 -lcomdlg32 -lgdi32 -lgdiplus -lole32 -loleaut32 -lpsapi -loledlg -lmfcuia32 -lmsimg32 -lwin32k -lstdc++ -lversion -luuid -lwinmm -lvfw32 -lwsock32 -lshell32 -lmpr -lhbcommon -lhbcpage -lhbcplr -lhbct -lhbdebug -lhbhsx -lhblang -lhbmacro -lhbmainstd -lhbmzip -lodbc32 -lhbpcre -lhbpp -lhbrdd -lhbrtl -lhbsix -lhbsqlit3 -lhbtip -lhbusrrdd -lhbvm -lhbwin -lhbzlib -lrddcdx -lrddfpt -lrddntx -lxhb -lhbziparc -lminizip -lhbmzip -lhbziparc -lpng -Wl,--end-group
if exist %1.rc %mingw%\bin\gcc -o%1.exe %1.o _%1.o -Wall -s -mwindows -L%mingw%\lib -L%hlibs% -L%fwh%\lib -Wl,--start-group -lfivehg -lfivehgc -lgtgui -luser32 -lwinspool -lkernel32 -lcomctl32 -lcomdlg32 -lgdi32 -lgdiplus -lole32 -loleaut32 -lpsapi -lmsimg32 -lwin32k -loledlg -lstdc++ -lmfcuia32 -lversion -luuid -lwinmm -lvfw32 -lwsock32 -lshell32 -lmpr -lhbcommon -lhbcpage -lhbcplr -lhbct -lhbdebug -lhbhsx -lhblang -lhbmacro -lhbmainstd -lhbmzip -lodbc32 -lhbpcre -lhbpp -lhbrdd -lhbrtl -lhbsix -lhbsqlit3 -lhbtip -lhbusrrdd -lhbvm -lhbwin -lhbzlib -lrddcdx -lrddfpt -lrddntx -lxhb -lhbziparc -lminizip -lhbmzip -lhbziparc -lpng -Wl,--end-group

IF ERRORLEVEL 1 GOTO LINKERROR
ECHO * Application successfully built
%1
rem delete temporary files
@del %1.c
@if exist %1.rc del _%1.o
GOTO EXIT
ECHO

:RESOURCESERROR
ECHO * Resources errors *
GOTO EXIT

:COMPILEERROR
@type comp.log
ECHO * Compile errors *
GOTO EXIT

:LINKERROR
ECHO * Link errors *
GOTO EXIT

:SINTAX
ECHO    SYNTAX: Buildg [Program]     {-- No especifiques la extensi¢n PRG
ECHO                                 {-- Don't specify .PRG extension
GOTO EXIT

:NOEXIST
ECHO The specified PRG %1 does not exist

:EXIT

Re: Convert DOS application(s) to Harbour <== LIB compatibility

Posted: Mon Aug 01, 2016 10:31 am
by elrosa
Hi,

I create a HBP file as followed:

Code: Select all

# ------------------------------------------------- --------------------------------
# Executable name
# ------------------------------------------------- --------------------------------
# -o output file name
-oems.exe

# ---------------------------------------------------------------------------------
# Libraries
# ---------------------------------------------------------------------------------
# l Policy to link with the library. must omit path, extension, and the prefix 'lib' (... unless part of the name of file).
-lhbgt
-lgtwvg
-lgtwvt
-lhbct
-lhbwin
-lhbnf
-lxhb
-lhbblink
-lprohp

# ---------------------------------------------------------------------------------
# Paths additional Includes
# ---------------------------------------------------------------------------------
# -i |-incpath=   Additional patches for research headers files
#-incpath=

# ---------------------------------------------------------------------------------
# Way of Lib PROC And HGAC 
# ---------------------------------------------------------------------------------
# -L-additional path to search for libraries
#-Li:
#-Ld:\users\hproc\lib;

# ---------------------------------------------------------------------------------
# other Parameters
# ---------------------------------------------------------------------------------
# .\OBJ\ Writes the .s and .o files in OBJ subfolder
# ---------------------------------------------------------------------------------
# -workdir=Working directory Policy to the build working directory.
#                     (default: .xbmc/play/comp in incremental mode, OS temp directory otherwise).
-workdir=.\OBJ
-gtgui

# ---------------------------------------------------------------------------------
# -[no]head[=]     Control source header parsing (in incremental build mode)
#                      can be: native (uses compiler to extract
#                     dependencies), full (default, uses simple text parser on
#                     the whole file), dep, off.
#-head=full

# ---------------------------------------------------------------------------------
# /n[]          No implicit starting procedure
#                     : 0=no implicit starting procedure
#                             1=no starting procedure at all
#                             2=add starting procedure if necessary
#-n

# ---------------------------------------------------------------------------------
# -compr=def         Metodo de Compressao UPX
#-compr=max

# ---------------------------------------------------------------------------------
# -pause         Performs a break in the case of compiler warning
#-pause

# ---------------------------------------------------------------------------------
# -[no]warn[=lev]     Sets the warning level (warning) C compiler
# Can be: max, yes, low, in, def (default: yes).
#-nowarn

# ---------------------------------------------------------------------------------
# -inc                Enables or incremental mode incremental.
#-inc

# ---------------------------------------------------------------------------------
# -[no]debug          Add / Delete debug information from the C compiler
#                     To compile with Harbour use the -b option as usual
#-b

# ---------------------------------------------------------------------------------
# -d        Policy to build ifdef
#-dHARBOUR

# ---------------------------------------------------------------------------------
# -icon=        Arrow icon for the application. must have a
# Format compatible with the target platform.
# Policy to inform the application icon.
#-icon=harb_win.ico

# ---------------------------------------------------------------------------------
# /u[]          Use set command (or no) Policy to load header file (.c) for all
# application.
#-u

#-w3 -es2
-gui

#-mt
# ---------------------------------------------------------------------------------
# Prg(s) and Rc(s) of the system
# ---------------------------------------------------------------------------------
overige.prg    
rk.prg
ag.prg
rd.prg
#hs.prg
conver.prg
fax.prg
print.prg
browse.prg
getsys.prg
errorsy.prg
rddsys.prg
oops.prg
tn.prg
tn1.prg
tn2.prg
pr.prg
pr2.prg
pr_toep.prg
toep_br.prg
callrap.prg
rl.prg
rl2.prg
rl3.prg
or0.prg
or1.prg
or2.prg
or3.prg
or4.prg
or5.prg
nc_ver.prg
nc_aan.prg
ems.prg
ems2.prg
prspec.prg
euro.prg
budget.prg
html.prg
#party.prg
menuto.prg
div1.prg
div2.prg
div3.prg
hmenu.prg
kostpr.prg
snelcalc.prg
prbudget.prg
brutow.prg
monsters.prg
alloc.prg
pr_overz.prg
pdf.prg
vis.prg
combi.prg
combi2.prg
log_dien.prg
dien_log.prg
levtar.prg
zeevrach.prg
st.prg
reach.prg
Run this script with:

Code: Select all

hbmk2 ems.bhp > comp.log 2> warnings.log
All libs are going well, except the prohp.lib. The message I am getting is:

Code: Select all

c:/hb30/lib/win/mingw/prohp.lib: file not recognized: file format not recognized.
Any idea?

Greetings,
Maarten

Re: Convert DOS application(s) to Harbour <== LIB compatibility

Posted: Mon Aug 01, 2016 11:24 am
by Antonio Linares
Maarten,

Where have you got prohp.lib from ?

Re: Convert DOS application(s) to Harbour <== LIB compatibility

Posted: Mon Aug 01, 2016 11:47 am
by elrosa
It is our ProHP-Laser printer library, which we bought for print capabilities with our HP printers... yeaaaaaars ago.