Protocol buffers version error when trying to make Mosh source code - makefile

I've been trying to install Mosh (the mobile shell) on the following system:
[ptedder#ukch-dev-lndt03 mosh-1.2.4]$ cat /etc/*-release
CentOS release 5.3 (Final)
It configures okay, however when I try and make Mosh 1.2.4 (or 1.2.0) I get the following error:
make all-recursive
make[1]: Entering directory `/home/ptedder/bin/mosh-1.2.4'
Making all in src
make[2]: Entering directory `/home/ptedder/bin/mosh-1.2.4/src'
Making all in protobufs
make[3]: Entering directory `/home/ptedder/bin/mosh-1.2.4/src/protobufs'
make all-am
make[4]: Entering directory `/home/ptedder/bin/mosh-1.2.4/src/protobufs'
CXX userinput.pb.o
In file included from userinput.pb.cc:5:
userinput.pb.h:12:2: error: #error This file was generated by a newer version of protoc which is
userinput.pb.h:13:2: error: #error incompatible with your Protocol Buffer headers. Please update
userinput.pb.h:14:2: error: #error your headers.
make[4]: *** [userinput.pb.o] Error 1
make[4]: Leaving directory `/home/ptedder/bin/mosh-1.2.4/src/protobufs'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/home/ptedder/bin/mosh-1.2.4/src/protobufs'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/ptedder/bin/mosh-1.2.4/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/ptedder/bin/mosh-1.2.4'
make: *** [all] Error 2
This was with Protocol buffers version 2.4.1 (suggested it might be hardcoded into mosh here #import <string> in ios? Protobuf c++ in ios) but I've tried using Protocol buffers version 2.3.0 and 2.5.0 as well and they all give the following error:
"This file was generated by a newer version of protoc which is
userinput.pb.h:13:2: error: #error incompatible with your Protocol Buffer headers. Please update
userinput.pb.h:14:2: error: #error your headers."
any ideas?

Two years after this question was asked, I still couldn't find a good solution. I had the same problem, and eventually fixed it after some detective work. The problem was this: I had the latest version of protobuf from the git repo, https://github.com/google/protobuf. When I tried to build my project, it was throwing the error shown in qmp's answer,
#if GOOGLE_PROTOBUF_VERSION < 2004000
#error This file was generated by a newer version of protoc which is...
I was building code that someone else wrote, and in their .proto file, they didn't specify a version. The default is syntax = "proto2"; I added syntax = "proto3"; to the .proto file just before the package declaration and removed all instances of the optional and required keywords, as they are not part of version 3 syntax. Then from the command line, I regenerated the protobuf output.
prompt#ubuntu$ protoc --cpp_out=. project.proto
This updated all the files generated by protoc to version 3, which solved the issue.

If you look at userinput.pb.h, you will notice it reads
#if GOOGLE_PROTOBUF_VERSION < 2004000
#error This file was generated by a newer version of protoc which is
So protobuf-2.4.1 is sufficient for mosh-1.2.4. If you still get the error, then there may be a stray protobuf installation, likely something in /usr/local.

Related

VLC 3.0.12/3.0.14 once command source build fails on macOS

Running mac osx 10.14.6 and have previously successfully built 3.0.10 and 3.0.11. Trying to build VLC 3.0.12 & 3.0.14 from source downloaded from here: http://www.videolan.org/vlc/download-sources.html
and using recommended build from here: https://wiki.videolan.org/MacOSCompile/ AND using the recommended:
../extras/package/macosx/build.sh -c
Build runs for about 20 minutes and then stops here (snip of output):
CCLD libprefetch_plugin.la
CCLD libhds_plugin.la
CCLD librecord_plugin.la
ld: library not found for -lzstd
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[4]: *** [libarchive_plugin.la] Error 1
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
mysystem:build xx$
What am I missing or doing wrong?
Note: in previous builds I could find a cmake/Utilities/cmzstd/lib directory in vlc-3.0.x/extras/tools that had various zstd files however it is not there in either 3.0.12 or 3.0.14 - only a cmake-enable-ALPN-support-on-macOS-109.14.patch file.
Where do I find zstd? Thanks.
Seems the issue is related to how macOS and packagers (homebrew, etc.) load components. macOS provides a compiled version of libarchive but no headers, so you are unable in trying to compile. You will either need to pass the location of your libarchive respository with headers via your build script or set an environment variable telling the compiler or linker where to look for them. Perhaps someone more familiar with your VLC package can weigh in.

PROTOBUF_INLINE_NOT_IN_HEADERS

I'm trying to install Open Transactions, the open-source project, on a debian 8. I've installed all the dependencies and am having an issue when compiling (make). The following error is showing at my terminal, even though i made sure to install the protobuf project:
In file included from /root/opentxs/src/../include/opentxs/core/OTStoragePB.hpp:64:0,
from /root/opentxs/src/core/OTStorage.cpp:47:
/root/opentxs/build/src/core/otprotob/Generics.pb.h:501:6: error: "PROTOBUF_INLINE_NOT_IN_HEADERS" is not defined [-Werror=undef]
#if !PROTOBUF_INLINE_NOT_IN_HEADERS
^
In file included from /root/opentxs/src/../include/opentxs/core/OTStoragePB.hpp:65:0,
from /root/opentxs/src/core/OTStorage.cpp:47:
/root/opentxs/build/src/core/otprotob/Markets.pb.h:2062:6: error: "PROTOBUF_INLINE_NOT_IN_HEADERS" is not defined [-Werror=undef]
#if !PROTOBUF_INLINE_NOT_IN_HEADERS
^
In file included from /root/opentxs/src/../include/opentxs/core/OTStoragePB.hpp:66:0,
from /root/opentxs/src/core/OTStorage.cpp:47:
/root/opentxs/build/src/core/otprotob/Bitcoin.pb.h:833:6: error: "PROTOBUF_INLINE_NOT_IN_HEADERS" is not defined [-Werror=undef]
#if !PROTOBUF_INLINE_NOT_IN_HEADERS
^
In file included from /root/opentxs/src/../include/opentxs/core/OTStoragePB.hpp:67:0,
from /root/opentxs/src/core/OTStorage.cpp:47:
/root/opentxs/build/src/core/otprotob/Moneychanger.pb.h:1026:6: error: "PROTOBUF_INLINE_NOT_IN_HEADERS" is not defined [-Werror=undef]
#if !PROTOBUF_INLINE_NOT_IN_HEADERS
^
cc1plus: all warnings being treated as errors
src/core/CMakeFiles/opentxs-core.dir/build.make:1368: recipe for target 'src/core/CMakeFiles/opentxs-core.dir/OTStorage.cpp.o' failed
make[2]: *** [src/core/CMakeFiles/opentxs-core.dir/OTStorage.cpp.o] Error 1
make[2]: Leaving directory '/root/opentxs/build'
CMakeFiles/Makefile2:586: recipe for target 'src/core/CMakeFiles/opentxs-core.dir/all' failed
make[1]: *** [src/core/CMakeFiles/opentxs-core.dir/all] Error 2
make[1]: Leaving directory '/root/opentxs/build'
Makefile:150: recipe for target 'all' failed
make: *** [all] Error 2
Any ideas on how to deal with this? Couldn't find any help online.
I had the same problem on Ubuntu 14.04 and I fix it as you said . But I am just writing to explain more the issue.
So , After googling the error I found this discussion . In which they describe that the problem arises from the fact that the google coders are relying on the fact that the C++ standard allows you to treat an undefined preprocessor symbol as evaluating to 0. So there is a bunch of #if directives testing the value of PROTOBUF_INLINE_NOT_IN_HEADERS when it hasn’t been defined anywhere; this is legal and should be treated as if it’s a zero.
I fixed this by adding -DPROTOBUF_INLINE_NOT_IN_HEADERS=0 into CCFLAGS in the the top-level SConstruct and CXXFLAGS in src/SConscript (CXXFLAGS) and that seemed to catch it.
So to fix this , you should add this line in the CMakeList.txt that you find in opentxs main folder :
add_definitions(-DPROTOBUF_INLINE_NOT_IN_HEADERS=0)
And don't forget to repeat the cmake step .
Hope this is more clear and helpful .
Fixed this by adding this line at the top of the CMakelists.txt
add_definitions(-DPROTOBUF_INLINE_NOT_IN_HEADERS=0)

Mac os 10.11.1 MakeFile erro: ext/numeric file not found

I am trying to compile a public software called CofiRank. Here is the link to package: https://github.com/markusweimer/cofirank
To compile it I run:
make -f CofiRank-Makefile.mk CONF=Deploy
and here is part of my terminal results:
g++ -D NDEBUG -c -g -Isrc -Ilibs -o build/Deploy/GNU-
MacOSX/src/loss/ndcgdomainmodel.o src/loss/ndcgdomainmodel.cpp
In file included from src/utils/ublastools.cpp:1:
src/utils/ublastools.hpp:17:10: fatal error: 'ext/numeric' file not found
#include <ext/numeric> // for iota
In file included from src/bmrm/solver/dualinnersolver.cpp:29:
src/utils/ublastools.hpp:17:10: fatal error: 'ext/numeric' file not found
#include <ext/numeric> // for iota
1 error generated.
make[2]: *** [build/Deploy/GNU-MacOSX/src/utils/ublastools.o] Error 1
make[2]: *** Waiting for unfinished jobs....
1 error generated.
make[2]: *** [build/Deploy/GNU-MacOSX/src/bmrm/solver/dualinnersolver.o]
In file included from src/bmrm/solver/daifletcherpgm.cpp:28:
In file included from src/bmrm/solver/daifletcherpgm.hpp:22:
In file included from src/bmrm/solver/dualinnersolver.hpp:6:
src/utils/ublastools.hpp:17:10: fatal error: 'ext/numeric' file not found
#include <ext/numeric> // for iota
1 error generated.
make[2]: *** [build/Deploy/GNU-MacOSX/src/loss/ndcgdomainmodel.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
I searched a lot but could not fix it. I think I need to use libstd++ instead lib++ which is the default of mac os, but I don't know how to (or if it is the problem)
can someone help me on this?
<ext/numeric> is a non-standard header file provided by the GNU C++ standard library (libstdc++) that comes with GCC.
You are probably compiling with Clang, and so need to tell it to use the GNU library not its own one, so compile with -stdlib=libstdc++

Compiling GCC 4.7.3 for i386-elf support on Cygwin

I am trying to compile GCC for Cygwin with support for targeting i386-elf so I can compile some simple OSes (search Benu, by l30nard0, on Github). I've successfully compiled the binutils for i386-elf, and compiled all of GCC's floating-point numbers dependencies.
Problem is, it says windows.h can not be found. I do have w32api successfully installed, and tried including each of those one at a time in the include path for GCC, but none of them work. If I try any of them, I get so many errors and warnings that not all will show up in the Cygwin console. The dozens upon dozens of warnings are most if not all unused parameter.
Does anyone know where the problem might lie?
I've wasted the last three entire days of my life trying to get Linux Mint set up with everything I want, but for reasons I shan't go into I gave up on that. I'd love to be able to get just one thing to work so I can enjoy my life again. :) Thanks!
BTW: The configure arguments I used were --target=i386-elf --enable-threads=win32 --enable-languages=c,c++ Was I supposed to use --enable-targets instead?
And here's part of the log:
In file included from ../../../gcc/libgcc/gthr.h:150:0,
from ../../../gcc/libgcc/unwind-dw2.c:38:
./gthr-default.h:541:21: fatal error: windows.h: No such file or directory
compilation terminated.
../../../gcc/libgcc/static-object.mk:17: recipe for target 'unwind-dw2.o' failed
make[2]: *** [unwind-dw2.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from ../../../gcc/libgcc/gthr.h:150:0,
from ../../../gcc/libgcc/unwind-dw2-fde.c:38:
./gthr-default.h:541:21: fatal error: windows.h: No such file or directory
compilation terminated.
../../../gcc/libgcc/static-object.mk:17: recipe for target 'unwind-dw2-fde.o' failed
make[2]: *** [unwind-dw2-fde.o] Error 1
make[2]: Leaving directory '/home/Sean/gccbuild/i386-elf/libgcc'
Makefile:10055: recipe for target 'all-target-libgcc' failed
make[1]: *** [all-target-libgcc] Error 2
make[1]: Leaving directory '/home/Sean/gccbuild'
Makefile:870: recipe for target 'all' failed
make: *** [all] Error 2
Remove the --enable-threads=win32 flag; it is intended to specify thread support on the target system, not the build system.

installing isolated gcc on server without sudo

I have access to a server (but don't have root permissions on there). To cut a long story short the admin won't upgrade to the newer version of gcc that I need, but has suggested that I can just install it locally.
I'm having some issues doing this, despite trying to follow the guide at http://gcc.gnu.org/install/index.html. I want to use the new versions of GMP, MPFR, and MPC that are installed now on the server.
I first go into my home dir on the server then mkdir mygcc which I then cd into (this is to be the build dir and is not a sub-dir of src dir), from there I do
/home/username/gcc-4.6.3/configure --with-gmp="/software/gmp-5.0.5" --with-
gmp-include="/software/gmp-5.0.5/include" --with-gmp-lib="/software/gmp-5.0.5/lib"
--with-mpfr="/software/mpfr-3.1.1" --with-mpfr-include="/software/mpfr-3.1.1/include"
--with-mpfr-lib="/software/mpfr-3.1.1/lib" --with-mpc-include="/home/username/usr/local
/include" --with-mpc-lib="/home/username/usr/local/lib" --prefix="/home/username/mygcc"
--with-local-prefix="/home/username/usr/local"
the src files that I unzipped are at /home/pmxlh1/gcc-4.6.3.
I also made the directories /home/username/usr/include, /home/username/usr/local etc and set the prefix flags to try and install various things there, but it also fails if I just leave those flags out for the same reasons.
When I get to make however it ends with
checking for suffix of object files... configure: error: in `/home/pmxlh1/mygcc/x86_64-
unknown-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make[2]: *** [configure-stage1-target-libgcc] Error 1
make[2]: Leaving directory `/home/pmxlh1/mygcc'
make[1]: *** [stage1-bubble] Error 2
make[1]: Leaving directory `/home/pmxlh1/mygcc'
make: *** [all] Error 2
Not sure if I'm going about this the correct way? But basically I want to install it in my home/dir and so that it uses the correct GMP/MPFR/MPC not the old versions that maybe lurking elsewhere on the server.
thanks for any help

Resources