Hi,
I'm a beginner in zeromq. i want to integrate zeromq with json rpc on beagleboard. for that first of all installed the zeromq library into my PC by issuing the following commands

git clone git://github.com/jedisct1/libsodium.git
cd libsodium
./autogen.sh
./configure && make check
sudo make install
sudo ldconfig
cd ..

git clone git://github.com/zeromq/libzmq.git
cd libzmq
./autogen.sh
./configure && make check
sudo make install
sudo ldconfig
cd ..
 
After installation i compile the attached zeromq.c file using command
gcc -o zeromq zeromq.c -lzmq
which produced a zeromq executable file successfully.
i compiled the same c in eclipse tool also sussccessfully.

but for beagleboard integration we are using gcc-linaro-arm-linux-gnueabihf-4.8-2013.07-1_linux toolchain.
so whenever giving this tool in eclipse it shows following error on console

arm-linux-gnueabihf-gcc -L/usr/local/lib -o "zeromq"  ./src/zeromq.o   -lzmq
/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../../arm-linux-gnueabihf/bin/ld: skipping incompatible /usr/local/lib/libzmq.so when searching for -lzmq
/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../../arm-linux-gnueabihf/bin/ld: skipping incompatible /usr/local/lib/libzmq.a when searching for -lzmq
/usr/lib/gcc/arm-linux-gnueabihf/4.6/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lzmq
collect2: ld returned 1 exit status
make: *** [zeromq] Error 1

so i tried to compile the same file on terminal, which also produced the same error.



later i tried to install the zeromq library with different configuration commands as follows.

./configure --host=arm-linux-gnueabihf
./configure --host=arm-linux-gnueabihf  --with-libzmq=/usr/local/lib

but at his time it produces the errors as follows.

checking zmq.h usability... yes
checking zmq.h presence... yes
checking for zmq.h... yes
checking for zmq_init in -lzmq... no
configure: error: cannot link with -lzmq, install libzmq.

here what may be the problem? how can i resolve it?

Thanks in advance

Regards,
Sreekumar K S
sree@sree-desktop:~/czmq$ ./configure --host=arm-none-linux-gnueabi
configure: WARNING: if you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-none-linux-gnueabi-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking how to create a ustar tar archive... gnutar
checking whether make supports nested variables... yes
checking for arm-none-linux-gnueabi-gcc... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for gcc option to accept ISO C99... -std=gnu99
checking whether gcc -std=gnu99 and cc understand -c and -o together... yes
checking build system type... i686-pc-linux-gnu
checking host system type... arm-none-linux-gnueabi
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc -std=gnu99... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... no
checking for arm-none-linux-gnueabi-dumpbin... no
checking for arm-none-linux-gnueabi-link... no
checking for dumpbin... no
checking for link... link -dump
checking the name lister (nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert i686-pc-linux-gnu file names to arm-none-linux-gnueabi 
format... func_convert_file_noop
checking how to convert i686-pc-linux-gnu file names to toolchain format... 
func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for arm-none-linux-gnueabi-objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for arm-none-linux-gnueabi-dlltool... dlltool
checking how to associate runtime and link libraries... printf %s\n
checking for arm-none-linux-gnueabi-ar... no
checking for ar... ar
checking for archiver @FILE support... @
checking for arm-none-linux-gnueabi-strip... strip
checking for arm-none-linux-gnueabi-ranlib... no
checking for ranlib... ranlib
checking command to parse nm output from gcc -std=gnu99 object... ok
checking for sysroot... no
checking for arm-none-linux-gnueabi-mt... no
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc -std=gnu99 supports -fno-rtti -fno-exceptions... no
checking for gcc -std=gnu99 option to produce PIC... -fPIC -DPIC
checking if gcc -std=gnu99 PIC flag -fPIC -DPIC works... yes
checking if gcc -std=gnu99 static flag -static works... yes
checking if gcc -std=gnu99 supports -c -o file.o... yes
checking if gcc -std=gnu99 supports -c -o file.o... (cached) yes
checking whether the gcc -std=gnu99 linker (/usr/bin/ld) supports shared 
libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for a sed that does not truncate output... (cached) /bin/sed
checking for gawk... (cached) mawk
checking for pthread_create in -lpthread... yes
checking for uuid_generate in -luuid... yes
checking for arm-none-linux-gnueabi-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for ZeroMQ... yes
checking zmq.h usability... yes
checking zmq.h presence... yes
checking for zmq.h... yes
checking for zmq_init in -lzmq... yes
checking whether libzmq installation works... yes
checking for asciidoc... no
checking for xmlto... no
configure: WARNING: You are building an unreleased version of libczmq and 
asciidoc or xmlto are not installed.
configure: WARNING: Documentation will not be built and manual pages will not 
be installed.
checking whether to build documentation... no
checking whether to install manpages... no
checking for sodium_init in -lsodium... no
configure: WARNING: libsodium is needed for CURVE security
checking for ANSI C header files... (cached) yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking netinet/tcp.h usability... yes
checking netinet/tcp.h presence... yes
checking for netinet/tcp.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking ifaddrs.h usability... yes
checking ifaddrs.h presence... yes
checking for ifaddrs.h... yes
checking for net/if.h... yes
checking for net/if_media.h... no
checking for linux/wireless.h... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for size_t... yes
checking for ssize_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking for uint32_t... yes
checking for working volatile... yes
checking return type of signal handlers... void
checking for perror... yes
checking for gettimeofday... yes
checking for memset... no
checking for getifaddrs... yes
checking for freeifaddrs... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating src/libczmq.pc
config.status: creating doc/Makefile
config.status: creating addons/Makefile
config.status: creating model/Makefile
config.status: creating src/platform.h
config.status: src/platform.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands

sree@sree-desktop:~/czmq$ ./configure --host=arm-linux-gnueabihf  
--with-libzmq=/usr/local/lib
configure: WARNING: if you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-linux-gnueabihf-strip... arm-linux-gnueabihf-strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking how to create a ustar tar archive... gnutar
checking whether make supports nested variables... yes
checking for arm-linux-gnueabihf-gcc... arm-linux-gnueabihf-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether arm-linux-gnueabihf-gcc accepts -g... yes
checking for arm-linux-gnueabihf-gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of arm-linux-gnueabihf-gcc... gcc3
checking for arm-linux-gnueabihf-gcc option to accept ISO C99... -std=gnu99
checking whether arm-linux-gnueabihf-gcc -std=gnu99 and cc understand -c and -o 
together... yes
checking build system type... i686-pc-linux-gnu
checking host system type... arm-unknown-linux-gnueabihf
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by arm-linux-gnueabihf-gcc -std=gnu99... 
/usr/arm-linux-gnueabihf/bin/ld
checking if the linker (/usr/arm-linux-gnueabihf/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... 
/usr/bin/arm-linux-gnueabihf-nm -B
checking the name lister (/usr/bin/arm-linux-gnueabihf-nm -B) interface... BSD 
nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert i686-pc-linux-gnu file names to 
arm-unknown-linux-gnueabihf format... func_convert_file_noop
checking how to convert i686-pc-linux-gnu file names to toolchain format... 
func_convert_file_noop
checking for /usr/arm-linux-gnueabihf/bin/ld option to reload object files... -r
checking for arm-linux-gnueabihf-objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for arm-linux-gnueabihf-dlltool... dlltool
checking how to associate runtime and link libraries... printf %s\n
checking for arm-linux-gnueabihf-ar... arm-linux-gnueabihf-ar
checking for archiver @FILE support... @
checking for arm-linux-gnueabihf-strip... (cached) arm-linux-gnueabihf-strip
checking for arm-linux-gnueabihf-ranlib... arm-linux-gnueabihf-ranlib
checking command to parse /usr/bin/arm-linux-gnueabihf-nm -B output from 
arm-linux-gnueabihf-gcc -std=gnu99 object... ok
checking for sysroot... no
checking for arm-linux-gnueabihf-mt... no
checking for mt... mt
configure: WARNING: using cross tools not prefixed with host triplet
checking if mt is a manifest tool... no
checking how to run the C preprocessor... arm-linux-gnueabihf-gcc -std=gnu99 -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if arm-linux-gnueabihf-gcc -std=gnu99 supports -fno-rtti 
-fno-exceptions... no
checking for arm-linux-gnueabihf-gcc -std=gnu99 option to produce PIC... -fPIC 
-DPIC
checking if arm-linux-gnueabihf-gcc -std=gnu99 PIC flag -fPIC -DPIC works... yes
checking if arm-linux-gnueabihf-gcc -std=gnu99 static flag -static works... yes
checking if arm-linux-gnueabihf-gcc -std=gnu99 supports -c -o file.o... yes
checking if arm-linux-gnueabihf-gcc -std=gnu99 supports -c -o file.o... 
(cached) yes
checking whether the arm-linux-gnueabihf-gcc -std=gnu99 linker 
(/usr/arm-linux-gnueabihf/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for a sed that does not truncate output... (cached) /bin/sed
checking for gawk... (cached) mawk
checking for pthread_create in -lpthread... yes
checking for uuid_generate in -luuid... no
checking for arm-linux-gnueabihf-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for ZeroMQ... yes
checking zmq.h usability... yes
checking zmq.h presence... yes
checking for zmq.h... yes
checking for zmq_init in -lzmq... no
configure: error: cannot link with -lzmq, install libzmq.

sree@sree-desktop:~/czmq$ ./configure --host=arm-linux-gnueabihf
configure: WARNING: if you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-linux-gnueabihf-strip... arm-linux-gnueabihf-strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking how to create a ustar tar archive... gnutar
checking whether make supports nested variables... yes
checking for arm-linux-gnueabihf-gcc... arm-linux-gnueabihf-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether arm-linux-gnueabihf-gcc accepts -g... yes
checking for arm-linux-gnueabihf-gcc option to accept ISO C89... none needed
checking for style of include used by make... GNU
checking dependency style of arm-linux-gnueabihf-gcc... gcc3
checking for arm-linux-gnueabihf-gcc option to accept ISO C99... -std=gnu99
checking whether arm-linux-gnueabihf-gcc -std=gnu99 and cc understand -c and -o 
together... yes
checking build system type... i686-pc-linux-gnu
checking host system type... arm-unknown-linux-gnueabihf
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by arm-linux-gnueabihf-gcc -std=gnu99... 
/usr/arm-linux-gnueabihf/bin/ld
checking if the linker (/usr/arm-linux-gnueabihf/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... 
/usr/bin/arm-linux-gnueabihf-nm -B
checking the name lister (/usr/bin/arm-linux-gnueabihf-nm -B) interface... BSD 
nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert i686-pc-linux-gnu file names to 
arm-unknown-linux-gnueabihf format... func_convert_file_noop
checking how to convert i686-pc-linux-gnu file names to toolchain format... 
func_convert_file_noop
checking for /usr/arm-linux-gnueabihf/bin/ld option to reload object files... -r
checking for arm-linux-gnueabihf-objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for arm-linux-gnueabihf-dlltool... dlltool
checking how to associate runtime and link libraries... printf %s\n
checking for arm-linux-gnueabihf-ar... arm-linux-gnueabihf-ar
checking for archiver @FILE support... @
checking for arm-linux-gnueabihf-strip... (cached) arm-linux-gnueabihf-strip
checking for arm-linux-gnueabihf-ranlib... arm-linux-gnueabihf-ranlib
checking command to parse /usr/bin/arm-linux-gnueabihf-nm -B output from 
arm-linux-gnueabihf-gcc -std=gnu99 object... ok
checking for sysroot... no
checking for arm-linux-gnueabihf-mt... no
checking for mt... mt
configure: WARNING: using cross tools not prefixed with host triplet
checking if mt is a manifest tool... no
checking how to run the C preprocessor... arm-linux-gnueabihf-gcc -std=gnu99 -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if arm-linux-gnueabihf-gcc -std=gnu99 supports -fno-rtti 
-fno-exceptions... no
checking for arm-linux-gnueabihf-gcc -std=gnu99 option to produce PIC... -fPIC 
-DPIC
checking if arm-linux-gnueabihf-gcc -std=gnu99 PIC flag -fPIC -DPIC works... yes
checking if arm-linux-gnueabihf-gcc -std=gnu99 static flag -static works... yes
checking if arm-linux-gnueabihf-gcc -std=gnu99 supports -c -o file.o... yes
checking if arm-linux-gnueabihf-gcc -std=gnu99 supports -c -o file.o... 
(cached) yes
checking whether the arm-linux-gnueabihf-gcc -std=gnu99 linker 
(/usr/arm-linux-gnueabihf/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for a sed that does not truncate output... (cached) /bin/sed
checking for gawk... (cached) mawk
checking for pthread_create in -lpthread... yes
checking for uuid_generate in -luuid... no
checking for arm-linux-gnueabihf-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for ZeroMQ... yes
checking zmq.h usability... yes
checking zmq.h presence... yes
checking for zmq.h... yes
checking for zmq_init in -lzmq... no
configure: error: cannot link with -lzmq, install libzmq.
// Hello World client
//${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}
//gcc -o hwclient hwclient.c -lzmq
//arm-linux-gnueabihf-gcc -I/usr/local/include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/zeromq.d" -MT"src/zeromq.d" -o "src/zeromq.o" "../src/zeromq.c"
//Finished building: ../src/zeromq.c
#include <zmq.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
int main (void)
{
	printf ("Connecting to hello world server…\n");
	void *context = zmq_ctx_new ();
	void *requester = zmq_socket (context, ZMQ_REQ);
	zmq_connect (requester, "tcp://localhost:5555");
	int request_nbr;
	for (request_nbr = 0; request_nbr != 10; request_nbr++) {
		char buffer [10];
		printf ("Sending Hello %d…\n", request_nbr);
		zmq_send (requester, "Hello", 5, 0);
		zmq_recv (requester, buffer, 10, 0);
		printf ("Received World %d\n", request_nbr);
	}
	zmq_close (requester);
	zmq_ctx_destroy (context);
	return 0;
}
_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to