I'm getting following errors after running make command:
/usr/bin/ld: cannot find -lGLESv2
/usr/bin/ld: cannot find -lepoxy
/usr/bin/ld: cannot find -lEGL
/usr/bin/ld: cannot find -lGLESv2
/usr/bin/ld: cannot find -lepoxy
/usr/bin/ld: cannot find -lEGL
/usr/bin/ld: cannot find -lGLESv2
/usr/bin/ld: cannot find -lepoxy
/usr/bin/ld: cannot find -lEGL
/usr/bin/ld: cannot find -laio
/usr/bin/ld: cannot find -lcurl
/usr/bin/ld: cannot find -lssh2
/usr/bin/ld: cannot find -lncursesw
/usr/bin/ld: cannot find -lSDL
collect2: error: ld returned 1 exit status
main/CMakeFiles/esesc.dir/build.make:163: recipe for target 'main/esesc' failed
make[2]: *** [main/esesc] Error 1
CMakeFiles/Makefile2:1041: recipe for target 'main/CMakeFiles/esesc.dir/all' failed
make[1]: *** [main/CMakeFiles/esesc.dir/all] Error 2
Makefile:75: recipe for target 'all' failed
make: *** [all] Error 2
I have tried to search online in these links:
ld cannot find an existing library
usr/bin/ld: cannot find -l<nameOfTheLibrary>
Here I see that every library has to be linked symbolically with the existing library but I'm unsure of doing that. Can anyone please suggest me any technique for doing this?
I know locate <library> and ln commands. Now how to eliminate the above errors using this? Can anyone please elaborate on this? Thanks in advance.
it means you didn't install needed dependencies.
did you install at least libs from this manual? https://github.com/masc-ucsc/esesc/blob/master/docs/Usage.md
sudo apt-get install libepoxy0 libepoxy-dev
should remove epoxy warning, for example
Your link command probably needs a -L to precede those -l.
Search your system for those libnames, for example GLESv2.
I use "locate GLESv2". (Note: locate uses what "sudo updatedb" updates)
On my Unbuntu, the following lines are reported by locate.
> /usr/lib/x86_64-linux-gnu/libGLESv2.so
> /usr/lib/x86_64-linux-gnu/mesa-egl/libGLESv2.so
> /usr/lib/x86_64-linux-gnu/mesa-egl/libGLESv2.so.2
> /usr/lib/x86_64-linux-gnu/mesa-egl/libGLESv2.so.2.0.0
For the so (the shared object library) found in the first dir, you might try adding the following to your build command.
-L/usr/lib/x86_64-linux-gnu
And repeat for any library name not yet resolved.
Here is an example from my Makefile - note the relative path to a collection of libraries I wrote in a directory "bag"
R01: dtb_acs.cc
rm -f dtb_acs
g++ -m64 -O3 -ggdb -std=c++14 -Wall-Wextra -Wshadow -Wnon-virtual-dtor
-pedantic -Wcast-align -Wcast-qual -Wconversion -Wpointer-arith -Wunused
-Woverloaded-virtual
-O0 dtb_acs.cc -o dtb_acs
-L../../bag -lbag_i686 -lposix_i686 -lrt -pthread
^^^^^^^^^^^ three -l<libname> are in the -L dir
If needed (because the effort did not resolve anything), try adding -l and a specific library, such as -llibGLESv2.so (or .a, as the case may be)
Good luck.
Related
I install all the external directories required for ITPP compilation(cmake, Itpp-external, Itpp-4.3.0), but still currently facing an error as following:
administrator#ubuntu:~/Desktop/EEP_CC4B9_SBSD3B4_SP_DSTS_2$ make
`itpp-config --cflags`
g++ itpp_ctrl.o rsc_code.o Rayleigh.o irreg_conv_code.o punctured_nsc_code.o dsts.o conv_code.o puncturer.o sphere_packing.o rayleigh_channel.o fileser.o punctured_rsc_code.o softbit.o nsc_code.o robprob.o softsource.o repeater.o ITpp.o -o EEP_CC4B9_SBSD3B4_SP_DSTS.exe -l fftw3 -l lapack -l blas -litpp
/usr/bin/ld: cannot find -lfftw3
/usr/bin/ld: cannot find -llapack
/usr/bin/ld: cannot find -lblas
collect2: error: ld returned 1 exit status
Makefile:50: recipe for target 'EEP_CC4B9_SBSD3B4_SP_DSTS.exe' failed
make: *** [EEP_CC4B9_SBSD3B4_SP_DSTS.exe] Error 1
Install the external directories with Fortran compiler. Your response will be highly appreciated.
I am trying to build a project using Boost's Asio , but I am getting linking error:
g++ -o homework main.o -L/usr/lib64/qt-3.3/lib -L/usr/X11R6/lib64 -L/home/student/boost_1_46_1/libs -lboost_system -lqt-mt -lXext -lX11 -lm
/usr/bin/ld: cannot find -lboost_system
collect2: ld returned 1 exit status
make: *** [homework] Error 1
How can I resolve the problem?
I think it's a typo. You said -l boost_system in command line, while it should be -lboost_system.
Update:
Nope! I get my answer back. Just found that it's OK to pass -l <libname>. In fact it's equal to -l<libname>. As others said, double-check paths.
I built BerkleyDB successfully with the instructions found at:
http://www.linuxfromscratch.org/blfs/view/svn/server/db.html
I am trying to build Fix8 (fix8.org) on my CentOS 6.3 with a required dependency of BerkleyDB but I get a failed error:
libtool: link: g++ -g -O2 -Wall -rdynamic -o .libs/f8c f8c.o f8cutils.o f8precomp.o
-lrt /home/caustic/dev/dakka-fix8-b0a60e9/runtime/.libs/libfix8.so -lcrypt
-lPocoFoundation -lPocoNet -lPocoUtil -ltbb -L/home/caustic/dev/dakka-fix8-b0a60e9
/runtime -ldb_cxx -lz -Wl,-rpath -Wl,/usr/local/lib
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../..
/../libdb_cxx.so when searching for -ldb_cxx
/usr/bin/ld: skipping incompatible /usr/lib/libdb_cxx.so when searching for -ldb_cxx
/usr/bin/ld: cannot find -ldb_cxx
collect2: ld returned 1 exit status
make: *** [f8c] Error 1
When I "ls" the specified problem file, I get:
[root#hft x86_64-redhat-linux]# ls /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../.. /../libdb_cxx.so
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../libdb_cxx.so
[root#hft x86_64-redhat-linux]# ls -l /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../libdb_cxx.so
lrwxrwxrwx. 1 root root 16 Nov 23 17:36 /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../libdb_cxx.so -> libdb_cxx-5.3.so
I removed all older or conflicting instances of BerkleyDB using "yum remove". IS there any hints that can get me on track with this?
Thanks
Im having trouble using my make file for a program i am writing in a linux environment. The program is a fern fractal that uses bitmapImage.h and bitmapImage.so given to me by my professor. Whenever i attempt to run the make file i get a long string of errors, the main one being :
make
g++ -c -o fern.o fern.cpp
g++ -c -o fernType.o fernType.cpp
g++ -m32 -o fern fern.o fernType.o bitmapImage.so
/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6/libstdc++.a when searching for -lstdc++
/usr/bin/ld: cannot find -lstdc++
/usr/bin/ld: cannot find -lm
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: cannot find -lc
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6/libgcc_s.so when searching for -lgcc_s
/usr/bin/ld: cannot find -lgcc_s
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.6/libgcc.a when searching for -lgcc
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: cannot find crtn.o: No such file or directory
collect2: ld returned 1 exit status
make: *** [spiro] Error 1
my guess is that the bitmapImage.so is designed for a 32 bit system, but my virtual machine ubuntu runs 64-bit. How do i go about fixing this so i can compile my program? Thanks!
EDIT: updated my old post to show the current error i am getting
MakeFile:
# Make file for spirograph program
## note, uses bitmapImage shared object file (library).
OBJS = fern.o fernType.o
CC = g++ -m32
DEPS1 = fernType.h
DEPS2 = bitmapImage.h
all: spiro
spiro: $(OBJS)
$(CC) -m32 -o fern $(OBJS) bitmapImage.so
spiro.o: fern.cpp $(DEPS1)
$(CC) -m32 -c fern.cpp
spiroType.o: fernType.cpp $(DEPS1) $(DEPS2)
$(CC) -m32 -c fernType.cpp
# -----
# clean by removing object files.
clean:
rm $(OBJS)
Add the -m32 option to your compilation lines, that forces everything to be compiled for a 32-bit address space. (It will still run on a 64-bit system.)
Yes, that's exactly the problem -- you can't link a 32-bit object file with a 64-bit object file. You need to either:
Compile on a 32-bit machine (real or virtual),
Ask your professor for a 64-bit library, or
Ask for the source code to the library so you can compile it all yourself
Use file to see if, indeed, the shared lib is 32-bit.
If it is, you'll have to acquire a 64-bit copy of it somehow.
I am trying to compile in a way such that the exec links to gcc statically. I presumed running bjam link=static runtime-link=static should do the trick ?
When I tried that I get the following errors like :
...failed gcc.link TGT/bin/gcc-4.5.1/debug/link-static/runtime-link-static/datagen...
gcc.compile.c++ TGT/bin/gcc-4.5.1/release/link-static/runtime-link-static/base_data_gen.o
gcc.link TGT/bin/gcc-4.5.1/release/link-static/runtime-link-static/datagen
/usr/bin/ld: cannot find -lstdc++
/usr/bin/ld: cannot find -lm
/usr/bin/ld: cannot find -lc
collect2: ld returned 1 exit status
These don't come when I run bjam link=static.
Please advise ?
I belive that libstdc++ is intentionally not linked statically. Doing so is considered by many to be filled with peril (though I have not really heard a good reason). I do not think that there is a simple flag that you can add. For the gcc toolset you would add something like
-static-libgcc -Wl,-Bstatic -lstdc++
to your cxxflags for your build variant.