[Stk] Demo Linking Error

Tristan Matthews le.businessman at gmail.com
Fri Jan 25 07:36:46 PST 2013


Hi Matthew,

2013/1/25 Matthew Kettlewell <matt at kettlewell.net>

> Hello -
>
> I'm trying to compile / link STK for the first time on a Fedora LXDE 17
> machine.  There is an RPM of it, so I'm using that for now, but would like
> to be able to compile new versions, debug options etc as well.
>
> It appears that pthread isn't being linked into the demo projects, but I'm
> not a configure guru to figure out where it needs to be checked/added...
>
> In fact, it appears that pthread isn't even being checked for when I run
> ./configure (no arguments )
>
>
I can confirm this bug on Fedora 17. The problem as you mention, is that
configure is not checking for/adding pthread to the LIBS variable. This
used to be fine, since pthread is already required by other libraries used
by Stk. However, it's now required to explicitly link against it. i I've
attached a patch to configure.ac. You'll have to regenerate configure with
autoreconf for it to work:

patch -input=configure.patch
./configure
make
cd projects/demo
make libdemo

Good luck!

Best,
Tristan

And here's the result of the link error  that I'm seeing.
>
> cd projects/demo && make libdemo
> make[1]: Entering directory
> `/home/matt/Downloads/STK-4.4.4/stk-4.4.4/projects/demo'
> g++  -O3 -Wall -I../../include -I../../include/../src/include
> -DHAVE_GETTIMEOFDAY -D__LINUX_ALSA__ -D__LITTLE_ENDIAN__
> -DRAWWAVE_PATH=\"../../rawwaves/\" -o demo utilities.cpp demo.cpp
> -L../../src -lstk -lasound -lm
> /usr/bin/ld: ../../src/libstk.a(RtAudio.o): undefined reference to symbol
> 'pthread_create@@GLIBC_2.1'
> /usr/bin/ld: note: 'pthread_create@@GLIBC_2.1' is defined in DSO
> /lib/libpthread.so.0 so try adding it to the linker command line
> /lib/libpthread.so.0: could not read symbols: Invalid operation
> collect2: error: ld returned 1 exit status
> make[1]: *** [libdemo] Error 1
> make[1]: Leaving directory
> `/home/matt/Downloads/STK-4.4.4/stk-4.4.4/projects/demo'
> make: *** [all] Error 2
>
>
> Any thoughts / help are welcome.
>
> Thanks
>
> Matt
>
>
> _______________________________________________
> Stk mailing list
> Stk at ccrma.stanford.edu
> http://ccrma-mail.stanford.edu/mailman/listinfo/stk
>
>


-- 
Tristan Matthews
web: http://tristanswork.blogspot.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ccrma-mail.stanford.edu/pipermail/stk/attachments/20130125/56acab61/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: configure.patch
Type: application/octet-stream
Size: 384 bytes
Desc: not available
Url : http://ccrma-mail.stanford.edu/pipermail/stk/attachments/20130125/56acab61/attachment.obj 


More information about the Stk mailing list