Thread: 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 13:39:39
|
>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. I'll give that a shot. Thanks! > >When does the problem appear? at link time or at run time? >Are you using the RPM release? Does rigctl works for you? Run time. If it continues I'll post sessions. rigctl and testrig both work. I'm using testrig as the starting point for my application. When you compile testrig you use libtool and a really funking link-line so I'm trying to extract the code from that build process and simplify it. > >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 :) I might try and load the RPMs so I can easily link the library in. >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) ? No, I'm using testrig and it says something like "Feature not supported" BTW, here's what I'm up to: I have a "product" that collects and processes signals in the HF spectrum. In order to test my product I have an Icom 756Pro and some special modems that I use to transmit test signals into a dummy load to see if my product can detect them. Hamlib is saving me SOOO much time because with it I will be able to automate most of my testing. I can use hamlib to move the transmitter around the bands and see how my product performs. What I want to do next is write a GUI for hamlib. Has anyone done this already? I'm thinking that it's best to do it Java so I'm going to use JNI to call Hamlib and use RMI to allow the GUI to live in a web-browser on a remote machine. Should be pretty neat. Obviously all this code will be GPL under the same terms as Hamlib. Cool? Has anyone already done this? John _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp |
|
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
|
|
From: Stephane F. <f4...@fr...> - 2001-11-27 18:12:36
|
John Roberts wrote:
>
> 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
^^^^^^^^^^^^^^^^
If you're not using hamlib-devel RPM, then use "-L${HAMLIB}/.libs"
instead of -L${HAMLIB}/src. This is what libtool would do for rigctl.
Anyway, I strongly recommends using the hamlib-devel RPM in your case,
unless you want to help in bleeding edge Hamlib development. Nevertheless,
with the cvs version, it's still better to configure hamlib with
--prefix=/usr/local or whatever (and set -L/usr/local/lib accordingly)
and then "make install".
Let me know how it goes. If bands are still open, we can have a sked.
73, Stephane
|
|
From: John R. <js...@ho...> - 2001-11-27 20:39:43
|
Stephane,
Thanks! That worked.
I did a configure with --prefix as you suggested, then a make install.
I shouldn't have been trying to avoid doing that.
John
rm -f testrig testrig.o
export HAMLIB=/usr/local/hamlib/
export LD_LIBRARY_PATH=${HAMLIB}/lib:.
gcc -DHAVE_CONFIG_H -I${HAMLIB}/include -D_GNU_SOURCE -g -O2 -Wall -c
testrig.c
gcc -g -O2 -Wall -o testrig testrig.o -L${HAMLIB}/lib -lhamlib
./testrig
>From: Stephane Fillod <f4...@fr...>
>To: Ham...@li...
>Subject: Re: [Hamlib-developer] How to link in binary
>Date: Tue, 27 Nov 2001 19:12:27 +0100 (MET)
>
>John Roberts wrote:
> >
> > 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
> ^^^^^^^^^^^^^^^^
>If you're not using hamlib-devel RPM, then use "-L${HAMLIB}/.libs"
>instead of -L${HAMLIB}/src. This is what libtool would do for rigctl.
>
>Anyway, I strongly recommends using the hamlib-devel RPM in your case,
>unless you want to help in bleeding edge Hamlib development. Nevertheless,
>with the cvs version, it's still better to configure hamlib with
>--prefix=/usr/local or whatever (and set -L/usr/local/lib accordingly)
>and then "make install".
>
>Let me know how it goes. If bands are still open, we can have a sked.
>
>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
|
|
From: <rs...@su...> - 2001-11-27 13:58:29
|
Hi John, On Tue, 27 Nov 2001, John Roberts wrote: > What I want to do next is write a GUI for hamlib. Has anyone done this > already? I'm thinking that it's best to do it Java so I'm going to use JNI > to call Hamlib and use RMI to allow the GUI to live in a web-browser on a > remote machine. Should be pretty neat. Obviously all this code will be GPL > under the same terms as Hamlib. Cool? > > Has anyone already done this? I'm workung on a GUI written with Qt2/KDE2. But my internship here at SuSE is almost completed, so I will have to work on it during my spare time. Also, I don't have an FT-847 at home, and the IC-275/475 and FT990 aren't supported yet. But we'll manage that ;-) 73, Robert -- Robert Steinhaeusser, DL1NC / N9KBK rs...@su... http://1409.org ro...@st... |
|
From: Stephane F. <f4...@fr...> - 2001-11-28 22:09:13
|
On Tue, Nov 27, 2001, Robert Steinhäußer wrote: > Also, I don't have an FT-847 at home, and the IC-275/475 and FT990 aren't > supported yet. But we'll manage that ;-) Let's consider the IC-275/475 are now supported... well yet to be tested! Any taker for the FT990? 73 de Stephane |
|
From: <rs...@su...> - 2001-11-29 13:44:27
|
On Wed, 28 Nov 2001, Stephane Fillod wrote: > Let's consider the IC-275/475 are now supported... well yet to be tested! Whoa, that was fast. Now I have to find out what hardware I need for the interface. > Any taker for the FT990? After I've had a look why the FT847 get_* stuff doesn't work here, I might as well get into the rest ;-) But no promise yet. I'll have to check for the interface, too. 73, Robert -- Robert Steinhaeusser, DL1NC / N9KBK rs...@su... http://1409.org ro...@st... |