I'm trying to start writing code in Golang. Whenever I try to run my code or build it I get the following error.
github.com/ethereum/go-ethereum/crypto/secp256k1
cgo: C compiler "gcc" not found: exec: "gcc": executable file not found in %PATH%
I'm using windows so I followed some steps from a previous problem and installed TDM-GCC. Inside the files in the bin folder there is a gcc.exe file that should be fixing my issue.
In my path variables and also my system variables I've added C:\TDM-GCC-64\bin and I'm still getting the error. I've also restarted my pc to make sure the environment variables were updated.
Anyone have any idea how I could fix this?
It seems like it's asking for the gcc to be installed. Try install GCC by downloading and installing it from (https://gcc.gnu.org/install/index.html) . Once GCC is installed, you should be able to build and run your code without any issues.
Related
after I successfully set up my gcc/g++ environment under my Linux installation, I decided to do that for my Windows 11 machine as well. For that purpose I decided to use MSYS2. With the help of that handy tool I quickly installed MinGW as well as corresponding libraries.
One library which gives me headache (under Windows) is pkg-config. But before the installation of pkg-config, I installed gtk-3.0 first. I just installed it with the following command:
pacman -S mingw-w64-x86_64-gtk3
After that I installed pkg-config with the following command:
pacman -S mingw-w64-x86_64-pkg-config
After that, I tried to get all include and library flags for gtk3:
pkg-config --cflags gtk+-3.0
However after entering that command, the following error message occurs:
Perhaps you should add the directory containing `gtk+-3.0.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gtk+-3.0', required by 'virtual:world', not found
The thing is that this exact command works like a charm under my Linux installation but somehow pkg-config can't find the package in the pkg-config search path. Why is that the case? Is that a known problem within the MSYS2 environment?
I would appreciate every tip I can get from you.
Thank you in advance!
EDIT: It looks like I just had to start the MinGW64 shell and not the one from MSYS2. Within that environment the files can be found and no error will occur. Thanks #HolyBlackCat!
The following answer is outdated, written in italic style and shouldn't be followed.
I just solved it by myself. I found out that I had to copy all .pc files from msys64\mingw64\lib\pkgconfig to the path I get from echoing PKG_CONFIG_PATH:
echo $PKG_CONFIG_PATH
gives me
/usr/lib/pkgconfig:/usr/share/pkgconfig:/lib/pkgconfig
So I just copied the files to /usr/lib/pkgconfig - problem solved!
Thank you anyway! :)
I'm trying to install the mips-linux-gnu-gcc Toolchain on Debian 7 from a guide, which has the instructions to install it from a directory on the machine (which I already sent in) and has the following command to do so:
export PATH=toolchain/bin/path:$PATH
and the next step is to check it's version:
mips-linux-gnu-gcc --version
But the only result I have is the "command not found result", I made sure the files are inside the folder and they are, and checking the mips-linux-gnu-gcc file I have the following result:
Am I doing something wrong? I have no experience with this kind of files and I haven't found any other way to install it, so I really need help with this :/
I solved it! the problem was the directory that I was exporting to PATH, since I installed everything on the root folder I had to put /root/ at the start of the url indicated in the instruction guide.
I want to use SPIN model checker on windows7-64 and I have installed all the prerequisites of it. Below is the procedure how I did it
I installed gcc compiler with cygwin .. updated path checked with command
prompt it shows version 4.9.2
Installed Active Tcl .. updated path .. works fine when I open ispin.
Updated path with ispin directory as well.
Just a bit of trick, also check by giving exact path of gcc.exe inside ispin file. But the error remained same.
But when I try to compile pre included example files (e.g leader.pml), it gives me the error
spin: preprocessing failed
gcc-4: error: spawn: No such file or directory
Can someone please tell me what am I doing wrong and/or missing ? and how can I fix this ?
Thanks.
In cygwin\bin, copy gcc twice, name one gcc-3, the other gcc-4, but also leave plain gcc there.
I'm building the latest github version of rstudio-server to run on OSX Yosemite, but can't get it to find the macports R libraries when installing.
I run into a "Minimum R version (2.11.1) not found." error when I run
cmake -DRSTUDIO_TARGET=Server -DCMAKE_BUILD_TYPE=Release ..
but when I pass -DRSTUDIOVERIFYR_VERSION=0 as well, I configure successfully and make it to about 44% before the build fails:
Rogers-iMac:build roger$ sudo make install
Password:
Scanning dependencies of target gwt_build
Buildfile: /Users/roger/projects/rstudio/src/gwt/build.xml
[...]
Scanning dependencies of target rstudio-r
[ 44%] Building CXX object src/cpp/r/CMakeFiles/rstudio-r.dir/RErrorCategory.cpp.o
[ 44%] Building CXX object src/cpp/r/CMakeFiles/rstudio-r.dir/RExec.cpp.o
In file included from /Users/roger/projects/rstudio/src/cpp/r/RExec.cpp:17:
In file included from /Users/roger/projects/rstudio/src/cpp/r/include/r/RExec.hpp:30:
In file included from /Users/roger/projects/rstudio/src/cpp/r/include/r/RSexp.hpp:33:
/Users/roger/projects/rstudio/src/cpp/r/include/r/RInternal.hpp:43:10: fatal error: 'Rinternals.h' file not found
#include <Rinternals.h>
^
1 error generated.
I was able to find Rinternals.h in /opt/local/Library/Frameworks/R.framework/Versions/3.1/PrivateHeaders/Rinternals.h (EDIT: also in /opt/local/Library/Frameworks/R.framework/Versions/3.1/Resources/include/Rinternals.h), but how do I point the build configuration to this location?
EDIT: Additionally, I experienced another problem where the build failed at about 70% with the error
/opt/local/lib/libR.dylib/Resources/R: not a directory
make[2]: *** [src/cpp/r/R/packages/library/manipulate/DESCRIPTION] Error 126
Upon further investigation, /opt/local/lib/libR.dylib/Resources/R does not exist, because /opt/local/lib/libR.dylib is actually a file.
Not sure about the specifics of cmake but you can try
$ export CPATH=$CPATH:/opt/local/Library/Frameworks/R.framework/Versions/3.1/PrivateHeaders/
$ sudo make install
to tell the compiler to look for header files in the location where you found them.
This appears to be a problem with the RStudio cmake script not properly detecting a MacPorts R installation. To fix these problems:
Point cmake to the correct location of your R executable using export RSTUDIO_WHICH_R=/opt/local/bin/R (or whatever the location is for you), as described in this RStudio Knowledge Base Article. This solves the problem with cmake failing to generate a configuration.
To solve the problems with Rinternals.h not being found, go into build/CMakeCache.txt and change the path of LIBR_INCLUDE_DIRS to reflect Rinternals.h's actual location, as described in this RStudio Support Forum Question.
Ensure that LIBR_EXECUTABLE, LIBR_HOME, and LIBR_DOC_DIR all point to the correct location. You can get the correct locations by doing R.home(component="home") (or component="doc") in an R interactive prompt, as described on this webpage. This will solve the build error at 44%, and the additional error I had at 70-ish%.
Add -I /opt/local/Library/Frameworks/R.framework/Versions/3.1/PrivateHeaders/ to the compiler's command line.
Alternatively, you can set CPLUS_INCLUDE_PATH in the environment to tell the compiler where to search for additional headers when compiling C++ code. You may also want to set C_INCLUDE_PATH for C if needed.
$ export CPLUS_INCLUDE_PATH=/opt/local/Library/Frameworks/R.framework/Versions/3.1/PrivateHeaders
$ make
I was trying to build Boost library from source for MinGW. The Boost website says no guarantee but there seem to be people done it successfully. However I couldn't find much instructions on the web.
I updated the title to better reflect my problem right now.
======================== Original post ==============================
I downloaded Boost 1.53.0, unzipped it and cd to the folder in MinGW shell. It failed at the very first step I tried:
$ ./bootstrap.sh mingw
Building Boost.Build engine with toolset gcc...
Failed to build Boost.Build build engine
Consult 'bootstrap.log' for more details
Inside the bootstrap.log the errors are:
builtins.c:33:23: fatal error: sys/wait.h: No such file or directory
compilation terminated.
execunix.c:17:26: fatal error: sys/resource.h: No such file or directory
compilation terminated.
fileunix.c:98:17: fatal error: ar.h: No such file or directory
compilation terminated.
Please help! Thanks!
================== End of original and beginning of update =====================
Update: I found this detailed instruction on line:
http://vijay.axham.com/blog/478/building-boost-binaries-on-mingw
I followed it along and now got stuck in the final build step that is supposed to take a long time but I got an error instead:
$ b2 --build-dir=$BOOST_BUILD_DIR --prefix=$BOOST_INSTALL_DIR toolset=gcc variant=release link=static threading=multi runtime-link=static install 2>&1 | tee $BOOST_BUILD_DIR/build.log
error: Unable to find file or target named
error: 'boost/tr1/tr1/bcc32'
error: referred from project at
error: '.'
but the directory is there (it should be since it's just extracted from the zip file)
$ ls boost/tr1/tr1/bcc32/
array.h random.h regex.h tuple.h type_tra.h unordere.h
Getting closer but still need help! Thanks!
OK I got it working. The trick was to download the tar.bz2 file, not the zip file from sourceforge (specifically http://sourceforge.net/projects/boost/files/boost/1.53.0/). Even though both the zip and the tar.bz2 files are listed under the same file folder for the same version of Boost, the contents are different. There are some missing folders in the zip file, and the line ending conventions of the compressed files are different. At any rate after I downloaded and extracted the tar.bz2 file. I followed the instructions given here:
http://vijay.tech/articles/wiki/Programming/Cpp/Boost/BuildingBoostOnMinGw
and successfully built the Boost library from source using MinGW shell (mintty to be exact). There were some failures but probably not important: has_icu_test, has_iconv, has_icu_obj, has_icu64_obj, .masm. At the end it says
...failed updating 2 targets...
...skipped 3 targets...
...updated 10623 targets...
Hope this will help others in the future.
Do not use bash. Build it using cmd.exe.
bootstrap.bat gcc
Compiler executable should be on PATH.
Do not use bash. Build it using cmd.exe as described below:
Install MinGw on your system. I recommend using the same bit system as your processor is. Then set the path in System Environment to the bin folder which contains g++, ... (Compiler executable should be on PATH.) files. Now you are ready to go.
For obvious reasons, start a fresh terminal (cmd.exe), don't use the already open terminals that doesn't know your new setting.
Download boost, the latest stable release, unzip it and in the command window follow the path too the main directory of the extracted boost.
Run this command: bootstrap mingw
Run this command afterwards, which will install in the folder you select as your destination.
b2 install --prefix=c:\boost\custominstallationfolder\gcc toolset=gcc
Like said above, but more specifically for me compiling boost-1.54 with gcc-mingw-4.8.1
Using a Windows shell (cmd.exe) navigate to root of boost directory directory then
bootstrap.bat gcc
b2.exe toolset=gcc