LD_LIBRARY_PATH vs LIBRARY_PATH

I’m building a simple C++ program and I want to temporarily substitute a system supplied shared library with a more recent version of it, for development and testing. I tried setting the LD_LIBRARY_PATH variable but the linker (ld) failed with: /usr/bin/ld: cannot find -lyaml-cpp I expected that to work because according to the ld man … Read more

Disable all gcc warnings

I’m working on a project that will read compiler error messages of a particular variety and do useful things with them. The sample codebase I’m testing this on (a random open-source application), and hence rebuilding frequently, contains a few bits that generate warnings, which are of no interest to me. How do I disable all … Read more

libpthread.so.0: error adding symbols: DSO missing from command line

When I’m compiling openvswitch-1.5.0, I’ve encountered the following compile error: gcc -Wstrict-prototypes -Wall -Wno-sign-compare -Wpointer-arith -Wdeclaration-after-statement -Wformat-security -Wswitch-enum -Wunused-parameter -Wstrict-aliasing -Wbad-function-cast -Wcast-align -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-field-initializers -Wno-override-init -g -O2 -export-dynamic ***-lpthread*** -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/libopenvswitch.a /home/jyyoo/src/dpdk/build/lib/librte_eal.a /home/jyyoo/src/dpdk/build/lib/libethdev.a /home/jyyoo/src/dpdk/build/lib/librte_cmdline.a /home/jyyoo/src/dpdk/build/lib/librte_hash.a /home/jyyoo/src/dpdk/build/lib/librte_lpm.a /home/jyyoo/src/dpdk/build/lib/librte_mbuf.a /home/jyyoo/src/dpdk/build/lib/librte_ring.a /home/jyyoo/src/dpdk/build/lib/librte_mempool.a /home/jyyoo/src/dpdk/build/lib/librte_malloc.a -lrt -lm /usr/bin/ld: /home/jyyoo/src/dpdk/build/lib/librte_eal.a(eal.o): undefined reference to symbol ‘pthread_create@@GLIBC_2.2.5’ /lib/x86_64-linux-gnu/libpthread.so.0: error … Read more

How do I force make/GCC to show me the commands?

I’m trying to debug a compilation problem, but I cannot seem to get GCC (or maybe it is make??) to show me the actual compiler and linker commands it is executing. Here is the output I am seeing: CCLD libvirt_parthelper libvirt_parthelper-parthelper.o: In function `main’: /root/qemu-build/libvirt-0.9.0/src/storage/parthelper.c:102: undefined reference to `ped_device_get’ /root/qemu-build/libvirt-0.9.0/src/storage/parthelper.c:116: undefined reference to `ped_disk_new’ /root/qemu-build/libvirt-0.9.0/src/storage/parthelper.c:122: … Read more

gcc makefile error: “No rule to make target …”

I’m trying to use GCC (linux) with a makefile to compile my project. I get the following error which is can’t seem to decipher in this context: “No rule to make target ‘vertex.cpp’, needed by ‘vertex.o’. Stop.” This is the makefile: a.out: vertex.o edge.o elist.o main.o vlist.o enode.o vnode.o g++ vertex.o edge.o elist.o main.o vlist.o … Read more

What exactly is LLVM?

I keep hearing about LLVM all the time. It’s in Perl, then it’s in Haskell, then someone uses it in some other language? What is it? What exactly distinguishes it from GCC (perspectives = safety etc.)? 7 s 7 LLVM is a library that is used to construct, optimize and produce intermediate and/or binary machine … Read more