ld: error: unable to find library -lmysqlclient - freebsd

I am trying to compile my game program and it s giving me this
root#vps:/usr/src/Sursa/Server/source/game/src # gmake -j20
linking ../game
ld: error: unable to find library -lmysqlclient
c++: error: linker command failed with exit code 1 (use -v to see invocation)
gmake: *** [Makefile:228: ../game] Error 1
root#vps:/usr/src/Sursa/Server/source/game/src #
This is my Makefile path for library
# mysql
INCDIR += -I../../../extern/mysql
LIBDIR += -L/usr/local/lib/mysq
LIBS += -lmysqlclient -lz -pthread -lm -lssl -lcrypto
### END

You need to update your GCC compiler since some features of c++14 is not supported by gcc4.9.
You can search the available packages in FreeBSD using
pkg search <package_name>
and install whatever you want via
pkg install <package_name>
Note : you might need sudo before those commands if your current user is not root
Finally if you have problems such as
Fatal error : "some_file"."some_extension" file not found
you can search the package name via the aforementioned command and install them in order to compile successfully.
For example to mitigate the following error
fatal error: 'boost/intrusive_ptr.hpp' file not found
you can install the boost-libs package.

Related

Micronucleus does not update

I'm trying to upgrade my micronuclues to upload my code to digispark,but when I try to upgrade that happens:
Building command line tool: micronucleus...
gcc -Ilibrary -O -g -D LINUX -o micronucleus micronucleus.c micronucleus_lib.o littleWire_util.o -static -L/usr/lib/x86_64-linux-gnu -lusb
/usr/bin/ld: cannot find -lusb
collect2: error: ld returned 1 exit status
make: *** [Makefile:61: micronucleus] Error 1
I'm a little confused as to how you've gotten it compiling but not linking because, at least on Debian based distributions, the header file that would be needed during compiling is provided by the same package that provides the libusb.a that it is failing to link against.
If you are on a Debian based distro, try (re)installing libusb-dev:
sudo apt install libusb-dev
This is what I've built it against locally.
If you have a libusb.a and it's not in /usr/lib/x86_64-linux-gnu, then you'd need a different directory supplied to -L.

Installing Caffe on Linux Mint: /usr/bin/ld: cannot find -lhdf5_hl

Whenever I try installing caffe onto my linux mint machine, I keep getting this:
AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so.1.0.0
/usr/bin/ld: cannot find -lhdf5_hl
/usr/bin/ld: cannot find -lhdf5
collect2: error: ld returned 1 exit status
Makefile:572: recipe for target '.build_release/lib/libcaffe.so.1.0.0' failed
make: *** [.build_release/lib/libcaffe.so.1.0.0] Error 1
Do any of you know what I might be doing wrong? Thank you for responding.
If you build caffe using make + Makefile.config, add the location of libhdf5.so (can be retrieved by locate libhdf5.so), for example
/usr/lib/x86_64-linux-gnu/hdf5/serial, to LIBRARY_DIRS variable.
If you use cmake based build, add this path to LD_LIBRARY_PATH and run ldconfig:
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/hdf5/serial:$LD_LIBRARY_PATH
sudo ldconfig

error when trying to link libraries

I am trying to compile my c code on linux i386.
I have the sqlite3 library at:
/usr/lib/i386-linux-gnu/libsqlite3.so.0
/usr/lib/i386-linux-gnu/libsqlite3.so.0.8.6
but the linker does not find them. I even specified the path manually with the -L option which I suspect is not necessary:
cc -pthread -L/lib/i386-linux-gnu -L/usr/lib/i386-linux-gnu -L../i386/debug/lib/ ./bin/i386/debug/*.o -lsculib -lpthread -lsqlite3 -o ../i386/debug/bin/myProgram
/usr/bin/ld: cannot find -lsqlite3
collect2: error: ld returned 1 exit status
make: *** [../i386/debug/bin/core] Error 1
any ideas why it does not find them?
Presumably, you also need the header files.
$ sudo apt-get install libsqlite3-dev

Build sqlcipher on ubuntu

Hi I'm trying to build sqlcipher on ubuntu (11.10 minimal). On Mac OS X I had no problems though.
I followed the instructions from sqlcipher.net. First step was configure. I tried to execute configure with the following command:
./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto"
but I got the following error message: "configure: error: C compiler cannot create executables"
In the config.log some lines caught my eyes but I don't know how to fix it:
gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)
configure:2544: $? = 0
configure:2551: gcc -V >&5
gcc: error: unrecognized option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:2555: $? = 4
configure:2578: checking for C compiler default output file name
configure:2600: gcc -DSQLITE_HAS_CODEC -lcrypto conftest.c >&5
/usr/bin/ld: cannot find -lcrypto
collect2: ld returned 1 exit status
Has anybody successfully build sqlcipher on ubuntu yet? Regards
You will need to install the GNU compiler toolchain in order to build from source. Execute the following command in a terminal.
$ sudo apt-get install build-essential

Install kernlab package on R

I'm trying to install kernlab package on R, but I got a whole bunch of error messages, near the end it says:
g++ -shared -L/usr/local/lib64 -o kernlab.so brweight.o ctable.o cweight.o dbreakpt.o dcauchy.o dgpnrm.o dgpstep.o dprecond.o dprsrch.o dspcg.o dtron.o dtrpcg.o dtrqsol.o esa.o expdecayweight.o inductionsort.o kspectrumweight.o lcp.o misc.o msufsort.o solvebqp.o stringk.o stringkernel.o svm.o wkasailcp.o wmsufsort.o -L/usr/lib64/R/lib -lRlapack -L/usr/lib64/R/lib -lRblas -lgfortran -lm -L/usr/lib64/R/lib -lR
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: cannot find -lgfortran
collect2: ld returned 1 exit status
make: * [kernlab.so] Error 1
ERROR: compilation failed for package âkernlabâ
* removing â/usr/lib64/R/library/kernlabâ
The downloaded source packages are in
â/tmp/RtmpzLdUMp/downloaded_packagesâ
Updating HTML index of packages in '.Library'
Making packages.html ... done
Warning message:
In install.packages("kernlab") :
installation of package âkernlabâ had non-zero exit status
I suspect it has something to do gcc-fortran. I'm using SUSE 11 SP1, I have libgfortran43-4.3.4_20091019-47.1 installed, but i wasn't able to figure out how to install gcc-fortran with yast.
Any help is appreciated! Thanks!
I don't use SUSE but a little bit of searching suggests that you can get gcc-fortran from this page: http://software.opensuse.org/package/gcc-fortran

Resources