facing /usr/lib/libpcap.so: undefined reference to `pcap_lex' while running make command nprobe - libpcap

I am trying to install nprobe on my system when i followed the following steps
git clone https://github.com/xrl/nprobe.git
sudo apt-get install libpcap-dev
cd nprobe/plugsins
./buildMakefile.sh >Makefile.in
cd ..
./autogen.sh
./configure
make
all above commands run absolutely fine but when i try to run make its give me the following error.
usr/lib/libpcap.so: undefined reference to `pcap_lex'
collect2: ld returned 1 exit status

Yeah... we came across this with our netflow exporter. You need to have flex installed (the GNU implementation of UNIX lex). You'll probably also need to install bison, and I think it might use m4 too.

It seems that not only libpcap-devel need to be installed, but also libpcap.

Related

Installation of Transcriber (http://trans.sourceforge.net/en/install.php)

I am going around with no success in installing Transcriber in Ubuntu. Way very difficult :s
I follow all the steps the link above, but no way of passing this part of installing first the tcltk - ./configure --enable-gcc --enable-shared --prefix=/usr/local
make
It doesn't work and gives a bunch of errors. SO I decided to search and do as here, to install tcltk - Install TCL/TK without root
So I tried the code but it didn't work again, starting here sudo ./configure --prefix=/opt/tcltk
It was saying I had no permissions in opt so I found a way to create a tcltk folder, fine, but when I put the sudo it comes:
checking whether to use symlinks for manpages... no
checking whether to compress the manpages... no
checking whether to add a package name suffix for the manpages... no
checking for gcc... no
checking for cc... no
checking for cc... no
checking for cl... no
configure: error: no acceptable C compiler found in $PATH
Seeconfig.log' for more details.
`
I am tired of this guys, if you could please help me to install this I would be very thankful. I understand not that much of ubuntu. Thank you!
You can't compile without a compiler (and linker). They're usually not very happy about being installed in user directories.
sudo apt install build-essential
Alternatively, if you're just wanting to run Tcl code without installing, you can use KitCreator to get your own single-file executable. (Yes, that site will build one for you While-U-Wait. The guy who wrote it isn't big on fancy CSS, even more so than me, but he does make good technology deployments.) There are other options too, but they're either older or less easy to use without being able to install compilers and so on.

Cross-compile Qt5 (Mingw) with MySQL driver issue

I tried a lot of things I read on documentations or tutorials... But I still can't cross-compile Qt with the MySQL library driver. Story begins:
I have to cross-compile Qt from Linux to Windows (32bits) using MinGW (i686-w64-mingw32- prefix to be precise). I downloaded qtbase-opensource-src-5.9.4 and started to work like that:
$ ./configure -prefix [...]/qt-5.9.4 -xplatform win32-g++ -device-option CROSS_COMPILE=/usr/bin/i686-w64-mingw32- -opengl desktop -no-sql-odbc -sql-sqlite -enable-shared -nomake examples -nomake tests -release
And it worked. Then, make and make install worked too. But I figured out that there was only the SQLite ".dll" in the plugins/sqldrivers repository. So I tried to compile the MySQL driver and... How can I do that?? If I add -sql-mysql to my ./configure ... call, I have to following error:
ERROR: Feature 'sql-mysql' was enabled, but the pre-condition 'libs.mysql' failed.
I downloaded MySQL library from the official website to get mysql-5.7.21-win32.zip. But how to link it with qtbase sources? Adding MYSQL_INCDIR=[...]/mysql-5.7.21-win32/include and MYSQL_LIBDIR=[...]/mysql-5.7.21-win32/lib or just MYSQL_PREFIX=[...]/mysql-5.7.21-win32 to my ./configure ... command results to the same error message.
Any idea please?
EDIT:
I tried to compile the driver like that (with the qmake I built previously):
$ cd qtbase-opensource-src-5.9.4/src/plugins/sqldrivers/mysql
$ [/*prefix of my previous build*/]/qt-5.9.4/bin/qmake .
And the result is:
Project ERROR: Library 'mysql' is not defined.
Ok everyone, I found the solution: do a clean checkout or add -recheck-all to the ./configure command when you want to add a lib like MySQL in my case. Easy isn't it? To make it clear, here is the command I used:
./configure -prefix [...] -xplatform win32-g++ -device-option CROSS_COMPILE=/usr/bin/i686-w64-mingw32- -opengl desktop -no-sql-odbc -sql-sqlite -plugin-sql-mysql MYSQL_PREFIX=[...] -enable-shared -nomake examples -nomake tests -release -recheck-all
That was just a refresh problem, but I prefer to let this answer because it's pretty hard to realize.
Instead of what you tried in your EDIT, should I think be:
$ cd qtbase-opensource-src-5.9.4/src/plugins/sqldrivers
qmake -- MYSQL_PREFIX= [...]/mysql-5.7.21-win32/include

"/usr/bin/ld: cannot find -lopenblas" error in Caffe compilation

When I was compiling Caffe, I had this error, despite OpenBLAS is installed:
AR -o .build_release/lib/libcaffe.a
LD -o .build_release/lib/libcaffe.so
/usr/bin/ld: cannot find -lopenblas
collect2: ld devolvió el estado de salida 1
make: *** [.build_release/lib/libcaffe.so] Error 1
Is there a solution for it?
Including the base packs even after cloning OpenBlas and making will link the appropriate libraries in 14.04 and 16.
apt install liblapack-dev liblapack3 libopenblas-base libopenblas-dev
apt install liblapack-dev liblapack3 libopenblas-base libopenblas-dev
I faced the same problem. Even adding library directory "/opt/OpenBLAS/lib/" to ldconfig cache didn't help (as my libopenblas.so is at "/opt/OpenBLAS/lib/libopenblas.so").
Using cmake helped me. Try this from caffe root directory:
mkdir build
cd build
cmake -DBLAS=open ..
make all
make runtest
If you need to use make, add the symlink of libopenblas.so to /usr/lib. I did the following:
ln -s /opt/OpenBLAS/lib/libopenblas.so /usr/lib/libopenblas.so
I saw the similar problem (I'm compiling caffe again for some reason).
I found the library file the builder is looking for (-lcblas or -latlas means libcblas.so and libatlas.so) are under /usr/lib64/atlas. So just added symbolic links under /usr/lib64 like this.
sudo ln /usr/lib64/atlas/libcblas.so.3.0 /usr/lib64/libcblas.so
sudo ln -s /usr/lib64/atlas/libatlas.so.3.0 /usr/lib64/libatlas.so
But I guess more proper method is to set Makefile.config (the CBLAS path). (I thought the default path will do away with it reading the comment saying so, but it did not.) Hope this helps anyone.

Mac Homebrew own Package, link error: No such keg

I am currently using the Macbook pro with OS 10.9.
And I was trying to install octave to my mac when I found that I have to install gnuplot before I could use the plot in the octave. So I try to install gnuplot using the homebrew. However,the brew got stuck when trying to install the gd, because China's network fails to link to the site https://bitbucket.org/libgd/gd-libgd/downloads/libgd-2.1.0.tar.gz
So I use goagent to download the package via chrome and try to manually install the package and try to link it using brew by the instruction from https://github.com/mxcl/homebrew/wiki/FAQ
And after make install, when I try to use:
brew link libgd
the brew prompt error message:
Error: No such keg: /usr/local/Cellar/libgd
And I followed exactly the process in the FAQ diy.
$ tar -xvf l-ibgd-2.1.0.tar.gz
[snip]
$ cd libgd-2.1.0
$ brew diy
-DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/libgd/2.1.0
$ ./configure --prefix=/usr/local/Cellar/libgd/2.1.0
[snip]
$ make && make install
[snip]
$ brew link libgd
Error: No such keg: /usr/local/Cellar/libgd
The configuration and installation are without any error. Any suggestions? Thx a lot!
There are several things wrong here, and I'm not sure whether they are Homebrew bugs or incomplete transcription on your part.
First, the package is called gd, not libgd, so there would be /usr/local/Cellar/gd, not /usr/local/Cellar/libgd.
Second, brew diy appears to suggest a cmake invocation, but gd uses autotools, so that is wrong.
Ultimately, this should work if you string it all together correctly, but actually, if you have problems with reaching a mirror over http, I would just put the tarball somewhere else and edit the formula file (brew edit gd) to point to that new location. Much easier, and you can even save your modification in a local Git branch.

Automatically install build dependencies prior to building an RPM package

I am trying to build a .rpm package. I have just followed the steps to do that. Till now all steps were gone fine but now i just stuck with this step. I just ran the following command and got this error:
rpmbuild -ba asterisk.spec
error: Failed build dependencies:
gtk2-devel is needed by asterisk-1.8.12.2-1.fc15.x86_64
libsrtp-devel is needed by asterisk-1.8.12.2-1.fc15.x86_64
[... more ...]
freetds-devel is needed by asterisk-1.8.12.2-1.fc15.x86_64
uw-imap-devel is needed by asterisk-1.8.12.2-1.fc15.x86_64
I am using fedora-15. How to resolve this error?
How I do install all depencencies during installation of src.rpm package. Is it possible?
You can use the yum-builddep command from the yum-utils package to install all the build dependencies for a package.
The arguments can either be paths to spec files, paths to source RPMs or the names of packages which exist as source RPMs in a configured repository, for example:
yum-builddep my-package.spec
or
yum-builddep my-package.src.rpm
The same thing can be achieved on newer versions of Fedora that use dnf as their package manager by making sure that dnf-plugins-core is installed and then doing:
dnf builddep my-package.spec
or
dnf builddep my-package.src.rpm
yum-builddep doesn't seem to work if the mirror you use doesn't serve source RPMs. This may not handle all cases, but it usually works for me:
sudo yum install -y $(<rpmbuild> | fgrep 'is needed by' | awk '{print $1}')
where <rpmbuild> is your rpmbuild command (e.g., rpmbuild -ba foo.spec).
On PHP building - especially phpbrew I used dnf builddep php, it worked.