Apps cannot detect C++ poco even though I have installed it - c++

I want to be able to make and run this particular library on my computer. Currently going through the INSTALL file. I am currently at the point:
After extracting the Poco (Complete Edition) source archive, the configure
script should be called with the following parameters:
./configure --omit=Crypto,Net,NetSSL_OpenSSL,Data/ODBC,Data/MySQL \
--no-tests --no-samples
This line avoids building the parts of Poco which are dependent on third-party
libraries, and are not required for openBliSSART.
You can also specify a prefix where Poco should be installed, but in most cases
you should leave the default /usr/local.
I can't seem to run the options, so I simply ran ./configure, this seemed to have worked till the point where I encountered:
checking for fftw_plan_dft_r2c_1d in -lfftw3... yes
checking for Poco (Enterprise)... no
configure: error: Need Poco Enterprise v1.3.6+!
But the fact is, that I have installed Poco already on the system through a brew install poco and downloaded the library from their source website and compiled it ground up. looking back at INSTALL:
Depending on where you have installed Poco, you may have to set the
LD_LIBRARY_PATH environment variable to contain the Poco "lib" directory,
or run the ldconfig tool. The following lines work with Ubuntu and openSUSE
($ indicates the shell prompt):
$ sudo sh -c 'echo <prefix>/lib > /etc/ld.so.conf.d/poco.conf'
$ sudo ldconfig
where <prefix> is the Poco install prefix (by default /usr/local).
Now when I do a simple sudo find / -name poco, I get:
/usr/local/var/homebrew/linked/poco
/usr/local/opt/poco
/usr/local/Cellar/poco
find: /private/var/db/ConfigurationProfiles/Store: Operation not permitted
find: /private/var/folders/pq/xchc5hxj02d754txf8nml5f00000gn/0/SafariFamily: Operation not permitted
find: /private/var/folders/pq/xchc5hxj02d754txf8nml5f00000gn/0/com.apple.LaunchServices.dv: Operation not permitted
find: /private/var/folders/pq/xchc5hxj02d754txf8nml5f00000gn/0/com.apple.nsurlsessiond: Operation not permitted
find: /private/var/folders/pq/xchc5hxj02d754txf8nml5f00000gn/0/com.apple.routined: Operation not permitted
find: /private/var/folders/zz/zyxvpxvq6csfxvn_n00000y800007k/0/com.apple.nsurlsessiond: Operation not permitted
find: /private/var/folders/zz/zyxvpxvq6csfxvn_n00000s4000069/0/com.apple.nsurlsessiond: Operation not permitted
find: /private/var/folders/zz/zyxvpxvq6csfxvn_n00000s4000069/0/com.apple.routined: Operation not permitted
/Users/sharanduggirala/Library/Logs/Homebrew/poco
/Users/sharanduggirala/Documents/of_v0.9.8_osx_release/libs/poco
/Users/sharanduggirala/Documents/of_v0.9.8_osx_release/scripts/apothecary/formulas/poco
find: /dev/fd/3: Not a directory
find: /dev/fd/4: Not a directory
Also, it looks like while building poco, I did a ./configure --static. Would this have affected my compilation? How do I link this library?
I have already used the command ./configure --with-poco-prefix=/usr/local/opt/poco which doesn't really change anything.
Notes relating to S.M.'s Answer
I tried this, but got the error:
brew install poco --with-static ⏎
==> Downloading https://pocoproject.org/releases/poco-1.9.0/poco-1.9.0-all.tar.gz
######################################################################## 100.0%
Error: SHA256 mismatch
Expected: 028de410fc78d5f9b1ff400e93ec3d59b9e55a0cbbf0d8fec04636882b72ea45
Actual: 0387bf0f9d313e2311742e1ad0b64e07f2f3e76039eed20e3b9aa9951b88e187
Archive: /Users/sharanduggirala/Library/Caches/Homebrew/poco-1.9.0.tar.gz
To retry an incomplete download, remove the file above.
I also tried:
./configure --static ⏎
configure: error: unrecognized option: `--static'
Try `./configure --help' for more information

Do not install poco from sources. Use brew install poco. If you want the same like ./configure --static use brew install poco --with-static.

Related

Running configure file in MinGW64: default build_alias command and default prefix not found

I'm using MinGW64 via an MSYS2 download and am currently trying to install the Solar Geometry 2 library (http://www.oie.mines-paristech.fr/Valorisation/Outils/Solar-Geometry/) for use. I'm following their install README, which states to navigate to the directory and "configure" (I've been typing "./configure". However, when I do so, I get the following message in my terminal:
$ ./configure
configure: loading site script /mingw64/etc/config.site
/mingw64/etc/config.site: line 13: config.site:13: default build_alias set to x6_64-w64-mingw32: command not found
/mingw64/etc/config.site: line 20: config.site:20: default prefix set to /mingw4: No such file or directory
configure: error: cannot find install-sh or install.sh in . ./.. ./../..
When I initially installed MSYS2 I set up the etc/fstab file as recommended. However, I'm quite new to MSYS so I'm assuming I botched something in my setup. I haven't edited anything in the config.site file mentioned in the errors, so I'm wondering if it's something in there.
Any help is greatly appreciated, thank you
No where in the directions for "Solar Geometry" do I see reference to MSys or MSys2.
I suggest you install the compiler toolchain and base development file. No idea if you editing /etc/fstab will cause problems. I do not normmaly edit it!
Install MinGW Package build packages. You might need more packages installed.
pacman -S --needed base-devel mingw-w64-x86_64-toolchain

ICU library build error (telegram-desktop for debian-jessie)

I'm trying to build telegram-desktop on RPi 3 (debian-jessie) following this guide. I encuntered this error involving ICU library, so that I've done the following steps:
downloaded ICU 58.1 sorce file
decompressed in ~/ and configured with ./configure
commented out the LDFLAGSICUDT flag in ~/icu/source/config/mh-linux as described in another StackOverflow question
sudo make and make check (fine)
sudo make install
At this point it is prescribed in the above answer "to make a symbolic link from /usr/local/libicuXXX.a to /usr/lib/libicuXXX.a". I guess I have to run
sudo ln -s /usr/local/libicutu.a /usr/lib/libicutu.a
(it's right?) but the problem is that I can't find /usr/local/lib/libicutu.a!

omz_urlencode:42: -regex-match not available for regex

Okay so i'm trying to install Homebrew, so that I can I can install nodejs and npm. However I'm using this command from brew.sh;
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Once I install Homebrew It keeps returning this error
It appears Homebrew is already installed. If your intent is to reinstall you
should do the following before running this installer again:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
The current contents of /usr/local are bin CODEOFCONDUCT.md etc lib libexec Library LICENSE.txt README.md sbin share .git .github .gitignore
omz_urlencode:42: failed to load module `zsh/regex': dlopen(/usr/local/Cellar/zsh/5.2/lib/zsh/regex.so, 9): image not found
omz_urlencode:42: -regex-match not available for regex'
I honestly have no idea what's happening here. I'm not sure If I have to symlink Homebrew up or what. But I have tried everything I know so far (which isn't much). If anyone could be kind enough to give me instructions as what too look for to solve the issue, I'm all ears.
Thank you for listening!
It seems it's a bug that have been corrected in recent version of OMZ, you should update it.
You get the output:
zsh: command not found: homebrew
Because homebrew is not a command. Try brew -v instead.
To resolve:
Warning: node-5.10.1 already installed, it's just not linked
Use brew link node
Okay so I think I have made some progress, It may have been for some weird reason I didn't have permission writes to run the 'brew link < package > ' so i ran the following command:
'sudo chown -R /usr/local/share/systemtap/tapset && brew doctor'
Once I ran 'brew link node' it successfully created 7 symlinks for the node directory on the following path;
'Linking /usr/local/Cellar/node/5.10.1... 7 symlinks created'
However, when I installed live-server via npm; I typed 'live-server -v' and it again returned 'zsh: command not found: live-server'. In addition to this it keeps telling me I have 'unbrewed dylibs':
Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected dylibs:
/usr/local/lib/libociei.dylib
So im still unsure what the exact issue is.
P.S. Apologies for not posting this correctly, as im trying to see where I can seperate it into commands like you corrected in the first post, if you could link me to a post where it tells me how to use it properly i'll be more than happy to read it.
Thanks,

Protobuf 3.0.0-alpha-1 not compiling on windows

I'm trying to compile protobuf 3.0.0 alpha 1 on Windows using MinGW 4.9.2 & MSYS.
According to the instructions I'm supposed to:
./configure
make
make check
make install
I added --prefix=/c/path/to/mingw to configure (How to build Google's protobuf in Windows using MinGW?) but it didnt help.
It fails at make with the message:
CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /home/Markus/protobuf-3.0.0-alpha-
1/missing aclocal-1.14 -I m4
/home/Markus/protobuf-3.0.0-alpha-1/missing: line 81: aclocal-1.14: command not
found
WARNING: 'aclocal-1.14' is missing on your system.
You should only need it if you modified 'acinclude.m4' or
'configure.ac' or m4 files included by 'configure.ac'.
The 'aclocal' program is part of the GNU Automake package:
<http://www.gnu.org/software/automake>
It also requires GNU Autoconf, GNU m4 and Perl in order to run:
<http://www.gnu.org/software/autoconf>
<http://www.gnu.org/software/m4/>
<http://www.perl.org/>
make: *** [aclocal.m4] Error 127
I've tried installing Automake but it doesnt come with aclocal.
Also today at work i managed to get it working on the first try with a bare MinGW & MSYS.
It looks like you need to install autoconf (which is separate from automake, though they are often used together). You may also need to install libtool.

How do I install and build against OpenSSL 1.0.0 on Ubuntu?

You can consider this a follow-up question to How do I install the OpenSSL C++ library on Ubuntu?
I'm trying to build some code on Ubuntu 10.04 LTS that requires OpenSSL 1.0.0.
Ubuntu 10.04 LTS comes with OpenSSL 0.9.8k:
$ openssl version
OpenSSL 0.9.8k 25 Mar 2009
So after running sudo apt-get install libssl-dev and building, running ldd confirms I've linked in 0.9.8:
$ ldd foo
...
libssl.so.0.9.8 => /lib/i686/cmov/libssl.so.0.9.8 (0x00110000)
...
libcrypto.so.0.9.8 => /lib/i686/cmov/libcrypto.so.0.9.8 (0x002b0000)
...
How do I install OpenSSL 1.0.0 and the 1.0.0 development package?
Update: I'm writing this update after reading SB's answer (but before trying it), because it's clear I need to explain that the obvious solution of downloading and installing OpenSSL 1.0.0 doesn't work:
After successfully doing the following (recommended in the INSTALL file):
$ ./config
$ make
$ make test
$ make install
...I still get:
OpenSSL 0.9.8k 25 Mar 2009
...and:
$ sudo apt-get install libssl-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
libssl-dev is already the newest version.
The following packages were automatically installed and are no longer required:
linux-headers-2.6.32-21 linux-headers-2.6.32-21-generic
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
...and (just to make sure) after rebuilding my code, ldd still returns the same thing.
Update #2: I added the "-I/usr/local/ssl/include" and "-L/usr/local/ssl/lib" options (suggested by SB) to my makefile, but I'm now getting a bunch of undefine reference compile errors, for example:
/home/dspitzer/foo/foo.cpp:86: undefined reference to `BIO_f_base64'
/home/dspitzer/foo/foo.cpp:86: undefined reference to `BIO_new'
/usr/local/ssl/include/ contains only an openssl directory (which contains numerous .h files), so I also tried "-I/usr/local/ssl/include/openssl" but got the same errors.
Update #3: I tried changing the OpenSSL includes from (for example):
#include <openssl/bio.h>
...to:
#include "openssl/bio.h"
...in the .cpp source file but still get the same undefined reference errors.
Update #4: I now realize those undefined reference errors are linker errors. If I remove the "-L/usr/local/ssl/lib" from my Makefile, I don't get the errors (but it links to OpenSSL 0.9.8). The contents of /usr/local/ssl/lib/ are:
$ ls /usr/local/ssl/lib/
engines libcrypto.a libssl.a pkgconfig
I added -lcrypto, and the errors went away.
Get the 1.0.0a source from here.
# tar -xf openssl-1.0.0a.tar.gz
# cd openssl-1.0.0a
# ./config
# sudo make install
Note: if you have man pages build errors on modern systems, use make install_sw instead of make install.
This puts it in /usr/local/ssl by default
When you build, you need to tell gcc to look for the headers in /usr/local/ssl/include and link with libs in /usr/local/ssl/lib. You can specify this by doing something like:
gcc test.c -o test -I/usr/local/ssl/include -L/usr/local/ssl/lib -lssl -lcrypto
EDIT DO NOT overwrite any system libraries. It's best to keep new libs in /usr/local. Overwriting Ubuntu defaults can be hazardous to your health and break your system.
Additionally, I was wrong about the paths as I just tried this in Ubuntu 10.04 VM. Fixed.
Note, there is no need to change LD_LIBRARY_PATH since the openssl libs you link against by default are static libs (at least by default - there might be a way to configure them as dynamic libs in the ./config step)
You may need to link against libcrypto because you are using some calls that are built and defined in the libcrypto package. Openssl 1.0.0 actually builds two libraries, libcrypto and libssl.
EDIT 2 Added -lcrypto to gcc line.
Instead of:
$ ./config
$ make
$ make test
$ make install
Do:
$ sudo ./config --prefix=/usr
$ sudo make
$ sudo make test
$ sudo make install
This will help you update to openssl 1.0.1g to patch for CVE-2014-0160 (Heartbleed).
OpenSSL Security Advisory [07 Apr 2014]
TLS heartbeat read overrun (CVE-2014-0160)
A missing bounds check in the handling of the TLS heartbeat extension can be
used to reveal up to 64k of memory to a connected client or server.
Only 1.0.1 and 1.0.2-beta releases of OpenSSL are affected including
1.0.1f and 1.0.2-beta1.
Thanks for Neel Mehta of Google Security for discovering this bug and to
Adam Langley and Bodo Moeller for
preparing the fix.
Affected users should upgrade to OpenSSL 1.0.1g. Users unable to immediately
upgrade can alternatively recompile OpenSSL with -DOPENSSL_NO_HEARTBEATS.
1.0.2 will be fixed in 1.0.2-beta2.
Source: https://www.openssl.org/news/secadv_20140407.txt
Here's what solved it for me:
Upgrade latest version OpenSSL on Ubuntu
Transcribing the main information:
Download the OpenSSL v1.0.0g source:
$ wget http://www.openssl.org/source/openssl-1.0.0g.tar.gz
Unpack the archive and install:
$ tar xzvf openssl-1.0.0g.tar.gz
$ cd openssl-1.0.0g
$ ./config
$ make
$ make test
$ sudo make install
All files, including binaries and man pages are install under the directory /usr/local/ssl. To ensure users use this version of OpenSSL instead of the previous version you must update the paths for man pages and binaries.
Edit the file /etc/manpath.config adding the following line before the first MANPATH_MAP:
MANPATH_MAP /usr/local/ssl/bin /usr/local/ssl/man
Update the man database (I honestly can't remember and don't know for sure if this command was necessary - maybe try without it and at the end when testing if the man pages are still the old versions come back and run mandb):
sudo mandb
Edit the file /etc/environment and insert the path for OpenSSL binaries (/usr/local/ssl/bin) before the path for Ubuntu's version of OpenSSL (/usr/bin). My environment file looks like this:
PATH="/usr/local/sbin:/usr/local/bin:/usr/local/ssl/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
Logout and login and test:
$ openssl version
OpenSSL 1.0.0g 18 Jan 2012
Also test the man pages by running man openssl and at the very bottom in the left hand corner it should report 1.0.0g.
Note that although the users will now automatically use the new version of OpenSSL, existing programs (e.g. Apache) may not as they are linked against the libraries from the Ubuntu version.