Error in ./configure step. (CentOS 7) Your compiler does not have the necessary C++17 support - centos

The lower part is as follows.
How do we solve this?
checking whether the g++ linker (/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... no
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether C++ compiler accepts -std=c++17... no
checking whether C++ compiler accepts -std=c++20... no
configure: error: Your compiler does not have the necessary C++17 support! Cannot proceed.

I had the same issue and tried everything out. At the end i found the solution in this thread ->
g++: error: unrecognized '-std=c++17' (what is g++ version and how to install)
yum install devtoolset-10-gcc-c++
scl enable devtoolset-10 bash
make
exit

Related

Linking with GCC doesn't detect -fPIC flag

I am trying to link some files. Here is my command:
gcc -T linker.ld -o Stack\ Berry.bin -ffreestanding -O2 -nostlib kernel.o boot.o -fPIC -lgcc
How ever, I get this error:
/usr/bin/ld: boot.o: relocation R_X86_64_32 against `.multiboot' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
I have included the -fPIC argument, have I just put it in the wrong place? I have tried putting the argument in where it compiles but no luck. I haven't been able to find any thing for the syntax for this flag. Thanks!
You are passing -fPIC to your linkage command. It is a compiler option,
because you need to compile your source code to Position Independent object files.
Remove it from this command and add it to your compilation commands.
(-O2 is likewise a compiler, not linker, option.)

unexpected token `LEPTONICA,' PKG_CHECK_MODULES(LEPTONICA

I'm using the JavaCPP Presets project to build Leptonica and Tesseract. I have managed to build Leptonica 1.7 using the following commands:
cd leptonica
./cppbuild.sh install leptonica
cd cppbuild/linux-x86_64/leptonica-1.72/
./configure
make && sudo make install
cd ../../../
mvn clean install
cd ..
The compiled libraries are /usr/local/lib
When I try to build Tesseract using the following command I get this error:
./cppbuild.sh install tesseract
./configure: line 17620: syntax error near unexpected token `LEPTONICA,'
./configure: line 17620: `PKG_CHECK_MODULES(LEPTONICA, lept >= 1.74, have_lept=true, have_lept=false)'
/opt/javacpp-presets/tesseract
Then I put the complete trace:
/opt/javacpp-presets /opt/javacpp-presets/tesseract
Detected platform "linux-x86_64"
Building for platform "linux-x86_64"
Installing "tesseract"
/opt/javacpp-presets/tesseract/cppbuild /opt/javacpp-presets
Decompressing archives...
Bytes leídos en total: 12032000 (12MiB, 33MiB/s)
Running aclocal
Running /usr/bin/libtoolize
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'config'.
libtoolize: copying file 'config/ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
Running autoheader
Running automake --add-missing --copy
configure.ac:309: installing 'config/compile'
configure.ac:69: installing 'config/missing'
api/Makefile.am: installing 'config/depcomp'
Running autoconf
All done.
To build the software now, do something like:
$ ./configure [--enable-debug] [...other options]
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ -m64 accepts -g... yes
fatal: Not a git repository: './.git'
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking whether make supports nested variables... yes
checking dependency style of g++ -m64... gcc3
checking whether to enable maintainer-specific portions of Makefiles... no
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking --enable-graphics argument... yes
checking whether to disable cube... no
checking --enable-embedded argument... no
checking --enable-opencl argument... no
checking how to run the C++ preprocessor... g++ -m64 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking CL/cl.h usability... no
checking CL/cl.h presence... no
checking for CL/cl.h... no
checking OpenCL/cl.h usability... no
checking OpenCL/cl.h presence... no
checking for OpenCL/cl.h... no
checking tiffio.h usability... yes
checking tiffio.h presence... yes
checking for tiffio.h... yes
checking for clGetPlatformIDs in -lOpenCL... no
checking --enable-visibility argument... no
checking --enable-multiple-libraries argument... no
checking whether to use tessdata-prefix... yes
checking whether to enable debugging... no
checking how to print strings... printf
checking for gcc... gcc -m64
checking whether we are using the GNU C compiler... yes
checking whether gcc -m64 accepts -g... yes
checking for gcc -m64 option to accept ISO C89... none needed
checking whether gcc -m64 understands -c and -o together... yes
checking dependency style of gcc -m64... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking for ld used by gcc -m64... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-pc-linux-gnu file names to x86_64-pc-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-pc-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver #FILE support... #
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc -m64 object... ok
checking for sysroot... no
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc -m64 supports -fno-rtti -fno-exceptions... no
checking for gcc -m64 option to produce PIC... -fPIC -DPIC
checking if gcc -m64 PIC flag -fPIC -DPIC works... yes
checking if gcc -m64 static flag -static works... yes
checking if gcc -m64 supports -c -o file.o... yes
checking if gcc -m64 supports -c -o file.o... (cached) yes
checking whether the gcc -m64 linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking how to run the C++ preprocessor... g++ -m64 -E
checking for ld used by g++ -m64... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ -m64 linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ -m64 option to produce PIC... -fPIC -DPIC
checking if g++ -m64 PIC flag -fPIC -DPIC works... yes
checking if g++ -m64 static flag -static works... yes
checking if g++ -m64 supports -c -o file.o... yes
checking if g++ -m64 supports -c -o file.o... (cached) yes
checking whether the g++ -m64 linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether byte ordering is bigendian... no
checking if compiling with clang... no
checking whether compiler supports C++11... yes
checking for snprintf... yes
checking for library containing sem_init... -lpthread
checking for ANSI C header files... (cached) yes
checking whether time.h and sys/time.h may both be included... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking sys/ipc.h usability... yes
checking sys/ipc.h presence... yes
checking for sys/ipc.h... yes
checking sys/shm.h usability... yes
checking sys/shm.h presence... yes
checking for sys/shm.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... no
checking whether #! works in shell scripts... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for getline... yes
checking for wchar_t... yes
checking for long long int... yes
checking for off_t... yes
checking for mbstate_t... yes
./configure: line 17620: syntax error near unexpected token `LEPTONICA,'
./configure: line 17620: `PKG_CHECK_MODULES(LEPTONICA, lept >= 1.74, have_lept=true, have_lept=false)'
/opt/javacpp-presets/tesseract
The version I am using from autoconf is 2.9.
Thanks in advance
There's a similar issue raised over on the github account for tesseract earlier this year. One comment in response says:
Thank you for this report. You found a bug in the installation guide: we did not mention that the package pkg-config is required. I fixed it in the Wiki page and will send a pull request to update the distributed INSTALL* files.
I had the same problem on OS X today, and installing pkg-config seems to have fixed the issue.

"scons qemu" error "sh: 1: qemu: not found"

I want learn a toy OS FreeNOS, its doc says use "scons qemu" to boot it. But I run this command shows:
scons: Reading SConscript files ...
Checking for -m32 ... (cached) yes
Checking for -fno-stack-protector ... (cached) yes
Checking for -O0 ... (cached) yes
Checking for -g3 ... (cached) yes
Checking for -Wall ... (cached) yes
Checking for -W ... (cached) yes
Checking for -Wno-unused-parameter ... (cached) yes
Checking for -fno-builtin ... (cached) yes
Checking for -nostdinc ... (cached) yes
Checking for -Wno-write-strings ... (cached) yes
scons: done reading SConscript files.
scons: Building targets ...
qemu -usb -cdrom boot/boot.iso
sh: 1: qemu: not found
scons: *** [qemu] Error 127
scons: building terminated because of errors.
But I have installed qemu, when I run "ls /usr/bin", It shows :
here are many items about but no one is named "qemu"
so I want know how could I boot this OS..
You've nearly answered your question yourself. qemu is not found because there is no qemu.
Simply create a symlink to your desired target platform. Looking at freenos.org x86, mips and arm are supported, so most likely ln -s qemu-system-i386 qemu should work.
For clarification: all qemu binaries are of the form qemu-system-< arch > or qemu-< arch >[-static]. qemu-system-* emulates a hole system (e.g a x86 pc with disk, network and graphics card), whereas with qemu-< arch > you can run a single binary of architecture < arch > on your current host architecture.

Compiling fish shell under MSYS?

I found this post Compiling fish shell under Cygwin? which talks about compiling fish against Cygwin.
What would be the instructions to compile for MSYS? (and especially MSYSGIT)?
This is what I did
install msysgit-netInstall https://code.google.com/p/msysgit/downloads/detail?name=msysGit-netinstall-1.8.4-preview20130916.exe&can=2&q=
install autoconf from http://sourceforge.net/projects/mingw/files/MSYS/msysdev/autoconf/autoconf-2.68-1/autoconf-2.68-1-msys-1.0.17-bin.tar.lzma/download
clone the fish repo
run autoconf
run ./configure
the process fails with
$ ./configure
checking if autoconf needs to be run... no
checking if autoheader needs to be run... no
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for a BSD-compatible install... /bin/install -c
CXXFLAGS: -g -O2
checking for /usr/pkg/include include directory... no
checking for /usr/pkg/lib library directory... no
checking for /usr/pkg/bin command directory... no
checking for /sw/include include directory... no
checking for /sw/lib library directory... no
checking for /sw/bin command directory... no
checking for /opt/include include directory... no
checking for /opt/lib library directory... no
checking for /opt/bin command directory... no
checking for /opt/local/include include directory... no
checking for /opt/local/lib library directory... no
checking for /opt/local/bin command directory... no
checking for /usr/local/include include directory... no
checking for /usr/local/lib library directory... no
checking for /usr/local/bin command directory... no
checking for msgfmt... msgfmt
checking for doxygen... no
checking if we are compiling against glibc... no
checking build system type... i686-pc-mingw32
checking host system type... i686-pc-mingw32
checking target system type... i686-pc-mingw32
checking if we are under Solaris... no
checking if we are using non varargs tparm.... yes
checking if we are under BSD... no
checking for /proc/self/stat... no
checking for library containing connect... no
configure: error: Cannot find the socket library, needed to build this package.
Any idea?

installing sphinx on mac OS X version 10.8.2 and configuring

can anyone pls tell me how to install sphinx on mac OS X version 10.8.2
Now, How can I check whether its properly installed or mot??
where can i find the files i installed
getting error while trying to run ./configure command got this error
unknown-5c:96:9d:7d:44:c7:sphinx-2.0.1-beta username$ ./configure
checking build environment
--------------------------
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... config/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... no
checking whether to enable maintainer-specific portions of Makefiles... no
checking for compiler programs
------------------------------
checking whether to compile debug version... no
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/Users/username/Downloads/sphinx-2.0.1-beta':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
how can resolve this?
Many Thanks
Surely
configure: error: no acceptable C compiler found in $PATH
Is pretty clear...?
https://www.google.com/search?q=install+c+compiler+mac+os