Problems with .lib

142 views
Skip to first unread message

Quique

unread,
Jul 13, 2021, 6:47:39 PM7/13/21
to Harbour Users

English/spanish

I have a library of which I do not have the sources. It works perfectly, but there is a class that for a special program I want to create my own class. The problem is that when I want to use the library for the program I have it calls the class from the library instead of calling the class from my program. If I remove the library I have no problems. 

How can I force the program to use my class? 

I compile with hbmk2 and I already tried putting -lxxx.lib before and after the sources.

//--------------------------------------------

Tengo una librería de la cual no tengo los fuentes. Funciona perfectamente, pero hay una clase que para un programa en especial quiero crear mi propia clase. El problema es que cuando quiero usar la  librería  para el programa que tengo llama la clase de la  librería  en lugar de llamar la clase de mi programa. Si quito la  librería  no tego problemas.

¿Como puedo obligar al programa a utilizar la clase mía?

Compilo con hbmk2 y ya traté poniendo -lxxx.lib antes y despues de los fuentes.


hmpaquito

unread,
Jul 14, 2021, 6:19:36 AM7/14/21
to Harbour Users
EXTERNAL TYourClass

Quique

unread,
Jul 14, 2021, 11:54:29 AM7/14/21
to Harbour Users
English/ spanish

It does not work. I tried putting the EXTERN (also tried REQUEST) in the main program, and also put an unused function, just "function miFunction (); return nil" in the same prg, and put "EXTERN miFunction" below the other and keep calling the class from the library. What I did but I do not consider it a solution because the ideal would be to continue using the same original library was to copy the library to the project directory and remove the obj from the class in conflict, but I would like, if someone knows how, to solve the problem without having than modify the lib.

//--------------------------------------------

No funciona.

Lo intenté poniendo el EXTERN (también intenté con REQUEST) en el programa principal, y también metí una función que no se usa, simplemente "function miFuncion();return nil" en el mismo prg, y puse "EXTERN miFuncion" debajo del otro y sigue llamando la clase de la librería.

Lo que hice pero no lo considero solución porque lo ideal sería seguir utilizando la misma librería origina fue copiar la librería al directorio del proyecto y quitar el obj de la clase en conflicto, pero me gustaría, si alguien sabe como, solucionar el problema sin tener que modificar la lib.

Quique

unread,
Jul 16, 2021, 3:05:39 AM7/16/21
to harbou...@googlegroups.com
English/ spanish

It does not work. I tried putting the EXTERN (also tried REQUEST) in the main program, and also put an unused function, just "function miFunction (); return nil" in the same prg, and put "EXTERN miFunction" below the other and keep calling the class from the library. What I did but I do not consider it a solution because the ideal would be to continue using the same original library was to copy the library to the project directory and remove the obj from the class in conflict, but I would like, if someone knows how, to solve the problem without having than modify the lib.

//--------------------------------------------

No funciona.

Lo intenté poniendo el EXTERN (también intenté con REQUEST) en el programa principal, y también metí una función que no se usa, simplemente "function miFuncion();return nil" en el mismo prg, y puse "EXTERN miFuncion" debajo del otro y sigue llamando la clase de la librería.

Lo que hice pero no lo considero solución porque lo ideal sería seguir utilizando la misma librería origina fue copiar la librería al directorio del proyecto y quitar el obj de la clase en conflicto, pero me gustaría, si alguien sabe como, solucionar el problema sin tener que modificar la lib.


--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users

---
You received this message because you are subscribed to a topic in the Google Groups "Harbour Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/harbour-users/w8pVNtqagAg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/harbour-users/87b8957a-abb0-4a6f-b3d4-5d30815cc425n%40googlegroups.com
.

Quique

unread,
Jul 20, 2021, 1:47:05 PM7/20/21
to Harbour Users

Solución:

Creé una nueva librería con el prg que me está dando problemas (entre otros), y la enlazo antes de la otra librería, de esa manera funciona correctamente, aunque para mi punto de vista, este debe ser un error del compilador de harbour,  porque yo creo que no debería ser necesario crear una nueva librería, simplemente al momento de incluir el prg en la lista de fuentes, éste debería tener prioridad sobre el de cualquier librería.
Reply all
Reply to author
Forward
0 new messages