Click here to Skip to main content
15,881,173 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have found naturalstrcmp function in Linux and I think it is what I need. Any example of how to use it in Ubuntu, Debian and FreeBSD?

http://www.unix.com/man-page/debian/3/NATURALSTRCMP/[^]

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 :

function naturalstrcmp(s, t: PChar): Integer; external 'alliance' name 'naturalstrcmp';

without success. The error message says that "cannot find -lalliance".
Posted
Updated 10-May-15 20:34pm
v2

1 solution

The error message is telling you that the alliance library (alliance.a or alliance.so) cannot be found in the library search path. Check where you have installed it and make sure you provide the path to the linker.
 
Share this answer
 
Comments
Member 11275534 11-May-15 4:21am    
The problem is that I don't know which is the library name, I know only the package name, Alliance.
Richard MacCutchan 11-May-15 4:27am    
Please read my answer again, the library name is alliance as shown in the error message. I would suggest a closer reading of the Alliance package documentation.
Member 11275534 11-May-15 6:30am    
Well, now I know that they are on /usr/lib/alliance/, but don't know the name of the lib. All files are named as libAbc.so.
Richard MacCutchan 11-May-15 6:38am    
All files with the .so extension are library files. You need to check the documentation to see which one you need for the function you want to use.
Member 11275534 11-May-15 10:40am    
I am guessing that it is on libMut.so because example page cites Mut.h. So I tried:

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

but Lazarus debugger returns an error condition when running.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900