/usr/bin/ld: cannot find -lhogweed - c

I;m trying to compile GnuTLS. When I thy to configure the package I get this error:
configure:8820: gcc -std=gnu99 -o conftest -g -O2 conftest.c -lnettle -lhogweed -lgmp >&5
/usr/bin/ld: cannot find -lhogweed
collect2: ld returned 1 exit status
I searched google for hogweed but there is no such a package? How I can fix this problem?

When linking with libraries you remove the lib from their name and append it to -l
ie for example libcrypto library will be linked by passing option -lcrypto
in your case its is -lhogweed that is missing. That means libhogweed library is missing.
A simple Google search of 'libhogweed' shows that its a part of 'GNU Nettle cryptographic library'. So you can install this and fix your problem.

I think you need to install the Nettle cryptographic library. As you didn't post your OS, I can't give more details.
More information on Nettle and Hogweed: http://www.lysator.liu.se/~nisse/nettle/nettle.html#Linking

According to this message, you need to build Nettle after you install GMP. Try to rebuild Nettle and see if it gets built.

Related

GCC:- unable to find libpthread_nonshared.a file while linking libraries to create a so file on Linux

Hi I'm trying to compile a c project with gcc 10.2 in Ubuntu 20.04.
But at the end it gives me error as below
/usr/bin/ld: cannot find /usr/lib/x86_64-linux-gnu/libpthread_nonshared.a
collect2: error: ld returned 1 exit status
Below are the libraries I'm trying to link while creating a so file
-lpthread -ldl -lm -lstdc++ -lrt
When i looked into /usr/lib64 i could see only *.so files but no *.a files.
Do we need to install them separately?
Could someone help with this.
Do we need to install them separately?
You need to install glibc-devel (or similar) package.

Generate LLVM IR for httpd

I am trying to compile apache2 with LLVM, to generate final binaries in LLVM IR.
I used flto option in compiling and linking and passed "also-emit-llvm" to the linker through clang.
It seems to work for most steps, however I had two concerns
1) Earlier I used LLVM 3.6, whose gold plugin doesn't accept also-emit-llvm, but has emit-llvm only, basically it will emit only elf or llvm. Which the Autotools build system doesn't like. The configure and make script want binaries, while I want llvm. Any solutions to this?
2) So I shifted to LLVM 3.5.2, the build process goes well, I can generate both httpd.bc and httpd elf binaries, but the linker doesn't want to link for modules (it was able to link for binaries)
Specifically, I get this error
`
/usr/share/apr-1.0/build/libtool --silent --mode=link /home/rbhatia/Desktop/llvm-newbuild/bin/clang -pthread -flto -o mod_authn_file.la -rpath /home/rbhatia/Desktop/httpd-2.4.12/llvm/modules -module -avoid-version mod_authn_file.lo
/usr/bin/ld: error: .libs/mod_authn_file.o:1:3: invalid chaenter code hereracter
/usr/bin/ld: error: .libs/mod_authn_file.o:1:3: syntax error, unexpected $end
/usr/bin/ld: error: .libs/mod_authn_file.o: not an object or archive
collect2: error: ld returned 1 exit status
`
I can see that mod_authn_file.o is a valid LLVM IR file which I can disassemble with llvm-dis.
Also, just before this step, the linker is able to link httpd and httpd.bc
Any help on what the error is?
Take a look at
https://github.com/SRI-CSL/whole-program-llvm
we use this tool to build quite large projects into bitcode. Our
biggest so far was FreeBSD 10.0, so size is not usually an issue.
Our travis build check is actually
apache, as is our tutorial. Hope that helps.

'Cannot find -lc' error when linking a program using gcc and autoconf

I'm trying to compile a program written in C. ./configure was successful, but when I did make, it gave me an error. I did make check, and it said:
gcc -g -Wall -static -o multipht multipht.o multimatch.o multiweight.o multiwrite.o multisort.o multiclean.o
/usr/bin/ld: cannot find -lc
collect2: ld returned 1 exit status
("multipht" is the name of the program I'm trying to install.)
Could anyone tell me what the problem is?
Your system appears to not have a statically linkable C library. That's actually pretty common these days. Take off the -static flag and you should be good to go.
On Fedora, the static version of glibc is in the glibc-static package.
sudo yum -y install glibc-devel glibc-static

ld: library not found for -lplot

I am new here. I recently installed plotutils-dev on my mac using fink, but when I try to compile a little program I have by doing
gcc -g -o atomos.o atomos.c -lplot
it says
ld: library not found for -lplot
collect2: ld returned 1 exit status
I have searched the problem on the web with little success. The only thing I know is that when I type
dpkg -S libplot.dylib
it says
plotutils-dev: /sw/lib/libplot.dylib
which I believe it means I have installed libplot on my mac. So I don't know what is the problem. Any help is welcomed. I am a beginner so It would be nice if some guidelines are provided in a user-friendly way.
The linker can't find the libplot library. I'm not familiar with mac, but with gcc you can tell it the path to the library with the -L flag, e.g.:
gcc -g -o atomos.o atomos.c -lplot -L/sw/lib/
(I'm guessing at that path, but you can probably figure out the path to the library if that isn't right.)
Also, it's probably a typo in your question, but I changed it to -lplot (note extra -l). You want the -l to link with the plot library.

Error to try compile with gcc

I'm trying to compile SNNS (Stuttgart Neural Network Simulator) is a software simulator for neural networks on Unix, but I got the following error message:
Ignore possible error messages for the following command:
ranlib libfunc.a
END OF COMMANDS THAT MAY FAIL
make[3]: Leaving directory `/home/fer/Desktop/SNNSv4.3/kernel/sources'
end of (re)making kernel libraries
gcc snns2c.o snns2clib.o ../../kernel/sources/libkernel.a ../../kernel/sources/libfunc.a -lm -ll -o snns2c
/usr/bin/ld: cannot find -ll
collect2: ld returned 1 exit status
But I don't know what I need to install, do you have an idea about this problem?
I think -ll is referring to the lex library libl, as per this message. You may need to modify that make file to link against flex.
I solved this problem after installing flex from the distro's official repository.

Resources