Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9090493
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:23:01+00:00 2026-06-16T22:23:01+00:00

I am doing a project for which I need to compile a source code.

  • 0

I am doing a project for which I need to compile a source code. The code uses the PBC library (which in turn needs the GMP, both of which have been installed). The Makefile has this line :

node: node.o $(COMMON_OBJS)
g++ -m32 -g -static -o $@ $^ -L../PBC -lPBC -lpthread -lgnutls -lpbc -lgmp -lgcrypt -lgpg-error -ltasn1 -lz

But when I run make, I get this error :

/usr/bin/ld : cannot find -lgpg-error

Now this is quite frustrating as I don’t know how to fix it. I tried installing libgcrypt11-div (saw a suggestion on some site). Didn’t work.

I noticed that libgpg-error.so is installed in /usr/lib/i386-linux-gnu/. So I created link with ln -s in /usr/bin/. Still not working.

After adding the -v switch :

g++ -m32 -g -static -o node node.o application.o networkmessage.o usermessage.o buddy.o buddyset.o systemparam.o bipolynomial.o polynomial.o lagrange.o commitment.o commitmentmatrix.o commitmentvector.o io.o timer.o message.o -L../PBC -lPBC -lpthread -lgnutls -lpbc -lgmp -lgcrypt -lgpg-error -ltasn1 -lz -v

Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.6.1/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.1-9ubuntu3' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu

Thread model: posix
gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)

COMPILER_PATH=/usr/lib/gcc/i686-linux-gnu/4.6.1/:/usr/lib/gcc/i686-linux-gnu/4.6.1/:/usr/lib/gcc/i686-linux-gnu/:/usr/lib/gcc/i686-linux-gnu/4.6.1/:/usr/lib/gcc/i686-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/i686-linux-gnu/4.6.1/:/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../i386-linux-gnu/:/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib/:/lib/i386-linux-gnu/:/lib/../lib/:/usr/lib/i386-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../:/lib/:/usr/lib/

COLLECT_GCC_OPTIONS='-m32' '-g' '-static' '-o' 'node' '-L../PBC' '-v' '-mtune=generic' '-march=i686'
/usr/lib/gcc/i686-linux-gnu/4.6.1/collect2 --build-id --no-add-needed --as-needed -m elf_i386 --hash-style=gnu -static -z relro -o node /usr/lib/gcc/i686-linux-gnu/4.6.1/../../../i386-linux-gnu/crt1.o /usr/lib/gcc/i686-linux-gnu/4.6.1/../../../i386-linux-gnu/crti.o /usr/lib/gcc/i686-linux-gnu/4.6.1/crtbeginT.o -L../PBC -L/usr/lib/gcc/i686-linux-gnu/4.6.1 -L/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../i386-linux-gnu -L/usr/lib/gcc/i686-linux-gnu/4.6.1/../../../../lib -L/lib/i386-linux-gnu -L/lib/../lib -L/usr/lib/i386-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/i686-linux-gnu/4.6.1/../../.. node.o application.o networkmessage.o usermessage.o buddy.o buddyset.o systemparam.o bipolynomial.o polynomial.o lagrange.o commitment.o commitmentmatrix.o commitmentvector.o io.o timer.o message.o -lPBC -lpthread -lgnutls -lpbc -lgmp -lgcrypt -lgpg-error -ltasn1 -lz -lstdc++ -lm --start-group -lgcc -lgcc_eh -lc --end-group /usr/lib/gcc/i686-linux-gnu/4.6.1/crtend.o /usr/lib/gcc/i686-linux-gnu/4.6.1/../../../i386-linux-gnu/crtn.o
/usr/bin/ld: cannot find -lgpg-error
collect2: ld returned 1 exit status
make: *** [node] Error 1

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T22:23:02+00:00Added an answer on June 16, 2026 at 10:23 pm

    Try removing the -static switch.

    If you want to -static you need to wrap it around libraries that you want to be static and let the other libraries remain dynamic, otherwise gcc/g++ will try and go down into every library and compile everything statically which may not be possible.

    See this SO post, Static link of shared library function in gcc.

    For example to compile applejuice statically while everything else remaining dynamic:

    gcc object1.o object2.o -Wl,-Bstatic -lapplejuice -Wl,-Bdynamic -lorangejuice
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm doing a project in Python (3.2) for which I need to compare user
I am doing a project, for which I need to know all the wikipedia
i am doing a project in which i have to get the image from
I have an MSVC Makefile Project in which I need to set an environment
I need to compile a project for both .Net 3.5 and .Net 4.0. What
I have several classes in a project which need to only be in certain
I have a small project that I need to compile. I have one header
Context: I have downloaded the source code for Discount, which is a simple C
I am doing a project which involves a good use of core data. I
I am doing a project which is based on storing the employee details, like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.