/usr/bin/ld: cannot find -lcurl - linux

I'm trying to install the ruby gem for curl (curb) on Ubuntu 10.10, but during the installation, I get the error:
/usr/bin/ld: cannot find -lcurl
But curl is installed! apt-get install curl says I've got the newest version. There is no curl-dev either.
I'm getting these kinds of errors all the time, with curl, with libxml, with readline, and I have no idea what's going on. Something is wrong with my installation of Ubuntu, but I don't know what, I don't know where to look, I don't know what to google for, and I don't know how to fix it.
Help would be deeply appreciated.
EDIT: this is in my /usr/lib dir for libcurl:
lrwxrwxrwx 1 root root 19 2011-02-18 23:15 libcurl-gnutls.so.3 -> libcurl-gnutls.so.4
lrwxrwxrwx 1 root root 23 2011-02-18 23:15 libcurl-gnutls.so.4 -> libcurl-gnutls.so.4.2.0
-rw-r--r-- 1 root root 339880 2010-06-23 09:07 libcurl-gnutls.so.4.2.0
lrwxrwxrwx 1 root root 12 2011-02-18 23:14 libcurl.so.3 -> libcurl.so.4
lrwxrwxrwx 1 root root 16 2011-02-18 23:14 libcurl.so.4 -> libcurl.so.4.2.0
-rw-r--r-- 1 root root 360904 2010-06-23 09:07 libcurl.so.4.2.0

You need the libcurl3-dev package.
Curl is just the command line utility. The library is libcurl3, and it has a -dev package.
(It seems to be a virtual package in Maverick, redirecting to libcurl4-openssl-dev, but that should still work or the virtual package would not have been provided.) Indeed from your lib directory I can see that libcurl3 is merely a symbolic link to libcurl4. (libcurl3-dev may not be available in the future, so use libcurl4-openssl-dev directly).

Related

go downloaded with apt,but go command not found

my os is Kali.First i enter go,shell told me go command not found
└─$ go
Command 'go' not found, but can be installed with:
sudo apt install gccgo-go
sudo apt install golang-go
so i sudo apt install golang-go and it told me golang-go is already latest version,but go was still not found.And i google to knows sometime it will have a floder /usr/local/go but it not have one.
┌──(highway㉿highway)-[/usr/local]
└─$ ll
drwxr-xr-x 2 root root 4096 5月 16 13:27 bin
drwxr-xr-x 2 root root 4096 2月 8 01:26 etc
drwxr-xr-x 2 root root 4096 2月 8 01:26 games
drwxr-xr-x 2 root root 4096 2月 8 01:26 include
drwxr-xr-x 5 root root 4096 4月 23 17:28 lib
lrwxrwxrwx 1 root root 9 4月 23 17:28 man -> share/man
drwxr-xr-x 3 root root 4096 4月 24 08:09 samba
drwxr-xr-x 2 root root 4096 2月 8 01:26 sbin
drwxr-xr-x 7 root root 4096 4月 24 08:09 share
drwxr-xr-x 2 root root 4096 2月 8 01:26 src
so i locate go and find /usr/lib/go and cd /usr/lib/go/bin
┌──(highway㉿highway)-[/usr/lib/go]
└─$ ls
api bin doc misc pkg src test VERSION
┌──(highway㉿highway)-[/usr/lib/go/bin]
└─$ ll
-rwxr-xr-x 1 root root 10225816 5月 15 03:22 go
-rwxr-xr-x 1 root root 2281848 5月 15 03:22 gofmt
┌──(highway㉿highway)-[/usr/lib/go/bin]
└─$ ./go version
go version go1.18.2 linux/amd64
┌──(highway㉿highway)-[/usr/lib/go/bin]
└─$ ./go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/highway/.cache/go-build"
GOENV="/home/highway/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/highway/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/highway/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go-1.18"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.18/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.18.2"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3356979286=/tmp/go-build -gno-record-gcc-switches"
it work,but why go is still not found?
┌──(highway㉿highway)-[/usr/lib/go/bin]
└─$ go
Command 'go' not found, but can be installed with:
sudo apt install gccgo-go
sudo apt install golang-go
what different between floder /usr/lib/go/bin and /usr/local/go?if there were not different what can i do to use go instead of cd /usr/lib/go/bin && ./go.
You need to append go's bin directory to your PATH environment variable. Add this line at the end of ~/.bashrc:
export PATH=$PATH:/usr/lib/go/bin
An alternative to #emilianolch solution is to create symlinks in /usr/local/bin. And you properly want all the binaries in /usr/lib/go/bin linked, so:
sudo ln -s /usr/lib/go/bin/* /usr/lib/bin/
Should work right away without restarting terminal.
PRO: Go binaries appear as they are like other distro. May work better with other tools like VS Code SSH Remote.
CON: Have to ln again if more Go tools are installed via apk in future. (Only new ones, not needed if reinstalling/upgrading existing ones)

What's the difference between libjpeg.so.8 and libjpeg.so.62

There are always jpeg decoder libraries pre-installed on Linux like:
/usr/lib/x86_64-linux-gnu/libjpeg.so
/usr/lib/x86_64-linux-gnu/libjpeg.so.62
/usr/lib/x86_64-linux-gnu/libjpeg.so.62.0.0
/usr/lib/x86_64-linux-gnu/libjpeg.so.8
/usr/lib/x86_64-linux-gnu/libjpeg.so.8.0.2
What is the difference between the so library? Does libjpeg.so.62 build from libjpeg-turbo?
Firstly, if you run:
ls -l /usr/lib/x86_64-linux-gnu/*jpeg*
you will see that most of the files are just symlinks to the one with the full version, so programs can link against the latest one by specifying an unversioned library in the knowledge that it will point to the latest version:
lrwxrwxrwx 1 root root 17 Oct 20 2016 libjpeg.so -> libjpeg.so.62.2.0
lrwxrwxrwx 1 root root 17 Oct 20 2016 libjpeg.so.62 -> libjpeg.so.62.2.0
-rw-r--r-- 1 root root 436224 Oct 20 2016 libjpeg.so.62.2.0
Secondly, unfortunately I don't have the same files as you else I would help further, but in general, you can find which package a given file comes from like this:
dpkg -S someFile
So, on my system, I can see that libjpeg.a for example, comes from package libjpeg62-turbo-dev
dpkg -S libjpeg.a
libjpeg62-turbo-dev:amd64: /usr/lib/x86_64-linux-gnu/libjpeg.a

How to remove notepad++ package from Ubuntu 18.04?

Earlier I was using Notepad++ and its not user friendly. So I've installed notepadqq now and trying to remove notepad++.
I tried to do but not able to find the package
root#ahamed:/home/ahamed/snap# sudo apt remove notepad-plus-plus
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package notepad-plus-plus
root#ahamed:/home/ahamed/snap#
Now i can see two packages in my machine
root#ahamed:/home/ahamed/snap# ls -ltr
total 8
drwxr-xr-x 4 ahamed ahamed 4096 Aug 1 12:01 notepadqq
drwxr-xr-x 4 ahamed ahamed 4096 Aug 1 12:13 notepad-plus-plus
root#ahamed:/home/ahamed/snap#
I can see that notepad++ works in .exe format. It really looks weird. Could someone help me on this
root#ahamed:/home/ahamed/snap# ps -ef|grep notepad
ahamed 16309 2113 0 12:14 tty2 00:00:00 bash /snap/notepad-plus-plus/85/bin/notepad-plus-plus
ahamed 16421 16309 0 12:14 tty2 00:00:04 /home/ahamed/snap/notepad-plus-plus/85/notepad-plus-plus/notepad-plus-plus.exe
ahamed 16424 1 0 12:14 ? 00:00:03 /snap/notepad-plus-plus/85/bin/wineserver
root 17134 11542 0 12:23 pts/0 00:00:00 grep --color=auto notepad
root#ahamed:/home/ahamed/snap#
List the installed softwares using the following command, and you will get the list:
kswajih#kswajih:~$ sudo snap list
Name Version Rev Tracking Publisher Notes
core 16-2.33.1 4917 stable canonical core
notepad-plus-plus 7.5.8 85 stable mmtrt -
sublime-text 3176 22 stable snapcrafters classic
vscode 1.25.1-1531323788 44 stable flexiondotorg classic
Now use the following command to remove installed packages, in your case its notepad-plus-plus:
kswajih#kswajih:~$ sudo snap remove notepad-plus-plus
notepad-plus-plus removed
Hope it helps.

Does ctypes.util.find_library conform to "usual" library linking practices in Linux?

Recently I ran into a problem with the Python function ctypes.util.find_library. The function is used to locate shared libraries by name; for example, CuPy uses it to locate cuDNN. In my case, I had several versions of cuDNN installed, and it picked up the latest (as per the documentation). However, the contents of the directory look like this:
$ l /usr/local/cuda-8.0/lib64 | grep -i cudnn
lrwxrwxrwx 1 root root 13 Oct 3 08:21 libcudnn.so -> libcudnn.so.6*
lrwxrwxrwx 1 1000 users 17 Jul 27 2016 libcudnn.so.5 -> libcudnn.so.5.1.5*
-rwxrwxr-x 1 1000 users 79337624 Jul 27 2016 libcudnn.so.5.1.5*
lrwxrwxrwx 1 root root 18 Oct 3 08:21 libcudnn.so.6 -> libcudnn.so.6.0.21*
-rwxr-xr-x 1 1000 users 154322864 Apr 12 2017 libcudnn.so.6.0.21*
lrwxrwxrwx 1 root root 17 Oct 2 10:32 libcudnn.so.7 -> libcudnn.so.7.0.3*
-rwxrwxr-x 1 1000 1000 217188104 Sep 16 05:09 libcudnn.so.7.0.3*
-rw-r--r-- 1 1000 users 143843808 Apr 12 2017 libcudnn_static.a
Even though the latest version is 7.0.3, judging from the symbolic link hierarchy, I would have expected version 6.0.21 to be picked up. My questions are:
Which version would the gcc (or clang) toolchain have picked up during compile-time?
Which version would a C/C++ executable have picked up during run-time?
Is there any kind of information source (an article, a man page, a book, ...) out there that contains explicitly the answers to the first two questions? I tried googling it, but nothing definitive came up.
Traditionally you'd build with a command like gcc -lcudnn. This would find libcudnn.so which points to libcudnn.so.6 which points to libcudnn.so.6.0.21. So libcudnn.so.6.0.21 would be linked at build time.
Traditionally a shared library will contain a "SONAME" which indicates the ABI compatible version to be loaded at runtime. I'm pretty sure that would be libcudnn.so.6 in this case. So building against libcudnn.so.6.0.21 would give you a runtime dependency on libcudnn.so.6 (you can verify this using ldd myprog | grep libcudnn.so).
Probably, but that's not an on-topic question for Stack Overflow ("recommending an off-site resource").

CMake can't find QtCore

My project uses cmake which tried to look for QT4 which is installed:
root#netqa1:~# which qmake
/usr/bin/qmake
root#netqa1:~# ls -l /usr/lib/i386-linux-gnu/libQtCore.so*
lrwxrwxrwx 1 root root 18 Feb 6 2013 /usr/lib/i386-linux-gnu/libQtCore.so -> libQtCore.so.4.8.1
lrwxrwxrwx 1 root root 18 Feb 6 2013 /usr/lib/i386-linux-gnu/libQtCore.so.4 -> libQtCore.so.4.8.1
lrwxrwxrwx 1 root root 18 Feb 6 2013 /usr/lib/i386-linux-gnu/libQtCore.so.4.8 -> libQtCore.so.4.8.1
-rw-r--r-- 1 root root 2998336 Feb 6 2013 /usr/lib/i386-linux-gnu/libQtCore.so.4.8.1
Still I continue to get this error from cmake:
Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_LIBS as /usr/lib/i386-linux-gnu
Warning: But QtCore couldn't be found. Qt must NOT be installed correctly, or it wasn't found for cross compiling.
Any pointers will be really helpful
You have probably not installed QT4 dev packets. On Ubuntu this is something like libqt4-dev.
The suffix "dev" stands for development packet.
Adding this option to cmake works for me in Kubuntu 18.04 :
-DQT_QMAKE_EXECUTABLE=qmake-qt4
Original discussion here.

Resources