not able to find executable/binary file after "go build" command - linux

I am new to golang and I have a single package go file "hello_world.go" which I am compiling via "go build hello_world.go".
After this I expect to see executable "hello_world". But I donot see it.
I tried options -x and -v with "go build " and below is the output
go build -x -v hello_world.go
WORK=/tmp/go-build697702511
command-line-arguments
mkdir -p $WORK/command-line-arguments/_obj/
mkdir -p $WORK/
cd /home/vignesh/exercism/go/hello-world
/usr/local/go/pkg/tool/linux_amd64/compile -o $WORK/command-line- arguments.a -trimpath $WORK -goversion go1.9.2 -p command-line-arguments -complete -buildid 1d40767f999b0c5cb646b061911455ddde0101d2 -D _/home/vignesh/exercism/go/hello-world -I $WORK -pack ./hello_world.go
below is the content of my working directory after above two "go build" operations
-rw------- 1 vignesh vignesh 208 Jul 17 20:50 .solution.json
-rw-rw-r-- 1 vignesh vignesh 1451 Jul 17 20:50 README.md
-rw-rw-r-- 1 vignesh vignesh 1311 Jul 17 20:50 hello_test.go_bkp
drwxr-xr-x 4 vignesh vignesh 4096 Jul 18 18:27 ..
-rw-rw-r-- 1 vignesh vignesh 1311 Jul 18 20:27 hello_test.go
-rw-rw-r-- 1 vignesh vignesh 684 Jul 18 20:29 hello_world.go
drwxr-xr-x 2 vignesh vignesh 4096 Jul 18 20:57 .
I then tried "go build -o aaa hello_world.go" which generated binary file "aaa", which on execution gave following errors:
./aaa: line 1: syntax error near unexpected token `newline'
./aaa: line 1: `!<arch>'
below is the output of "go env "
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/vignesh/exercism/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build845978294=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
Kindly help me with a fix or any sugestions to debug this issue.
Thanks in advance

You're building a package that isn't main, so there is no executable to create. Setting the -o flag forces build to output the object file that would otherwise be discarded, but that is not an executable. Go object files start with the string !<arch>\n, which is why you receive that error when you attempt to execute it.
Change your package name to main.

Related

configure: error: --with-ssl was given, but OpenSSL wasn't found on ubuntu 20.04?

I have try to compile and build libcurl inside my toolcahin folder by using cross compile but always I got same error...
1-First I build openssl by this steps
export TOOLCHAIN=/home/MY/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabi
export CC=$TOOLCHAIN/bin/arm-linux-gnueabi-gcc-7.5.0
export RANLIB=$TOOLCHAIN/bin/arm-linux-gnueabi-ranlib
export PATH="$TOOLCHAIN/bin:$PATH"
./Configure linux-generic32 --prefix=$TOOLCHAIN/arm-linux-gnueabi/libc/usr no-async
make depends
make
make install
.
.
.
cp libcrypto.pc /home/MY/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabi/arm-linux-gnueabi/sysroot/usr/lib/pkgconfig
chmod 644 /home/MY/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabi/arm-linux-gnueabi/sysroot/usr/lib/pkgconfig/libcrypto.pc
cp libssl.pc /home/MY/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabi/arm-linux-gnueabi/sysroot/usr/lib/pkgconfig
chmod 644 /home/MY/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabi/arm-linux-gnueabi/sysroot/usr/lib/pkgconfig/libssl.pc
cp openssl.pc /home/MY/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabi/arm-linux-gnueabi/sysroot/usr/lib/pkgconfig
chmod 644 /home/MY/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabi/arm-linux-gnueabi/sysroot/usr/lib/pkgconfig/openssl.pc
.
.
.
~/$ ls -n from gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabi
total 36
drwxr-xr-x 6 raed raed 4096 نوف 26 12:31 arm-linux-gnueabi
drwxr-xr-x 2 raed raed 4096 ديس 4 2019 bin
-rw-r--r-- 1 raed raed 11287 ديس 4 2019 gcc-linaro-7.5.0-2019.12-linux-manifest.txt
drwxr-xr-x 3 raed raed 4096 ديس 4 2019 include
drwxr-xr-x 3 raed raed 4096 ديس 4 2019 lib
drwxr-xr-x 3 raed raed 4096 ديس 4 2019 libexec
drwxr-xr-x 8 raed raed 4096 ديس 4 2019 share
~/$ ls -n from arm-linux-gnueabi/libc/usr
total 28
drwxr-xr-x 2 raed raed 4096 نوف 26 12:18 bin
drwxr-xr-x 34 raed raed 4096 نوف 26 12:18 include
drwxr-xr-x 6 raed raed 4096 نوف 26 12:18 lib
drwxr-xr-x 3 raed raed 4096 ديس 4 2019 libexec
drwxr-xr-x 2 raed raed 4096 ديس 4 2019 sbin
drwxr-xr-x 5 raed raed 4096 ديس 4 2019 share
drwxrwxr-x 6 raed raed 4096 نوف 26 12:18 ssl
2-Then I have try to build libcurl with--ssl but I have got error
cd curl-7.72.0
export TOOLCHAIN=/home/MY/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabi
export CC=$TOOLCHAIN/bin/arm-linux-gnueabi-gcc-7.5.0
export RANLIB=$TOOLCHAIN/bin/arm-linux-gnueabi-ranlib
export PATH="$TOOLCHAIN/bin:$PATH"
./configure --with-ssl=/home/MY/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabi/arm-linux-gnueabi/libc/usr --host=arm-linux-gnueabi
.
.
.
configure: PKG_CONFIG_LIBDIR will be set to "/home/MY/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabi/arm-linux-gnueabi/libc/usr/lib/pkgconfig"
checking for arm-linux-gnueabi-pkg-config... /usr/bin/pkg-config
checking for openssl options with pkg-config... found
configure: pkg-config: SSL_LIBS: "-lssl -lcrypto"
configure: pkg-config: SSL_LDFLAGS: "-L/home/MY/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabi/arm-linux-gnueabi/libc/usr/lib"
configure: pkg-config: SSL_CPPFLAGS: "-I/home/MY/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabi/arm-linux-gnueabi/libc/usr/include"
checking for HMAC_Update in -lcrypto... no
checking for HMAC_Init_ex in -lcrypto... no
checking OpenSSL linking with -ldl... no
checking OpenSSL linking with -ldl and -lpthread... no
configure: OPT_SSL: /home/MY/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabi/arm-linux-gnueabi/libc/usr
configure: OPENSSL_ENABLED:
configure: error: --with-ssl was given but OpenSSL could not be detected
P.s: same steps work just fine on ubuntu 18.04
There are a lot of different ways to build libcurl with openssl support, and this may not be immediate to find out what is causing this issue.
But here is the procedure I am using on Ubuntu 20.04.1 - You may have to adjust the content of the CROSS_COMPILE variable, since you are using the arm-linux-gnueabi toolchain, and not the arm-none-linux-gnueabihf one: I am using the gcc toolchain for Cortex-A from ARM.
The versions of curl and openssl may have to be adjusted as well.
CROSS_COMPILE=/opt/arm/9/gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-
PREFIX=$(pwd)/sysroot
wget https://www.openssl.org/source/openssl-1.1.1h.tar.gz
tar zxf openssl-1.1.1h.tar.gz
pushd openssl-1.1.1h
./Configure linux-generic32 shared -DL_ENDIAN --prefix=${PREFIX} --openssldir=${PREFIX} shared
make CROSS_COMPILE=/opt/arm/9/gcc-arm-9.2-2019.12-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf- PROCESSOR=ARM install
popd
wget https://zlib.net/zlib-1.2.11.tar.gz
tar xvf zlib-1.2.11.tar.gz
pushd zlib-1.2.11
CC=${CROSS_COMPILE}gcc ./configure --prefix=${PREFIX}
make CC=${CROSS_COMPILE}gcc all install
popd
wget https://curl.haxx.se/download/curl-7.73.0.tar.gz
tar zxf curl-7.73.0.tar.gz
pushd curl-7.73.0
CC=${CROSS_COMPILE}gcc LD=${CROSS_COMPILE}ld AR=${CROSS_COMPILE}ar NM=${CROSS_COMPILE}nm AS=${CROSS_COMPILE}as ./configure --disable-static --enable-shared --with-ssl=${PREFIX} --prefix=${PREFIX} --host=arm-none-linux-gnueabihf --target=arm-none-linux-gnueabihf --without-libidn2
make CC=${CROSS_COMPILE}gcc LD=${CROSS_COMPILE}ld AR=${CROSS_COMPILE}ar NM=${CROSS_COMPILE}nm AS=${CROSS_COMPILE}as install
popd
ll -gG sysroot/lib/
total 6796
drwxrwxr-x 4 4096 Nov 16 08:10 ./
drwxrwxr-x 9 4096 Nov 16 07:53 ../
drwxrwxr-x 2 4096 Nov 16 07:53 engines-1.1/
-rw-r--r-- 1 3199974 Nov 16 07:53 libcrypto.a
lrwxrwxrwx 1 16 Nov 16 07:53 libcrypto.so -> libcrypto.so.1.1*
-rwxr-xr-x 1 2087864 Nov 26 07:53 libcrypto.so.1.1*
-rwxr-xr-x 1 1027 Nov 26 08:10 libcurl.la*
lrwxrwxrwx 1 16 Nov 26 08:10 libcurl.so -> libcurl.so.4.7.0*
lrwxrwxrwx 1 16 Nov 26 08:10 libcurl.so.4 -> libcurl.so.4.7.0*
-rwxr-xr-x 1 407748 Nov 26 08:10 libcurl.so.4.7.0*
-rw-r--r-- 1 578076 Nov 26 07:53 libssl.a
lrwxrwxrwx 1 13 Nov 26 07:53 libssl.so -> libssl.so.1.1*
-rwxr-xr-x 1 453684 Nov 26 07:53 libssl.so.1.1*
-rw-r--r-- 1 96210 Nov 26 07:51 libz.a
lrwxrwxrwx 1 14 Nov 26 07:51 libz.so -> libz.so.1.2.11*
lrwxrwxrwx 1 14 Nov 26 07:51 libz.so.1 -> libz.so.1.2.11*
-rwxr-xr-x 1 98708 Nov 26 07:51 libz.so.1.2.11*
drwxrwxr-x 2 4096 Nov 26 08:10 pkgconfig/
file sysroot/bin/curl
sysroot/bin/curl: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, with debug_info, not stripped
share edit delete flag
Thank you ..
I solve the issue ...
The problem is with zlib need to build it inside toolchain and add this in configure seetings
--with-zlib=$prefix/lib

Linux: Can't find existing shared library in docker container

I try to set up FastRTPS inside a docker container. I wrote a Dockerfile which builds FastRTPS and it's dependencies from source and installs the libraries and delivered examples. But the examples do not work:
/opt# /usr/local/examples/C++/HelloWorldExample/bin/HelloWorldExample
/usr/local/examples/C++/HelloWorldExample/bin/HelloWorldExample: error while loading shared libraries: libfastrtps.so.1: cannot open shared object file: No such file or directory
As these library was built in this container and automatically installed, it must be somewhere and they are here:
root#6e544f0699cf:/opt# ls -la /usr/local/lib/
total 9196
drwxr-xr-x 1 root root 4096 Mar 26 22:02 .
drwxr-xr-x 1 root root 4096 Mar 26 22:02 ..
drwxr-xr-x 3 root root 4096 Mar 26 22:00 cmake
drwxr-xr-x 3 root root 4096 Mar 26 22:00 foonathan_memory
lrwxrwxrwx 1 root root 15 Mar 26 22:00 libfastcdr.so -> libfastcdr.so.1
lrwxrwxrwx 1 root root 20 Mar 26 22:00 libfastcdr.so.1 -> libfastcdr.so.1.0.12
-rw-r--r-- 1 root root 99504 Mar 26 22:00 libfastcdr.so.1.0.12
lrwxrwxrwx 1 root root 16 Mar 26 22:02 libfastrtps.so -> libfastrtps.so.1
lrwxrwxrwx 1 root root 21 Mar 26 22:02 libfastrtps.so.1 -> libfastrtps.so.1.10.0
-rw-r--r-- 1 root root 8133952 Mar 26 22:01 libfastrtps.so.1.10.0
-rw-r--r-- 1 root root 1158048 Mar 26 22:00 libfoonathan_memory-0.6.2.a
drwxrwsr-x 3 root staff 4096 Mar 26 21:37 python3.7
It is also possible to look into this library # nm -D /usr/local/lib/libfastrtps.so.1.
But the output of ldconfig is a bit strange:
# ldconfig -v | grep /usr/local/lib
ldconfig: Can't stat /usr/local/lib/x86_64-linux-gnu: No such file or directory
ldconfig: Path `/lib/x86_64-linux-gnu' given more than once
ldconfig: Path `/usr/lib/x86_64-linux-gnu' given more than once
ldconfig: /lib/x86_64-linux-gnu/ld-2.28.so is the dynamic linker, ignoring
/usr/local/lib:
Here I expected the libraries listed but they are not.
How to fix that?
EDIT 1
some extractions from the make output while building FastRTPS:
...
-- Installing: /usr/local/lib/libfastrtps.so.1.10.0
-- Installing: /usr/local/lib/libfastrtps.so.1
-- Installing: /usr/local/lib/libfastrtps.so
...
-- Installing: /usr/local/examples/C++/HelloWorldExample/bin/HelloWorldExample
-- Set runtime path of "/usr/local/examples/C++/HelloWorldExample/bin/HelloWorldExample" to ""
Why the runtime path is set to "" - nothing?
The last edit led to the issue and also to the solution.
CMake removes the RPATH. In case of the usage within a docker container, this stripping makes no sense and can be turned off as described in this post by adding this argument to the CMake configuration call:
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE
At the end my Dockerfile looks like this:
FROM fastrtps-core
WORKDIR /opt
RUN git clone https://github.com/eProsima/Fast-RTPS.git && \
export LDFLAGS="-Wl,--copy-dt-needed-entries" && \
mkdir build && \
cd build && \
cmake ../Fast-RTPS/examples \
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=TRUE && \
cmake --build . --target install -j 16 && \
cd /opt && \
rm -rf build Fast-RTPS
Now the install-step output shows the correct runtime-path setting:
-- Installing: /usr/local/examples/C++/HelloWorldExample/HelloWorldExample
-- Set runtime path of "/usr/local/examples/C++/HelloWorldExample/HelloWorldExample" to "/usr/local/lib"

Cannot open shared object file libpng12.so.0

I am trying to run Quartus 13.0 in the following machine:
parrot 4.18.0-parrot10-amd64 #1 SMP Debian 4.18.10-1parrot10 (2018-10-06) x86_64 GNU/Linux.
I have finished installing Quartus 13.0 and when I try to execute it I get this error:
quartus: error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory
I have read all the related questions in stack overflow and other websites but no one worked for me.
When looking for that file, I found it. I have tried to do a hard link but it doesn't work either. Search results:
┌─[pepbd#parrot]─[~]
└──╼ $ls -ld $(locate -r libpng.*\.so.*)
lrwxrwxrwx 1 root root 19 nov 19 17:09 /usr/lib/x86_64-linux-gnu/libpng16.so.16 -> libpng16.so.16.34.0
-rw-r--r-- 1 root root 210864 jul 10 13:17 /usr/lib/x86_64-linux-gnu/libpng16.so.16.34.0
-rw-r--r-- 1 root root 18272 oct 14 21:59 /usr/lib/x86_64-linux-gnu/vlc/plugins/codec/libpng_plugin.so
I had the same problem with Quartus Prime 18 on Ubuntu. This worked for me (run as sudo):
wget -q -O /tmp/libpng12.deb http://mirrors.kernel.org/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1_amd64.deb \
&& dpkg -i /tmp/libpng12.deb \
&& rm /tmp/libpng12.deb

Why can't ld find libcurses.so even though it is in `/usr/lib` directory?

On Arch Linux, when I build something, ld complains can't find curses library:
/usr/bin/ld: cannot find -lcurses
collect2: error: ld returned 1 exit status
But my /usr/lib indeed contains curses related library:
# ls -lt /usr/lib/libcurse*
lrwxrwxrwx 1 root root 13 May 29 14:50 /usr/lib/libcurses.so -> libncurses.so
-rw-r--r-- 1 root root 18 May 29 14:50 /usr/lib/libcursesw.so
# ls -lt /usr/lib/libncurse*
-rw-r--r-- 1 root root 20 May 29 14:50 /usr/lib/libncurses++.so
lrwxrwxrwx 1 root root 18 May 29 14:50 /usr/lib/libncurses++w.so -> libncurses++w.so.6
lrwxrwxrwx 1 root root 20 May 29 14:50 /usr/lib/libncurses++w.so.6 -> libncurses++w.so.6.0
-rwxr-xr-x 1 root root 77264 May 29 14:50 /usr/lib/libncurses++w.so.6.0
-rw-r--r-- 1 root root 18 May 29 14:50 /usr/lib/libncurses.so
-rwxr-xr-x 1 root root 444776 May 29 14:50 /usr/lib/libncursesw.so.6.0
lrwxrwxrwx 1 root root 16 May 29 14:50 /usr/lib/libncursesw.so -> libncursesw.so.6
lrwxrwxrwx 1 root root 18 May 29 14:50 /usr/lib/libncursesw.so.6 -> libncursesw.so.6.0
We can see libcurses.so points to libncurses.so, and libncurses.so is like this:
# cat /usr/lib/libncurses.so
INPUT(-lncursesw)
I try to link -lncursesw directly, but there is still link error:
/usr/bin/ld: cannot find -lncursesw
collect2: error: ld returned 1 exit status
Why can't ld find libcurses.so even though it is in /usr/lib directory?
Update:
I am building bpftrace project, and the link error is as following:
[ 29%] Linking CXX executable bpftrace
cd /root/Project/bpftrace/build/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/bpftrace.dir/link.txt --verbose=1
/usr/bin/c++ -g -static -rdynamic CMakeFiles/bpftrace.dir/ast.cpp.o CMakeFiles/bpftrace.dir/attached_probe.cpp.o CMakeFiles/bpftrace.dir/bpftrace.cpp.o CMakeFiles/bpftrace.dir/codegen_llvm.cpp.o CMakeFiles/bpftrace.dir/driver.cpp.o CMakeFiles/bpftrace.dir/irbuilderbpf.cpp.o CMakeFiles/bpftrace.dir/main.cpp.o CMakeFiles/bpftrace.dir/map.cpp.o CMakeFiles/bpftrace.dir/mapkey.cpp.o CMakeFiles/bpftrace.dir/printer.cpp.o CMakeFiles/bpftrace.dir/printf.cpp.o CMakeFiles/bpftrace.dir/semantic_analyser.cpp.o CMakeFiles/bpftrace.dir/types.cpp.o -o bpftrace arch/libarch.a ../libparser.a /usr/lib/libLLVMBPFCodeGen.a /usr/lib/libLLVMipo.a /usr/lib/libLLVMIRReader.a /usr/lib/libLLVMMCJIT.a ../bcc-prefix/src/bcc-build/src/cc/libbpf.a ../bcc-prefix/src/bcc-build/src/cc/libbcc-loader-static.a ../bcc-prefix/src/bcc-build/src/cc/libbcc.a -lelf /usr/lib/libLLVMAsmPrinter.a /usr/lib/libLLVMDebugInfoCodeView.a /usr/lib/libLLVMDebugInfoMSF.a /usr/lib/libLLVMBPFDesc.a /usr/lib/libLLVMBPFAsmPrinter.a /usr/lib/libLLVMBPFInfo.a /usr/lib/libLLVMSelectionDAG.a /usr/lib/libLLVMCodeGen.a /usr/lib/libLLVMAsmParser.a /usr/lib/libLLVMBitWriter.a /usr/lib/libLLVMInstrumentation.a /usr/lib/libLLVMLinker.a /usr/lib/libLLVMScalarOpts.a /usr/lib/libLLVMInstCombine.a /usr/lib/libLLVMVectorize.a /usr/lib/libLLVMTransformUtils.a /usr/lib/libLLVMExecutionEngine.a /usr/lib/libLLVMTarget.a /usr/lib/libLLVMAnalysis.a /usr/lib/libLLVMProfileData.a /usr/lib/libLLVMRuntimeDyld.a /usr/lib/libLLVMObject.a /usr/lib/libLLVMBitReader.a /usr/lib/libLLVMCore.a /usr/lib/libLLVMMCParser.a /usr/lib/libLLVMMC.a /usr/lib/libLLVMSupport.a -lrt -ldl -lcurses -lpthread -lz -lm /usr/lib/libLLVMDemangle.a
/usr/lib/libLLVMSupport.a(DynamicLibrary.cpp.o): In function `llvm::sys::DynamicLibrary::getPermanentLibrary(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)':
(.text._ZN4llvm3sys14DynamicLibrary19getPermanentLibraryEPKcPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x6e): warning: Using 'dlopen' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
/usr/bin/ld: cannot find -lcurses
collect2: error: ld returned 1 exit status
I suppose your problem is here:
/usr/bin/c++ -g -static
you use -static, this mean:
On systems that support dynamic linking, this prevents linking with
the shared libraries. On other systems, this option has no effect.
So to successefull link you need libcurses**.a**, not .so

ncurses not found when trying to build vim

I am trying to build vim in my user dir after recently upgraded to Fedora 23
I have ncurses and ncurses-devel
[root#statquant-laptop lib]# dnf install ncurses
Last metadata expiration check performed 1:09:48 ago on Sat Jan 9 10:33:06 2016.
Package ncurses-5.9-21.20150214.fc23.x86_64 is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!
[root#statquant-laptop lib]# dnf install ncurses-devel
Last metadata expiration check performed 1:09:58 ago on Sat Jan 9 10:33:06 2016.
Package ncurses-devel-5.9-21.20150214.fc23.x86_64 is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!
Here is the proof:
[root#statquant-laptop lib]# ll /usr/lib/libncurs*
lrwxrwxrwx. 1 root root 17 Jun 17 2015 /usr/lib/libncurses.so.5 -> libncurses.so.5.9
lrwxrwxrwx. 1 root root 19 Jun 17 2015 /usr/lib/libncurses++.so.5 -> libncurses++.so.5.9
-rwxr-xr-x. 1 root root 154448 Jun 17 2015 /usr/lib/libncurses.so.5.9
-rwxr-xr-x. 1 root root 68176 Jun 17 2015 /usr/lib/libncurses++.so.5.9
lrwxrwxrwx. 1 root root 20 Jun 17 2015 /usr/lib/libncurses++w.so.5 -> libncurses++w.so.5.9
lrwxrwxrwx. 1 root root 18 Jun 17 2015 /usr/lib/libncursesw.so.5 -> libncursesw.so.5.9
-rwxr-xr-x. 1 root root 68176 Jun 17 2015 /usr/lib/libncurses++w.so.5.9
-rwxr-xr-x. 1 root root 216000 Jun 17 2015 /usr/lib/libncursesw.so.5.9
[root#statquant-laptop lib]# ll /usr/lib64/libncurs*
-rw-r--r--. 1 root root 330362 Jun 17 2015 /usr/lib64/libncurses.a
-rw-r--r--. 1 root root 183214 Jun 17 2015 /usr/lib64/libncurses++.a
-rw-r--r--. 1 root root 473398 Jun 17 2015 /usr/lib64/libncurses_g.a
-rw-r--r--. 1 root root 183214 Jun 17 2015 /usr/lib64/libncurses++_g.a
-rw-r--r--. 1 root root 31 Jun 17 2015 /usr/lib64/libncurses.so
lrwxrwxrwx. 1 root root 17 Jun 17 2015 /usr/lib64/libncurses++.so -> libncurses++.so.5
lrwxrwxrwx. 1 root root 17 Jun 17 2015 /usr/lib64/libncurses.so.5 -> libncurses.so.5.9
lrwxrwxrwx. 1 root root 19 Jun 17 2015 /usr/lib64/libncurses++.so.5 -> libncurses++.so.5.9
-rwxr-xr-x. 1 root root 155056 Jun 17 2015 /usr/lib64/libncurses.so.5.9
-rwxr-xr-x. 1 root root 76968 Jun 17 2015 /usr/lib64/libncurses++.so.5.9
-rw-r--r--. 1 root root 183214 Jun 17 2015 /usr/lib64/libncurses++w.a
-rw-r--r--. 1 root root 433400 Jun 17 2015 /usr/lib64/libncursesw.a
-rw-r--r--. 1 root root 183214 Jun 17 2015 /usr/lib64/libncurses++w_g.a
-rw-r--r--. 1 root root 593812 Jun 17 2015 /usr/lib64/libncursesw_g.a
lrwxrwxrwx. 1 root root 18 Jun 17 2015 /usr/lib64/libncurses++w.so -> libncurses++w.so.5
-rw-r--r--. 1 root root 32 Jun 17 2015 /usr/lib64/libncursesw.so
lrwxrwxrwx. 1 root root 20 Jun 17 2015 /usr/lib64/libncurses++w.so.5 -> libncurses++w.so.5.9
lrwxrwxrwx. 1 root root 18 Jun 17 2015 /usr/lib64/libncursesw.so.5 -> libncursesw.so.5.9
-rwxr-xr-x. 1 root root 76968 Jun 17 2015 /usr/lib64/libncurses++w.so.5.9
-rwxr-xr-x. 1 root root 208400 Jun 17 2015 /usr/lib64/libncursesw.so.5.9
When I run ./configure:
./configure --with-features=huge \
--enable-fail-if-missing \
--enable-luainterp=yes \
--enable-mzschemeinterp \
--enable-perlinterp \
--enable-pythoninterp=yes \
--with-python-config-dir=/usr/lib64/python2.7/config \
--enable-python3interp=yes \
--enable-tclinterp=yes \
--enable-rubyinterp=yes \
--enable-cscope \
--enable-multibyte \
--enable-gui=gtk2 \
--prefix=$HOME/Build/vim
I get
checking for tgetent in -lcurses... no
no terminal library found
checking for tgetent()... configure: error: NOT FOUND!
You need to install a terminal library; for example ncurses.
Or specify the name of the library with --with-tlib.
What can I do ?
I ran into the same issue on Fedora23. Here is my solution:
make sure you have ncurses-devel installed
CFLAGS=-fPIC ./configure --with-tlib=ncurses and your_options
I checked the config.log and found that gcc complained the lack of '-fPIC'
You apparently do not have the development package for ncurses installed. On Fedora23, that would be ncurses-devel, e.g., ncurses-devel-5.9-21.20150214.fc23.x86_64
Without that, you have only the runtime libraries (which are required).
Once you have that, the configuration for vim 7.4 would show something like this:
checking --with-tlib argument... empty: automatic terminal library selection
checking for tgetent in -ltinfo... yes
checking whether we talk terminfo... yes
checking what tgetent() returns for an unknown terminal... zero
checking whether termcap.h contains ospeed... yes
checking whether termcap.h contains UP, BC and PC... yes
checking whether tputs() uses outfuntype... no
Further reading:
how to install ncurses library in fedora?
RPM resource ncurses-devel

Resources