[zeromq-dev] [PATCH] fix build of zguide C examples on LInux
Stephen Hemminger
shemminger at vyatta.com
Wed Feb 29 01:18:33 CET 2012
On Linux libuuid is a separate library.
Examples won't build unless -luuid is added.
You made to go for full fledged autoconf madness, because they break
on other platforms (Windows).
$ ./build all
...
clonecli5.c
/usr/bin/ld.bfd.real: clonecli5.o: undefined reference to symbol 'uuid_generate@@UUID_1.0'
/usr/bin/ld.bfd.real: note: 'uuid_generate@@UUID_1.0' is defined in DSO /lib/libuuid.so.1 so try adding it to the linker command line
/lib/libuuid.so.1: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
---
examples/C/build | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/examples/C/build b/examples/C/build
index a326d62..f499005 100755
--- a/examples/C/build
+++ b/examples/C/build
@@ -10,7 +10,7 @@ if [ /$1/ = /all/ ]; then
echo "Building C examples..."
for MAIN in `egrep -l "main \(" *.c`; do
echo "$MAIN"
- ./c -l -lzmq -lczmq -q $MAIN
+ ./c -l -lzmq -lczmq -luuid -q $MAIN
done
elif [ /$1/ = /clean/ ]; then
echo "Cleaning C examples directory..."
@@ -20,7 +20,7 @@ elif [ /$1/ = /clean/ ]; then
done
elif [ -f $1.c ]; then
echo "$1"
- ./c -l -lzmq -lczmq -q $1
+ ./c -l -lzmq -lczmq -luuid -q $1
else
echo "syntax: build all | clean"
fi
--
1.7.9
More information about the zeromq-dev
mailing list