newbie: plugin loaded?
Brad Fuller
brad at sonaural.com
Sun Nov 13 00:15:10 UTC 2005
Bert Freudenberg wrote:
>
> Am 12.11.2005 um 01:12 schrieb Brad Fuller:
>
>> Bert Freudenberg wrote:
>>
>>>
>>> Am 11.11.2005 um 22:46 schrieb Brad Fuller:
>>>
>>>>
>>>> $ ioLoadModule(/usr/local/lib/squeak/3.7-7/SoundPAPlugin):
>>>> /usr/local/lib/squeak/3.7-7/SoundPAPlugin: undefined symbol:
>>>> Pa_GetDeviceInfo
>>>>
>>>> Pa_GetDeviceInfo is in a library accessible to all (usr/local/
>>>> lib/ libportaudio.so).
>>>
>>>
>>>
>>> You need to link libportaudio.so into SoundPAPlugin.
>>
>>
>> doh! I was wrong.
>> And, I can't figure out how slip in a library link so that I don't
>> have to create a custom makefile.
>> I see from the documentation that you can use m4 macros or a
>> makefile.inc file. But, I can't figure out how to do it.
>> Any pointers to docs would be much appreciated. Do you have any
>> examples?
>
>
> Sure:
>
> platforms/unix/plugins % grep PLIBS */Makefile.inc
> ObjectiveCPlugin/Makefile.inc:PLIBS= -Wl,-framework -Wl,Foundation
>
> ... which is used in:
>
> platforms/unix/plugins % egrep -v '^(#|$)' ../config/Makefile.plg.in
> [make_cfg]
> [make_plg]
> XINCLUDES = [includes]
> OBJS = [targets]
> TARGET = [target]
> PLIBS = [plibs]
> [make_inc]
> $(TARGET) : $(OBJS) Makefile
> $(LINK) $(TARGET) $(OBJS) $(PLIBS)
> $(RANLIB) $(TARGET)
> [make_targets]
> .force :
Thanks Bert, that's what I tried, but I forget to use "Wl". So, I tried
that but I still can't get the macros to work.
I really have two problems that maybe you've seen.
** Problem 1:
I've placed:
PLIBS=Wl,-L/usr/local/lib/ Wl,-llibportaudio.so
in Makefile.inc
deleted Makefile, run config/configure (to create the Makefile)
And the PLIBS = line is still empty.
Don't know what to do about that.
====
My second, more important problem, is I still get the runtime error when
manually editing the Makefile by placing:
PLIBS = Wl,-L/usr/local/lib/ Wl,-llibportaudio.so
(I assume I need to pass the location with -L and the file with -l)
During the link phase of the make, it seems to link ok, with no errors.
And after "make install" I try the plugin in Squeak and I still receive
the error:
ioLoadModule(/usr/local/lib/squeak/3.7-7/SoundPAPlugin):
/usr/local/lib/squeak/3.7-7/SoundPAPlugin: undefined symbol:
Pa_GetDeviceInfo
I'm not familiar with what format the switches should be in to be passed
from libtool to ld. So, I tried just:
PLIBS = -Wl,/usr/local/lib/libportaudio.so
(without the '-l') and that made a bit of progress. I didn't get the
"undefined symbol at runtime.
However, I got a segmentation fault immediately. :-(
It know my external file in the Cross directory was called because I
have a printf in the file that did print to the console and it printed.
After the segfault, was a log that didn't make much sense. Here's the top:
==
PortAudio Test: output sine wave. SR = 44100, BufSize = 64
Segmentation fault
2036700292 UndefinedObject>DoIt
2036668572 Compiler>evaluate:in:to:notifying:ifFail:logged:
2036669032 [] in ParagraphEditor>evaluateSelection
2036668388 BlockContext>on:do:
2036668296 ParagraphEditor>evaluateSelection
2036641436 [] in PluggableTextMorph>doIt
2036656868 [] in PluggableTextMorph>handleEdit:
2036656368 TextMorph>handleEdit:
2036640792 PluggableTextMorph>handleEdit:
2036640516 PluggableTextMorph>doIt
2036640424 StringHolder>perform:orSendTo:
==
So maybe
* the library is made wrong? It's a shared library.
* Maybe I didn't set up the plugin (or primitive) correctly?
* Maybe Squeak can't wait for a bit to play a sine wave. I didn't set up
any buffers in Squeak so I can't see how any garbage collection would be
a problem.
This is a big problem, so I probably did something obviously wrong.
Any ideas or pointers where to look is much appreciated.
Thanks for your help!
brad
More information about the Vm-dev
mailing list