I succesfully install fedora14 using virtual box,but I could'nt compile anything by using g++ command it says "command not found",how can I solve this?
I have to mention here i followed as
1)type- su
then I enter p.w
2)type- yum install g--c++
but its not working
This means g++ is not available on your machine.You should try the following step to install
sudo yum install gcc-c++
enter root password
Once installation is complete, verify by the command "gcc -v" and "man g++".
Related
I am running the golang command "go get -t github.com/otiai10/gosseract" , causing the error tessbridge.cpp:5:10: fatal error: leptonica/allheaders.h: No such file or directory, #include <leptonica/allheaders.h>. That library is https://github.com/DanBloomberg/leptonica. How do I install it from source so that the gcc command will work.
Before that command was producing the error "gcc not found", but then I followed https://superuser.com/questions/1294343/install-gcc-in-git-for-windows-bash-environment to setup gcc on windows.
I have not been able to find any references for what gcc expects when it encounters an include<>, and where those files should be located on the file system for it to link properly. Is it possible to install this library manually?
Here is much simpler solution for you. There was no need to install gcc on git-bash.
Install MSYS2. Follow complete installation guide.
On MSYS2 console enter the following commands :
pacman -S mingw-w64-x86_64-gcc
pacman -S mingw-w64-x86_64-leptonica
Add C:\msys64\mingw64\bin to PATH.
First step can be further simplified if you use Chocolatey. Just run these commands in elevated powershell : (Ignore first command if choco is already installed.)
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Reopen elevated powershell and run these:
choco install -y msys2 --params="/InstallDir:C:\msys64"
refreshenv
$env:Path += ";C:\msys64\usr\bin"
pacman -S mingw-w64-x86_64-gcc
pacman -S mingw-w64-x86_64-leptonica
[Environment]::SetEnvironmentVariable("Path", "C:\msys64\mingw64\bin;" + $env:Path, "User")
As the title said I can't install that specific version of g++ in my current ubuntu (20.04).
I have been trying the usual things as: sudo apt install g++- (and displaying all posibilities but there where only versions from 8 to 10). Same happend looking for gcc possibilities.
Also tried this: gist.github.com/application2000/73fd6f4bf1be6600a2cf9f56315a2d91 (same problem)
And after looking for a while I gave up in my research and ended up here. Hope someone with more wisdom than me can give my a hand with this.
These steps should work:
sudo dpkg --add-architecture i386
sudo apt update
sudo apt upgrade
sudo apt-get install gcc-multilib libstdc++6:i386
wget https://ftp.gnu.org/gnu/gcc/gcc-4.8.5/gcc-4.8.5.tar.bz2 --no-check-certificate
tar xf gcc-4.8.5.tar.bz2
# cd gcc-4.8.5
# ./contrib/download_prerequisites
# cd ..
sed -i -e 's/__attribute__/\/\/__attribute__/g' gcc-4.8.5/gcc/cp/cfns.h
sed -i 's/struct ucontext/ucontext_t/g' gcc-4.8.5/libgcc/config/i386/linux-unwind.h
mkdir xgcc-4.8.5
pushd xgcc-4.8.5
$PWD/../gcc-4.8.5/configure --enable-languages=c,c++ --prefix=/usr --enable-shared --enable-plugin --program-suffix=-4.8.5
make MAKEINFO="makeinfo --force" -j
sudo make install -j
Note that you have to uncomment the .../download_prerequisites on some platform. For me it worked without on Centos 7 or Ubuntu 20 with the mandatory packages installed:
Ubuntu/Debian:
sudo apt install make wget git gcc g++ lhasa libgmp-dev libmpfr-dev libmpc-dev flex bison gettext texinfo ncurses-dev autoconf rsync
Centos:
sudo yum install wget gcc gcc-c++ python git perl-Pod-Simple gperf patch autoconf automake make makedepend bison flex ncurses-devel gmp-devel mpfr-devel libmpc-devel gettext-devel texinfo
Few seconds later (/giggles) gcc-4.8.5 is installed and available.
Notes:
if you don't have the resources to run make -j omit -j or use -j4 (or a different number which is adequate for your system)
your milage may vary and you may need to install further i386 packages
Since I can't comment I will add to #bebbo solution that on an Ubuntu 20.04 I had to add to his steps patching the following patches:
Add an include to signal.h to libsanitizer/asan/asan_linux.cc
https://patchwork.ozlabs.org/project/gcc/patch/6824253.3U2boEivI2#devpool21/
change a line in libsanitizer/tsan/tsan_platform_linux.cc
as shown. line number may not be the one stated in the patch so search for the line that was changed. There is no need to apply the patch to the other files
https://git.pantherx.org/mirror/guix/commit/0b93d04ac537d6413999349ebe7cdcb1e961700e
Adding to kpeace's answer...
sed -i '/#include <pthread.h>/a #include <signal.h>' path_to_gcc4.8.5src/libsanitizer/asan/asan_linux.cc
sed -i 's/__res_state \\*statp = (__res_state\\*)state\\;/struct __res_state \\*statp = (struct __res_state\\*)state\\;/g' path_to_gcc4.8.5src/libsanitizer/tsan/tsan_platform_linux.cc
Just adding a couple of sed lines to patch them inline.
Also, I've been writing some Ruby scripts to install some software (for fun of course.) I've recently successfully compiled gcc-4.8.5 under LinuxMint 20.1 (Ubuntu 20.04 based, compiler is the system gcc: 9.3.0, installed with sudo apt install build-essential) with this script. Also, I've installed all the packages that Bebbo suggested, including gcc-multilib and libstdc++6:i386 before running this script. Check up InstGcc4 class at the bottom of the code.
install_gcc.rb
They might end up to be 'un-installable' state a few months later. But at least gcc-4.8.5 works now.
ps. I've started to compile this old gcc due to CUDA... My hardware is a decade old GeForce 9600/9400 (yeah 2008 MBP) and CUDA 6.5 was the best option for that machine.
pps. Anyway, strange thing is, I had to give out '-std=gnu++11' for CXXFLAGS to avoid errors.
I need your help,i use 'yum' command to install xsp by this following command,
sudo yum install xsp
then i tried to ensure that xsp is installed or not,
[root#vultr src]# xsp -v
Cannot open assembly '/usr/lib/mono/4.5/xsp2.exe': No such file or directory.
can somebody help me?
try this:
yum remove xsp
yum install xsp-4.2-2.el7.x86_64
or run this to see what is available (I could not find any xsp2.exe):
yum whatprovides /usr/lib/mono/4.5/*
I have an issue with Codelite compilation, running on raspbian jessie - these are the (known) steps I have taken to produce it.
First I installed Codelite with apt-get install Codelite, then produced a c++ project.
When running build project I get the error:
/bin/sh -c ' -j 4 -e -f Makefile'
/bin/sh: 1: -j: not found
0 errors, 0 warnings
I note that this error has been found and corrected previously, through running a different version of Codelite from 6.1.1 (that which apt-get installs). I therefore found the updated version of armhf .deb codelite from the rasbian archive with gdebi-gtk. However the updated version (9.1.1) produces the following error (install attempt with the graphical debian):
Error: Dependency is not satisfiable: libclang 1-3.8 (>=3.2)
I do not understand why the package manager cannot update these packages - do they not exist for the pi? I ran the manager as root, so I do not think it is a permissions issue.
EDIT 1:
Thank you for that Fabre. My Enviromental Variables file now looks like this:
CodeLiteDir=/usr/share/codelite
export MAKE=make
I still get the same error however.
installing gcc on a mac. everything worked fine until I got to the terminal command:
sudo port select -set gcc mp-gcc48
I get the following error:
Usage: port
[-bcdfknopqRstuvy] [-D portdir] [-F cmdfile] action [privopts] [actionflags]
[[portname|pseudo-portname|port-url] [#version] [+-variant]… [option=value]…]…
“port help” or “man 1 port” for more information.
Can you offer any help?
See more at: http://www.newthinktank.com/2013/08/how-to-install-gcc/#comment-23281
The --set option is not actual needed here, but if you include it should be preceded by two hyphens:
sudo port select --set gcc mp-gcc48
MacPorts gives you much better feedback if you start it in interactive mode and then type in the required commands:
hostname:~ username$ sudo port
MacPorts 2.2.1
Entering interactive mode... ("help" for help, "quit" to quit)
[Users/username] > select gcc mp-gcc48
Selecting 'mp-gcc45' for 'gcc' succeeded. 'mp-gcc48' is now active.
I would recommend installing with Homebrew http://brew.sh
Install Homebrew, update, make sure the brew doctor is happy, then run:
brew tap Homebrew/versions
brew install gcc48