I just installed cygwin, latest version. wanted to compile and run a simple file. when i open cygwin terminal and type any of the commands :gcc,cc,g++ it says command not found. what am I missing here
You're missing the gcc, cc, and g++ commands.
Not all packages are installed by default. You need to run setup.exe again and select gcc and gcc-g++ for installation. You'll find them under the Devel (development) category.
Related
I already installed the following packages version 4.3-1, gcc-core version 11.3.0-1, gcc-g++ version 11.3.0-1. However, when I run the make command after running the make config-alpha command, I get several errors on the screen. I already tried to install other versions of these packages but I still get the same results.errors that I got
Which other additional package should I install?
Assuming that SimpleScalar is the one here:
https://www.es.ele.tue.nl/~yhe/aca/Simplescalar_Download.html
the packaging is ancient (gcc gcc-2.7.2.3) and its manually crafted configure is not considering any recent platforms.
It seems very hard to adjust to a Cygwin build and you can not use the GCC Cygwin compiler for a cross build of a Alpha platform
Issue
When installing mingw on a fresh MSYS2 instance I run into the issue of gcc not found:
$ g++
bash: g++: command not found
Setup
Fresh MSYS2 install on relatively clean windows 10 install:
pacman -Syu
pacman -Su
pacman -S make
pacman -S mingw-w64-x86_64-gcc
Diagnostics
It appears that GCC is successfully installed into the directory /mingw64/bin
Yet my path consists of
/usr/local/bin:/usr/bin:/bin:/opt/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:
As such gcc is not found.
I have tried adding /mingw64/bin to the $PATH however this seems like a temporary fix of an underlying problem.
My question specifically is, is there any reason as to why either the mingw is not installed into the /usr/bin/ directory or the installation did not add itself to the path, and or any simple reason as to what is causing this.
Thanks in advance!
Since you installed mingw-w64-x86_64-gcc it seems like you want to compile 64-bit native Windows applications. Therefore, you should start MSYS2 by running mingw64.exe, found at the top level of your MSYS2 installation. That will put /mingw64/bin/ on your PATH and set some other useful environment variables.
Solution
I have found simply adding C:\msys64\mingw64\bin to the host windows computers PATH variable this, in turn, adds \mingw64\bin to the MSYS2 $PATH solving the problem.
I have a project writen with C99. It links to libcurl, generate makefile with cmake. Now, i want to explore the project to window env. I tried cygwin first, everything works except that final user need to install cygwin too.
After some search, mingw64 may archive my goal (build and use directly in window), but i could not find a full use guild for how to build linux project with mingw64 in ubuntu(linux).
Thanks for the help.
After some research, a solutions works:
install window cmake
install mingw-w64
mkdir build && cd build && cmake -G "MinGW Makefiles" ..
mingw32-make
MinGW may not support all API, some compatible job should be done.
When I try running clang-format in the Cygwin64 terminal, I get the following output:
$ clang-format
: CommandLine Error: Option 'disable-symbolication' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options
I also cannot run it in Git Bash, getting the following output:
$ clang-format
1 [main] clang-format (2208) C:\cygwin64\bin\clang-format.exe: *** fatal error - cygheap base mismatch detected - 0x180301410/0x1802FD410.
This problem is probably due to using incompatible versions of the cygwin DLL.
Search for cygwin1.dll using the Windows Start->Find/Search facility
and delete all but the most recent version. The most recent version *should*
reside in x:\cygwin\bin, where 'x' is the drive on which you have
installed the cygwin distribution. Rebooting is also suggested if you
are unable to find another cygwin DLL.
I only have one cygwin1.dll in C:\cygwin64\bin, and rebooting doesn't help.
clang --version gives:
$ clang --version
clang version 5.0.1 (tags/RELEASE_501/final)
Target: x86_64-unknown-windows-cygnus
Thread model: posix
InstalledDir: /usr/bin
This is not much of an answer, but it's what I ended up doing. And it was a little tricky, so I'm going to document it here.
Note, I actually downgraded doxygen, because the latest was dependent on clang-format-5
Uninstall clang 5.0.1-2
Uninstall doxygen 1.8.14-2 (automatically added)
Uninstall libclang5.0 5.0.1-2
Uninstall vim-clang-format 4.0.1-1
Install doxygen 1.8.13-3
Then (press Back)
Uninstall clang 5.0.1-2 (automatically added)
Uninstall doxygen 1.8.13-3 (automatically added)
Install clang 4.0.1-1
Install doxygen 1.8.13-3
After all that, although there is no-longer an entry for clang-format, I clang-format-4.0.1 is on my computer and operational.
I am trying to build some open source library. I need a package management system to easily download the dependencies. At first I am using MinGW and MSYS. But the included packages are limited. Someone told me to use Mingw-w64 and MSYS2.
I downloaded the mingw-w64-install from here. When running, it reports the following error. How can I fix it?
And by the way, from the Mingw-w64 download page, I see a lot of download links. Even Cygwin is listed. How are Cygwin and Mingw-w64 related?
My current understanding is, in the time of MinGW and MSYS, MSYS is just a nice addon to MinGW, while in Mingw-w64 + MSYS2, MSYS2 is stand-alone and Mingw-w64 is just a set of libraries it can work with. Just like Cygwin can download many different packages.
Unfortunately, the MinGW-w64 installer you used sometimes has this issue. I myself am not sure about why this happens (I think it has something to do with Sourceforge URL redirection or whatever that the installer currently can't handle properly enough).
Anyways, if you're already planning on using MSYS2, there's no need for that installer.
Download MSYS2 from this page.
After the install completes, click on the MSYS2 UCRT64 in the Start menu (or C:\msys64\ucrt64.exe).
If done correctly, the terminal prompt will say UCRT64 in magenta letters, not MSYS.
Update MSYS2 using pacman -Syuu. If it closes itself during the update, restart it and repeat the same command to finish the update.
You should routinely update your installation.
Install the toolchain: (i.e. the compiler and some extra tools)
pacman -S mingw-w64-ucrt-x86_64-toolchain
Install any libraries/tools you may need. You can search the repositories by doing
pacman -Ss name_of_something_i_want_to_install
e.g.
pacman -Ss gsl
and install using
pacman -S package_name_of_something_i_want_to_install
e.g.
pacman -S mingw-w64-ucrt-x86_64-gsl
and from then on the GSL library will be automatically found by your compiler!
Make sure any compilers and libraries you install have this package prefix: mingw-w64-ucrt-x86_64-. Only use unprefixed packages for misc command-line utilities (such as grep, sed, make, etc), unless you know what you're doing.
Verify that the compiler is working by doing
gcc --version
If you want to use the toolchains (with installed libraries) outside of the MSYS2 environment, all you need to do is add C:/msys64/ucrt64/bin to your PATH.
MSYS2 provides several compiler flavors, UCRT64 being one of them. It should be a reasonable default.
MSYS has not been updated a long time. MSYS2 is more active, and you can download it from MSYS2. It has both the mingw and cygwin fork package.
To install the MinGW-w64 toolchain (reference):
Open the MSYS2 shell from the start menu
Run pacman -Sy pacman to update the package database
Reopen the shell, and run pacman -Syu to update the package database and core system packages
Reopen the shell, and run pacman -Su to update the rest
Install the compiler:
For a 32-bit target, run pacman -S mingw-w64-i686-toolchain
For a 64-bit target, run pacman -S mingw-w64-x86_64-toolchain
Select which package to install; the default is all
You may also need make. Run pacman -S make
You can now also get the stand-alone personal build of MinGW-w64 from https://winlibs.com/ which doesn't require any installation; just extract and its ready to use. This allow having multiple toolchains on the same system (e.g., one for Windows 32-bit and another for Windows 64-bit).
The most straightforward way, as far as I know, is to use Chocolatey to install MinGW:
choco install mingw
Then check with the command whereis gcc. It is going to be installed in C:\ProgramData\chocolatey\bin.
one more thing, to get make working, just copie (or rename if you wish)
with copy mingw32-make.exe make.exe in C:\ProgramData\chocolatey\bin.