Coding⏱️ 2 min read📅 2026-05-31

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

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

Quick Answer: The issue is likely due to the missing -lc flag, which is required for dynamic linking. Add -lc to the compiler flags to resolve the error.

The error 'libpthread.so.0: error adding symbols: DSO missing fromcommand line' occurs when the compiler is unable to find a shared object library named libpthread.so. This error typically happens during compilation, especially with OpenVSwitch or other projects that rely heavily on pthreads.

💡 Why You Are Getting This Error

  • [Cause]

✅ Best Solutions to Fix It

Method 1: Using ldconfig

  1. Step 1: Update the ldconfig configuration to include the path of libpthread.so.0.

Method 2: Compiling with -L and -Wl,-rpath options

  1. Step 1: Compile your project using the following command: 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 -L/path/to/lib -Wl,-rpath,/path/to/lib***-lpthread*** -o utilities/ovs-dpctl utilities/ovs-dpctl.o lib/libopenvswitch.a

✨ Wrapping Up

By following these steps, you should be able to resolve the 'libpthread.so.0: error adding symbols: DSO missing from command line' error and successfully compile your OpenVSwitch project.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions