Funciones propias en una lib (Solucionado)

User avatar
Compuin
Posts: 1252
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada
Has thanked: 7 times
Been thanked: 3 times

Funciones propias en una lib (Solucionado)

Post by Compuin »

Saludos

Tengo varios PRG que puse en un archivo .lib. Ahora me gustaria saber en que lugar el .mak debo colocarlo para que se genere el executable

Mi lib se llama mylib.lib

Hice esto pero no esta funcionando

BCDIR=c:\bcc7
HBDIR=c:\harbour
FWDIR=c:\fwh

.path.obj = .\obj
.path.prg = .\prg
.path.ch = $(FWDIR)\include;$(HBDIR)\include
.path.c = .\
.path.rc = .\

PRG = \
.\prg01.prg \
.\prg02.prg \
.\prg03.prg \
.\prg04.prg

OBJ=$(PRG:.prg=.obj)
OBJS=$(OBJ:.\=.\obj\)

PROJECT : myapp.exe

myapp.exe : $(OBJS)
echo off
echo $(BCDIR)\lib\c0w32.obj + > b32.bc
echo $(OBJS), + >> b32.bc
echo myapp.exe, + >> b32.bc
echo myapp.map, + >> b32.bc
echo $(FWDIR)\lib\FiveH.lib $(FWDIR)\lib\FiveHC.lib $(FWDIR)\lib\mylib.lib + >> b32.bc
echo $(HBDIR)\lib\hbrtl.lib + >> b32.bc
echo $(HBDIR)\lib\hbvm.lib + >> b32.bc
echo $(HBDIR)\lib\gtgui.lib + >> b32.bc
echo $(HBDIR)\lib\hblang.lib + >> b32.bc
echo $(HBDIR)\lib\hbmacro.lib + >> b32.bc
echo $(HBDIR)\lib\hbrdd.lib + >> b32.bc
echo $(HBDIR)\lib\rddntx.lib + >> b32.bc
echo $(HBDIR)\lib\rddcdx.lib + >> b32.bc
echo $(HBDIR)\lib\rddfpt.lib + >> b32.bc
echo $(HBDIR)\lib\hbsix.lib + >> b32.bc
echo $(HBDIR)\lib\hbdebug.lib + >> b32.bc
echo $(HBDIR)\lib\hbcommon.lib + >> b32.bc
echo $(HBDIR)\lib\hbpp.lib + >> b32.bc
echo $(HBDIR)\lib\hbwin.lib + >> b32.bc
echo $(HBDIR)\lib\hbcpage.lib + >> b32.bc
echo $(HBDIR)\lib\hbct.lib + >> b32.bc
echo $(HBDIR)\lib\hbcplr.lib + >> b32.bc
echo $(HBDIR)\lib\xhb.lib + >> b32.bc
echo $(HBDIR)\lib\png.lib + >> b32.bc
echo $(HBDIR)\lib\hbzlib.lib + >> b32.bc
echo $(HBDIR)\lib\hbziparc.lib + >> b32.bc
echo $(HBDIR)\lib\hbmzip.lib + >> b32.bc
echo $(HBDIR)\lib\minizip.lib + >> b32.bc
echo $(HBDIR)\lib\hbpcre.lib + >> b32.bc

echo $(BCDIR)\lib\cw32.lib + >> b32.bc
echo $(BCDIR)\lib\import32.lib + >> b32.bc
echo $(BCDIR)\lib\psdk\odbc32.lib + >> b32.bc
echo $(BCDIR)\lib\psdk\nddeapi.lib + >> b32.bc
echo $(BCDIR)\lib\psdk\iphlpapi.lib + >> b32.bc
echo $(BCDIR)\lib\psdk\msimg32.lib + >> b32.bc
echo $(BCDIR)\lib\psdk\shell32.lib + >> b32.bc
echo $(BCDIR)\lib\psdk\gdiplus.lib + >> b32.bc
echo $(BCDIR)\lib\psdk\rasapi32.lib, >> b32.bc

$(BCDIR)\bin\ilink32 -Gn -aa -Tpe -s @b32.bc
del b32.bc

.prg.obj:
$(HBDIR)\bin\harbour $< /N /W /Oobj\ /I$(FWDIR)\include;$(HBDIR)\include >> comp.log
$(BCDIR)\bin\bcc32 -c -tWM -I$(HBDIR)\include -oobj\$& obj\$&.c

.c.obj:
echo -c -tWM -D__HARBOUR__ -DHB_API_MACROS > tmp
echo -I$(HBDIR)\include;$(FWDIR)\include >> tmp
$(BCDIR)\bin\bcc32 -oobj\$& @tmp $&.c
del tmp

Turbo Incremental Link 6.70 Copyright (c) 1997-2014 Embarcadero Technologies, Inc.
Error: Unresolved external '_HB_FUN_ABREODBC' referenced from C:\SGE\OBJ\PRG01.OBJ


Gracias de antemano
Last edited by Compuin on Thu Jan 19, 2017 5:28 pm, edited 1 time in total.
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
User avatar
Antonio Linares
Site Admin
Posts: 42521
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 75 times
Contact:

Re: Funciones propias en una lib

Post by Antonio Linares »

El enlazador te indica que no encuentra el código de la función ABREODBC()
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Compuin
Posts: 1252
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada
Has thanked: 7 times
Been thanked: 3 times

Re: Funciones propias en una lib

Post by Compuin »

Ok pero el codigo existe dentro de una funcion en mylib.lib...por que no lo reconoce?
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
User avatar
Antonio Linares
Site Admin
Posts: 42521
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 75 times
Contact:

Re: Funciones propias en una lib

Post by Antonio Linares »

Busca dentro de mylib.lib por _HB_FUN_ABREODBC

Puedes usar Total Commander para hacer esta búsqueda

ó este inspector de librerias de Andrés Reyes:
https://bitbucket.org/fivetech/fivewin-contributions/downloads/Explorer%20Lib-2.0-win32.exe
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Compuin
Posts: 1252
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada
Has thanked: 7 times
Been thanked: 3 times

Re: Funciones propias en una lib

Post by Compuin »

No me he sabido explicar, me disculpo por ello

Lo que quiero es colocar varios .prg en una sola .lib y luego incluir esa .lib en el .mak asi evito varos .prg


Alguna idea?
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
User avatar
Antonio Linares
Site Admin
Posts: 42521
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 75 times
Contact:

Re: Funciones propias en una lib

Post by Antonio Linares »

Entonces lo que necesitas es un make para construir tu librería:

mylib.mak

Code: Select all | Expand

BCDIR=c:\bcc7
HBDIR=c:\harbour
FWDIR=c:\fwh

.path.obj = .\obj
.path.prg = .\prg
.path.ch = $(FWDIR)\include;$(HBDIR)\include
.path.c = .\

PRG = \
.\prg01.prg \
.\prg02.prg \
.\prg03.prg \
.\prg04.prg

PROJECT    : mylib.lib

mylib.lib  : $(PRG:.PRG=.OBJ)

.PRG.OBJ:
   $(HDIR)\bin\harbour $< /N /W /es2 /Oobjh\ /I.\include;$(HDIR)\include > comp.log
   $(BCCDIR)\bin\bcc32 -c -tWM -w-pia -I$(HDIR)\include -Iinclude -oobj\$& obj\$&.c
   $(BCCDIR)\bin\TLib mylib.lib -+$@ /0 /P64,,

.C.OBJ:
   echo -c -tWM -D__HARBOUR__ $(LEGACY) -w-pia > tmp
   echo -I$(HDIR)\include;.\include; >> tmp
   $(BCCDIR)\bin\bcc32 -oobj\$& @tmp $<
   $(BCCDIR)\bin\TLib mylib.lib -+obj\$&.obj /0 /P64,,
 
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Compuin
Posts: 1252
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada
Has thanked: 7 times
Been thanked: 3 times

Re: Funciones propias en una lib

Post by Compuin »

Gracias

Y una vez que la construya como la incluyo al .exe final?
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
User avatar
Antonio Linares
Site Admin
Posts: 42521
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 75 times
Contact:

Re: Funciones propias en una lib

Post by Antonio Linares »

Como lo estas haciendo en tu primer mensaje de esta conversación
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Compuin
Posts: 1252
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada
Has thanked: 7 times
Been thanked: 3 times

Re: Funciones propias en una lib

Post by Compuin »

Ok

Volvere a probar

Gracias
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
User avatar
Compuin
Posts: 1252
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada
Has thanked: 7 times
Been thanked: 3 times

Re: Funciones propias en una lib

Post by Compuin »

El go.bat para ejecutar la creacion de una lib como queda?
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
User avatar
Compuin
Posts: 1252
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada
Has thanked: 7 times
Been thanked: 3 times

Re: Funciones propias en una lib

Post by Compuin »

C:\SGE>mylib

C:\SGE>set path=C:\bcc7\bin

C:\SGEDP>make -mylib.mak
MAKE Version 5.41 Copyright (c) 1987, 2014 Embarcadero Technologies, Inc.
Fatal: Unable to open makefile
C:\SGE>


go.bat

set path=C:\bcc7\bin
make -mylib.mak
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
User avatar
Antonio Linares
Site Admin
Posts: 42521
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 75 times
Contact:

Re: Funciones propias en una lib

Post by Antonio Linares »

Te falta una "f"

make -fmylib.mak
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Compuin
Posts: 1252
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada
Has thanked: 7 times
Been thanked: 3 times

Re: Funciones propias en una lib

Post by Compuin »

El archivo mainwin.prg existe pero aun me da este error

C:\SGE>mylib

C:\SGE>set path=C:\bcc7\bin

C:\SGE>make -fmylib.mak
MAKE Version 5.41 Copyright (c) 1987, 2014 Embarcadero Technologies, Inc.
Fatal: '.\mainwin.prg' does not exist - don't know how to make it
C:\SGEDP>mylib
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
User avatar
Antonio Linares
Site Admin
Posts: 42521
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 75 times
Contact:

Re: Funciones propias en una lib

Post by Antonio Linares »

copia aqui el fichero make
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Compuin
Posts: 1252
Joined: Tue Dec 28, 2010 1:29 pm
Location: Quebec, Canada
Has thanked: 7 times
Been thanked: 3 times

Re: Funciones propias en una lib

Post by Compuin »

BCDIR=c:\bcc7
HBDIR=c:\harbour
FWDIR=c:\fwh

.path.obj = .\obj
.path.prg = .\prg
.path.ch = $(FWDIR)\include;$(HBDIR)\include
.path.c = .\

PRG = \
.\mainwin.prg \
.\progra01.prg \
.\progra02.prg

PROJECT : mylib.lib

mylib.lib : $(PRG:.PRG=.OBJ)

.PRG.OBJ:
$(HDIR)\bin\harbour $< /N /W /es2 /Oobjh\ /I.\include;$(HDIR)\include > comp.log
$(BCCDIR)\bin\bcc32 -c -tWM -w-pia -I$(HDIR)\include -Iinclude -oobj\$& obj\$&.c
$(BCCDIR)\bin\TLib mylib.lib -+$@ /0 /P64,,

.C.OBJ:
echo -c -tWM -D__HARBOUR__ $(LEGACY) -w-pia > tmp
echo -I$(HDIR)\include;.\include; >> tmp
$(BCCDIR)\bin\bcc32 -oobj\$& @tmp $<
$(BCCDIR)\bin\TLib mylib.lib -+obj\$&.obj /0 /P64,,
FWH 20.12
Hbmk2 32/64 Bits (Build 19.29.30133)
Microsoft Visual C 32 Bits
MySql 8.0.24 32/64 Bits
VS Code
Post Reply