Errors adding external lib in eclipse - c++

I want to add an external library in eclipse,this how i proceed:
Projet/Properties/C++ Build/Gcc Linkers/libraries/,
-l /home/Jackie/CodingPackages/SB5/Src/GLTools/include/ and
-L /home/Jackie/CodingPackages/SB5/Src/GLTools/src/
this is the errors i got :
make all
Building target: Chap1
Invoking: GCC C++ Linker
g++ -L/home/prince/CodingPackages/SB5/Src/GLTools/src/ -o"Chap1" ./main.o -lglut -l/home/Jackie/CodingPackages/SB5/Src/GLTools/include/ -lGLU -lGL
/usr/bin/ld: fatal error: /home/Jackie/CodingPackages/SB5/Src/GLTools/include/: mmap offset 0 size 4096 failed: No such device
collect2: ld returned 1 exit status

Include directories are specified with -I (capital i)

Related

ITpp ld cannot find -lfftw3 -llapack and -lblas

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.

error in compilation with ld : __stack_chk_guard##GLIBC_2.17

I am compiling some files on the odroidC2 board (armv8-64bit) running Ubuntu 16.04.1, and I got the following error:
odroid#odroid64:~/flext-master/tutorial/simple1$ g++ -fPIC -L/usr/lib -pthread -shared -Wl,-S -L/usr/local/src/pd/bin -L/usr/local/lib -o pd-linux/release-single/simple1.pd_linux pd-linux/release-single/main.opp -lflext-pd_s
/usr/bin/ld: /usr/local/lib/libflext-pd_s.a(libflext_pd_s_la-flxlet.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against external symbol `__stack_chk_guard##GLIBC_2.17' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /usr/local/lib/libflext-pd_s.a(libflext_pd_s_la-flxlet.o)(.text+0x344): unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol `__stack_chk_guard##GLIBC_2.17'
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
As you can see the -fPIC option is present. So I don't understand why the compiler suggest to "recompile with -fPIC". Any Idea?
The problem is not in the pd-linux/release-single/main.opp (BTW, maybe .cpp?) that you're compiling with -fPIC, but in the libflext-pd_s.a archive that contains an object libflext_pd_s_la-flxlet.o which is not compiled with -fPIC, so you need to recompile flext library properly.

/usr/bin/ld: cannot find -lboost_thread-mt

I am trying to link a project with the following command:
g++ build/test.o -o bin/test -pthread -L lib -L /home/alexander/opt/lib -lboost_thread-mt
which results in the following errors:
/usr/bin/ld: cannot find -lboost_thread-mt
collect2: error: ld returned 1 exit status
However, the boost libraries are installed in the directory /home/alexander/opt/lib. Why does the linker do not find the boost libraries? I also tried to link with -I instead if -L with the same outcome...
Content of /home/alexander/opt/lib is /home/alexander/opt/lib/boost_1_57_0.
change libboost_thread-mt to libboost_thread, first find the address of libboost_thread.so and libboost_thread.a then make softlinks to these files in the same address,
so it should be:
ln -s /...libboostSourceFiles.../libboost_thread.so /..RequestTOmtFiles.../libboost_thread-mt.so
it works for other libboost -mt files too, like serialization , iostreams, programoptions

link to boost library

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.

Messed up Berkeley DB error message with C++ build of Fix8 in CentOS Linux

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