How to create Harbour library in Linux

261 views
Skip to first unread message

Alejandro Padrino

unread,
Feb 27, 2013, 7:47:22 AM2/27/13
to harbou...@googlegroups.com
Hello,

I'm trying to create a Harbour library with my own functions in Linux.  The command used is ...

hbmk2 -hblib -o mylib.lib mylib.prg

... but this command only creates the C source code without building "mylib.lib" Harbour library.  How I can create the library?


Thanks.   ;-)

elch

unread,
Feb 27, 2013, 9:31:13 AM2/27/13
to harbou...@googlegroups.com
Hi Alejandro,

i see there a wrong space/blank after the -o, and extension of the lib should be imho .a, not .lib
so:
hbmk2 -hblib -omylib.a mylib.prg

to save typing work in future start creating a mylib.hbp file, and call that instead with hbmk2.

Regards
Rolf

vszakats

unread,
Feb 27, 2013, 9:58:36 AM2/27/13
to harbou...@googlegroups.com
i see there a wrong space/blank after the -o, and extension of the lib should be imho .a, not .lib
so:
hbmk2 -hblib -omylib.a mylib.prg

There should be no lib extension:
   hbmk2 -hblib -omylib mylib.prg

It's enough to follow the new Examples sections 
in 'hbmk2 --longhelp' (formerly in README.txt).

-- Viktor

Alejandro Padrino

unread,
Feb 27, 2013, 10:37:45 AM2/27/13
to harbou...@googlegroups.com

Using "hbmk2 -hblib -omylib mylib.prg" I got same result:  C source code into mylib.c file.

elch

unread,
Feb 27, 2013, 5:31:44 PM2/27/13
to harbou...@googlegroups.com
VERY thanks, Viktor

for clarification to me - it is a great pity that every elch must be instructed again.
But i promise to multiply your advices. I sure hang a bit sticky in non portable settings, but i'm hungry to improve ...

To you, Alejandro: you know what a 'terminal' is ? - this is not this Alt-F2 in Unity mode of Kunterbuntu with no feedback, i mean something like this "cmd.exe" these windows users call.
In Linux it is called console, terminal or i.e. equal.
Start this, type your command and watch for feedback about what is happening.

This magic hbmk2 seem to do all for you, later just referencing to your lib as mylib ..

Regards
elch

vszakats

unread,
Feb 27, 2013, 7:22:53 PM2/27/13
to harbou...@googlegroups.com
On Wednesday, February 27, 2013 11:31:44 PM UTC+1, elch wrote:
VERY thanks, Viktor

for clarification to me - it is a great pity that every elch must be instructed again.
But i promise to multiply your advices. I sure hang a bit sticky in non portable settings, but i'm hungry to improve ...

Thank you, Elch.
 
To you, Alejandro: you know what a 'terminal' is ? - this is not this Alt-F2 in Unity mode of Kunterbuntu with no feedback, i mean something like this "cmd.exe" these windows users call.
In Linux it is called console, terminal or i.e. equal.
Start this, type your command and watch for feedback about what is happening.

This magic hbmk2 seem to do all for you, later just referencing to your lib as mylib .

And in case it doesn't do what it's expected to do, 
best is to follow README.txt / TROUBLESHOOTING 
and post a report with all required details.

-- Viktor

Alejandro Padrino

unread,
Feb 28, 2013, 6:36:28 AM2/28/13
to harbou...@googlegroups.com
Elch, I love Linux console.

elch

unread,
Feb 28, 2013, 1:20:19 PM2/28/13
to harbou...@googlegroups.com
Hi


Elch, I love Linux console.

not a must, but then we can go further.

If i overthink you message, that ONLY a mylib.c appears ...

This is the first step of Harbour, after the second step a mylib.o must appear, the compiled .c

This only can mean, you have an error in your .prg

Increase the level of compiler warnings with:

-W

and report us what you see - or even better: all fixed and what was wrong.


Regards

Rolf

Alejandro Padrino

unread,
Mar 3, 2013, 12:46:34 PM3/3/13
to harbou...@googlegroups.com
The problem is solved.  Error was in library name.  The library generated haves name as lib + mylibname.

Thanks.  ;-)

Reply all
Reply to author
Forward
Message has been deleted
0 new messages