Recent

Author Topic: naturalstrcmp function  (Read 28962 times)

typo

  • Hero Member
  • *****
  • Posts: 3051
naturalstrcmp function
« on: May 05, 2015, 02:36:36 pm »
Where is it declared?

Thanks.

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: naturalstrcmp function
« Reply #1 on: May 08, 2015, 11:57:44 am »
I am declaring it as external, but what to put in LIBNAME?

Code: [Select]
function naturalstrcmp(s, t: PChar): Integer; external 'LIBNAME' name 'naturalstrcmp';

The package is in /usr/share/man/man3/naturalstrcmp.3.gz

Also, when I try to compile it, I get the message:
"Warning: link.res contains output sections, did you forget?"
« Last Edit: May 08, 2015, 12:03:32 pm by typo »

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7508
Re: naturalstrcmp function
« Reply #2 on: May 08, 2015, 12:15:58 pm »
The library should be mentioned in the manual page. I don't have it on my (freebsd) system.  Internet seems to say it is "mut" since it mentions the header "mut.h", but sometimes multiple headers resolve to one library.

The link.res message is only a warning. If it links it is probably in libc.
« Last Edit: May 08, 2015, 12:17:39 pm by marcov »


marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7508
Re: naturalstrcmp function
« Reply #4 on: May 08, 2015, 01:58:07 pm »
"mbk utility function" doesn't sound like a system function, more something of a package.

If I search for that, I encounter either the package "alliance" or open lisp.

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: naturalstrcmp function
« Reply #5 on: May 08, 2015, 02:18:18 pm »
Lazarus cannot find them on my Debian system.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7508
Re: naturalstrcmp function
« Reply #6 on: May 08, 2015, 02:24:12 pm »
Lazarus cannot find them on my Debian system.

I just tested, and my debian 7.8 doesn't have a manual page for naturalstrcmp, nor a mut.h header in /usr/include (and deeper)

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: naturalstrcmp function
« Reply #7 on: May 09, 2015, 01:28:53 pm »
I have found this page:

http://manned.org/naturalstrcmp/e011433d

It points to another package name:

man1/alc_origin.1

My error message on Debian says:

/usr/bin/ld: cannot find -lalliance
« Last Edit: May 09, 2015, 01:37:22 pm by typo »

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: naturalstrcmp function
« Reply #8 on: May 10, 2015, 11:11:23 am »
What is the libname I should put in my external declaration? On my Debian 7.7 it is on /usr/share/man/man3/naturalstrcmp.3.gz from Alliance package.

I tried :

Code: [Select]
function naturalstrcmp(s, t: PChar): Integer; external 'alliance' name 'naturalstrcmp';

without success. The error message says that "cannot find -lalliance".

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: naturalstrcmp function
« Reply #9 on: May 11, 2015, 01:06:19 pm »
I tried:

Code: [Select]
function naturalstrcmp(s, t: PChar): Integer; external 'libMut.so' name 'naturalstrcmp';

but when I declare this function, the debugger returns an error condition.

rvk

  • Hero Member
  • *****
  • Posts: 3842
Re: naturalstrcmp function
« Reply #10 on: May 11, 2015, 02:07:12 pm »
Ok, I got that working (on Ubuntu and my zero knowledge of Linux-desktops :)).

First you need the Alliance package.
When you installed it you need to create a link from /usr/lib/alliance/libMut.so to /usr/lib/libMut.so
Code: [Select]
cd /usr/lib
ln -s ./alliance/libMut.so libMut.so

Now you have a valid libMut.so

Now define this:
Code: [Select]
function naturalstrcmp(s, t: PChar): Integer; external 'Mut.so' name 'naturalstrcmp';

It should compile.

Or are you having trouble running it?

(Aaah, I see the debugger problem)
« Last Edit: May 11, 2015, 02:12:06 pm by rvk »

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: naturalstrcmp function
« Reply #11 on: May 11, 2015, 02:21:03 pm »
Done, but it persists.

rvk

  • Hero Member
  • *****
  • Posts: 3842
Re: naturalstrcmp function
« Reply #12 on: May 11, 2015, 02:24:02 pm »
Is the Alliance package 64 bit or 32 bit? (i386 or x86_64) and does it match your Lazarus installation?

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: naturalstrcmp function
« Reply #13 on: May 11, 2015, 02:39:47 pm »
32 bit, i386. It matches Lazarus installation.
« Last Edit: May 11, 2015, 03:54:25 pm by typo »

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: naturalstrcmp function
« Reply #14 on: May 11, 2015, 05:49:53 pm »
http://postimg.org/image/ty2kn3yvp/

What circunstances could cause this?
« Last Edit: May 11, 2015, 06:08:55 pm by typo »