Re: [Hamlib-developer] How to link in binary
Library to control radio transceivers and receivers
Brought to you by:
n0nb
|
From: John R. <js...@ho...> - 2001-11-27 15:37:35
|
Here is the script I'm using to compile:
rm -f testrig testrig.o
export HAMLIB=../hamlib-1.1.2/
export LD_LIBRARY_PATH=${HAMLIB}/.libs/:${HAMLIB}/icom/.libs:.
gcc -DHAVE_CONFIG_H -I${HAMLIB}/tests -I${HAMLIB}/include -I${HAMLIB}/src
-D_GNU_SOURCE -g -O2 -Wall -c testrig.c
gcc -g -O2 -Wall -o testrig testrig.o -L${HAMLIB}/src -lhamlib
When I run this script I get a .o file, but I can't produce a binary:
jroberts@geiswd44ab(~/src/setfreq) 1029$ ./m2
../hamlib-1.1.2//src/libhamlib.a(register.o): In function
`rig_load_backend':
/home/jroberts/src/hamlib-1.1.2/src/register.c:288: undefined reference to
`lt_dlinit'
/home/jroberts/src/hamlib-1.1.2/src/register.c:302: undefined reference to
`lt_dlopen'
/home/jroberts/src/hamlib-1.1.2/src/register.c:305: undefined reference to
`lt_dlerror'
/home/jroberts/src/hamlib-1.1.2/src/register.c:312: undefined reference to
`lt_dlsym'
/home/jroberts/src/hamlib-1.1.2/src/register.c:314: undefined reference to
`lt_dlerror'
/home/jroberts/src/hamlib-1.1.2/src/register.c:316: undefined reference to
`lt_dlclose'
/home/jroberts/src/hamlib-1.1.2/src/register.c:329: undefined reference to
`lt_dlsym'
collect2: ld returned 1 exit status
./m2: ./testrig: No such file or directory
jroberts@geiswd44ab(~/src/setfreq) 1030$
What am I doing wrong?
John
>From: Stephane Fillod <f4...@fr...>
>To: Ham...@li...
>Subject: Re: [Hamlib-developer] How to link in binary
>Date: Mon, 26 Nov 2001 18:39:02 +0100 (MET)
>
>
>En réponse à John Roberts <js...@ho...>:
> > How do I link my binary with hamlib? Do I have to use libtool and do all
>the
> > DLL stuff? Or can I just link the .a for my radio into the binary? [I
>can't
> > get the latter to work -- it complains about calls to dl_open...]
>
>hmm, some output traces would help in that case. I'm suspecting Hamlib
>is unable to load the backend (i.e. the .so or .la module).
>Linking against Hamlib is be pretty straight forward. No need to worry
>about libtool, it is there to be transparent.
>
> gcc myapp.o -lhamlib -o myapp
>
>Add -L/usr/local/lib if needed. Statically linking with .a if okay too.
>If linking is fine, "ldd myapp" should report no unmet dependencies.
>
>When does the problem appear? at link time or at run time?
>Are you using the RPM release? Does rigctl works for you?
>
>My guess is your application is not able to find the backend module.
>This should not happen with the RPMs (unless there's a bug waiting for a
>fix :)
>In the other cases, you may have to play with LD_LIBRARY_PATH.
>
> > BTW, I still can't read sig strength or freq from my Icom 756Pro. Is
>that
> > right? I'm using 1.1.2.
>
>Same question, are you using rigctl to query freq and sig strength?
>What are the error message (add -vvvv for verbose mode) ?
>
>
>73, Stephane
>
>_______________________________________________
>Hamlib-developer mailing list
>Ham...@li...
>https://lists.sourceforge.net/lists/listinfo/hamlib-developer
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
|