fatal error: 'google/protobuf/compiler/plugin.h' file not found - import

I'm compiling a Google protobuf plugin from these sources.
I've installed protobuf#2.5 with the homebrew command:
brew install protobuf#2.5
After installation I get the following error when trying to compile by calling make:
Richards-Mac-mini:protobuf-objc-arc richard$ make
/Applications/Xcode.app/Contents/Developer/usr/bin/make all-recursive
Making all in src/compiler
g++ -DHAVE_CONFIG_H -I. -I../.. -g -O2 -DNDEBUG -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.cc
main.cc:17:10: fatal error: 'google/protobuf/compiler/plugin.h' file not found
#include <google/protobuf/compiler/plugin.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [main.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
In particular, this line is interesting:
fatal error: 'google/protobuf/compiler/plugin.h' file not found
While I definitely able to go to this path and find the plugin.h file:
/usr/local/Cellar/protobuf#2.5/2.5.0/include/google/protobuf/compiler/plugin.h
Looks, like the library is not linked correctly with the binary and the issue is somehow related to the correct path.
When I try to issue a command which protoc, I get:
/usr/local/opt/protobuf#2.5/bin/protoc
protoc --version leads to the following output, which is expected.
libprotoc 2.5.0

Fixed by issuing the following commands:
brew link --force --overwrite protobuf250
Output:
Linking /usr/local/Cellar/protobuf#2.5/2.5.0... 14 symlinks created
If you need to have this software first in your PATH instead consider running:
echo 'export PATH="/usr/local/opt/protobuf#2.5/bin:$PATH"' >> ~/.bash_profile
And then:
echo 'export PATH="/usr/local/opt/protobuf#2.5/bin:$PATH"' >>
~/.bash_profile
After successful linking I was able to compile the Objective-C plugin without errors.

Related

How to install poppler correctly for pdftotext

When I try to build my docker-compose pdftotext seems to fail with this error:
Running setup.py install for pdftotext: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-ihm5qxa9/pdftotext/setup.py'"'"'; __file__='"'"'/tmp/pip-install-ihm5qxa9/pdftotext/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-wa_n7pgk/install-record.txt --single-version-externally-managed --compile
cwd: /tmp/pip-install-ihm5qxa9/pdftotext/
Complete output (14 lines):
WARNING: pkg-config not found--guessing at poppler version.
If the build fails, install pkg-config and try again.
running install
running build
running build_ext
building 'pdftotext' extension
creating build
creating build/temp.linux-x86_64-3.6
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPOPPLER_CPP_AT_LEAST_0_30_0=1 -I/usr/local/include/python3.6m -c pdftotext.cpp -o build/temp.linux-x86_64-3.6/pdftotext.o -Wall
pdftotext.cpp:3:10: fatal error: poppler/cpp/poppler-document.h: No such file or directory
#include <poppler/cpp/poppler-document.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
I've tested this on windows and linux with the same error. Has anyone found a fix for this?
Unfortunately, it is hard to help without knowing the content of your docker-compose/Dockerfile. But as mentioned in the error message, you are missing pkg-config. You should try to run apt-get install pkg-config.
You can also check my answer about how to use the latest version of the Poppler in the Docker.

sslscan.c:94:25: fatal error: openssl/err.h: No such file or directory compilation terminated. #163

I am need to install sslscan tool for ssl scanning (from here) in ubuntu virtual machine (virtualbox).
Following their installation instructions provided here, I installed openssl-chacha from here. Note that I am aware that this fork of openssl contains weak cipehrs (I use the tool and openssl for testing-scanning purposes not real application).
Then, after installing the above openssl, the first thing I did is executing: make. Note that it is unclear to me when to use these commands that he sslscan mentioned here (I did not execute them). But I want to use the chacha version of openssl:
apt-get install build-essential git zlib1g-dev
apt-get build-dep openssl
make static
When I try to run the command: make I get this error:
make: git: Command not found
cc -o sslscan -Wall -Wformat=2 -Wformat-security -pie -z relro -z now -L/usr/local/lib -L/usr/local/ssl/lib -L/usr/local/opt/openssl/lib -L/opt/local/lib -D_FORTIFY_SOURCE=2 -fstack-protector-all -fPIE -I/usr/local/include -I/usr/local/ssl/include -I/usr/local/ssl/include/openssl -I/usr/local/opt/openssl/include -I/opt/local/include -I/opt/local/include/openssl -DVERSION=\"1.11.11\" sslscan.c -lssl -lcrypto -ldl
/usr/bin/ld: /usr/local/ssl/lib/libssl.a(s2_clnt.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/local/ssl/lib/libssl.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:91: recipe for target 'sslscan' failed
make: *** [sslscan] Error 1
I am in this directory: /home/myuser/Downloads/sslscan-master
I made sure that openssl in:
/usr/local/ssl
Can you please point to me what is missing? I am not familiar with Linux system (Windows user) but I prefer to use the tool in Linux. So I will appreciate your help and patience.
make: git: Command not found
So start by installing the git command:
apt-get install git
(or maybe git-core)

Error installing postgis with brew

I'm having problems installing postgis using brew. I'm getting the following error(s):
==> Checking out http://svn.osgeo.org/postgis/trunk/
==> ./autogen.sh
==> ./configure --with-projdir=/usr/local --with-jsondir=/usr/local/opt/json-c --with-pgconfig=/usr/local/Cella
==> make
/bin/sh ../../libtool --mode=link clang -g -O2 -fno-common -DPIC -Wall -Wmissing-prototypes -I../rt_core -I../../liblwgeom -I/usr/local/include -I/usr/local/Cellar/gdal/1.11.1_3/include -I/usr/local/Cellar/geos/3.4.2/include ../rt_core/librtcore.a raster2pgsql.o ../../liblwgeom/liblwgeom.la -L/usr/local/Cellar/gdal/1.11.1_3/lib -lgdal -L/usr/local/Cellar/geos/3.4.2/lib -lgeos_c -liconv -lm -o raster2pgsql
libtool: link: cannot find the library `/usr/local/lib/libgeos_c.la' or unhandled argument `/usr/local/lib/libgeos_c.la'
make[2]: *** [raster2pgsql] Error 1
make[1]: *** [rtloader] Error 2
make: *** [all] Error 1
READ THIS: http://git.io/brew-troubleshooting
These open issues may also help:
Postgis sql files not found (https://github.com/Homebrew/homebrew/issues/26604)
I have looked at the suggested issues with no luck. I have also tried to remove and reinstall postgres. Has anyone experienced similar issue and found a solution?
The /usr/local/lib/libgeos_c.la is not ins this location. I have also tried reinstalling gdal and geos using brew.
Postgres.app comes with Postgis baked in. The Postgis folks even recommend it as the best way to get postgis on your mac. http://postgis.net/install/

End of file/pseudo-op errors compiling MongoDB with SSL

I'm currently using MongoDB on Ubuntu 13.10 x64 with the replica set functionality across 3 sites and have gotten to the stage where I need to enable SSL. This requires compiling it myself and sadly I have no prior experience of this which is causing me some headaches.
I'm trying to compile r2.4.9 following the procedure outlined here: http://www.mongodb.org/about/tutorial/build-mongodb-on-linux/
I have installed a ton of packages based on what I found scouring the web for related articles:
git-core build-essential scons devscripts lintian dh-make libpcre3 libpcre3-dev libboost-dev libboost-date-time-dev libboost-filesystem-dev libboost-program-options-dev libboost-system-dev libboost-thread-dev libpcap-dev libreadline-dev libssl-dev rng-tools
I also changed the SConstruct file to remove the CCFLAG -Werror to stop it failing immediately with so many [-Werror=unused-local-typedefs] as mentioned in this question.
The compilation process seems to get quite far but always fails at the same file dbclient_rs.cpp:
g++ -o build/linux2/ssl/mongo/client/dbclient_rs.o -c -Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -pipe -fno-builtin-memcmp -O3 -DBOOST_ALL_NO_LIB -D_SCONS -DMONGO_EXPOSE_MACROS -DSUPPORT_UTF8 -D_FILE_OFFSET_BITS=64 -DMONGO_SSL -DMONGO_HAVE_HEADER_UNISTD_H -DMONGO_HAVE_EXECINFO_BACKTRACE -Ibuild/linux2/ssl/third_party/libstemmer_c/include -Isrc/third_party/libstemmer_c/include -Ibuild/linux2/ssl/third_party/s2 -Isrc/third_party/s2 -Ibuild/linux2/ssl/third_party/boost -Isrc/third_party/boost -Ibuild/linux2/ssl/third_party/pcre-8.30 -Isrc/third_party/pcre-8.30 -Ibuild/linux2/ssl -Isrc -Ibuild/linux2/ssl/mongo -Isrc/mongo -Ibuild/linux2/ssl/third_party/s2 -Isrc/third_party/s2 -Ibuild/linux2/ssl/third_party/snappy -Isrc/third_party/snappy -Ibuild/linux2/ssl/third_party/v8/include -Isrc/third_party/v8/include src/mongo/client/dbclient_rs.cpp
(warning spam removed)
{standard input}: Assembler messages:
{standard input}:73382: Warning: end of file not at end of a line; newline inserted
{standard input}: Error: open CFI at the end of file; missing .cfi_endproc directive
g++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.8/README.Bugs> for instructions.
scons: *** [build/linux2/ssl/mongo/client/dbclient_rs.o] Error 4
scons: building terminated because of errors.
Note: I've also seen pseudo-op errors in the same place, but they were replaced by the above error when I removed the CCFLAG -w in favour of removing Werror instead.
Also just noticed when it starts up and does its checks the line Checking for C library rt... no - could this be a problem?
g++ version is 4.8.1, scons version is 2.3.0
Am I doing something unbelievably stupid here?
Many thanks.
Ok after more searching I found the an explanation of the problem here.
Seems to be related to not having enough RAM for the compilation process. I was running on a 512MB VPS. Worked fine after upgrading to 4GB (also removed the -pipe CCFLAG as suggested).

Netbeans 7.1.2 C/C++ MinGW build errors

I have installed Netbeans and MinGW to use as a C/C++ IDE but am failing to compile the provided samples in Netbeans. I'm getting the following build errors:
mkdir -p build/Debug/MinGW_1-Windows
rm -f build/Debug/MinGW_1-Windows/main.o.d
gcc.exe -c -g -MMD -MP -MF build/Debug/MinGW_1-Windows/main.o.d -o build/Debug/MinGW_1-Windows/main.o main.c
make[2]: *** [build/Debug/MinGW_1-Windows/main.o] Error 1
make[2]: Leaving directory `/c/Users/Momo/Documents/NetBeansProjects/Test2'
make[1]: Leaving directory `/c/Users/Momo/Documents/NetBeansProjects/Test2'
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 4s)