Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
0
votes
0
answers
248
views
Starting processes is very slow in git bash on Windows
I'm running git bash 2.45.2.1 on a windows computer (for work) and I've noticed that running even basic processes can be extremely slow. For example, ``` $ time /usr/bin/echo 1 > /dev/null real 0m0.102s user 0m0.015s sys 0m0.015s ``` ``` $ time /usr/bin/echo 1 | wc > /dev/null real 0m0.151s user 0m0...
I'm running git bash 2.45.2.1 on a windows computer (for work) and I've noticed that running even basic processes can be extremely slow.
For example,
$ time /usr/bin/echo 1 > /dev/null
real 0m0.102s
user 0m0.015s
sys 0m0.015s
$ time /usr/bin/echo 1 | wc > /dev/null
real 0m0.151s
user 0m0.031s
sys 0m0.030s
Why would it take this version of bash a whole 0.1 s to spawn a process? Is this a Windows problem? Can this be fixed?
This can get **very** slow if I pipe even a hundred lines to xargs
.
I don't think the slowness can be the hardware's fault. This computer's processor is a 13th Gen Intel Core i9-13950HX.
SU3
(204 rep)
Nov 19, 2024, 01:44 AM
3
votes
2
answers
133
views
MinGW/MSys 2 doesn't seem to recognize TZ environment variable
I work on a legacy system originally written in C for 3b2 SVR3, later in C++ for Sun/Solaris, now mainly for Linux. We have a few users who require our apps to run on Windows Servers, so we have accommodated that for the last 18 years using MSys / MinGW, cross compiled from our *nix-based developmen...
I work on a legacy system originally written in C for 3b2 SVR3, later in C++ for Sun/Solaris, now mainly for Linux. We have a few users who require our apps to run on Windows Servers, so we have accommodated that for the last 18 years using MSys / MinGW, cross compiled from our *nix-based development machines. We're now trying to upgrade to MSys 2 and have run into what appears to be an intractable problem that no amount of searching has turned up an answer to.
Our application works across multiple time zones simultaneously. We can't rely on a static system time zone setting to operate properly. We get our time zone definitions from the IANA database, installed as zoneinfo files in the traditional locations, depending upon environment. We update zoneinfo for our users as the need arises.
For as long as I can remember (I've worked on this for nearly 30 years), it was adequate to
putenv("TZ=");
tzset();
to get methods like mktime() and localtime() to produce the information we needed. That has stopped working now that we've moved to MSys 2.
Additionally, most of our code doesn't care what the initial time zone is, but one method insists that the TZ variable have some value (any value, it doesn't care). It really doesn't matter why TZ must be set - that code exposes another symptom that we might not otherwise have noticed so quickly: upon entry to any of our programs, the TZ environment variable has been removed from the environment.
The final curiosity is that MSys 2 comes with a **date** program that seems to work just fine with the TZ environment variable, as do **printenv** and **ls**, seeming to indicate that what we need to do *can* be done.
We have a short test program we've been using to demonstrate the problem and with any luck, prove that we've found a solution:
#include
#include
#include
int
main(int argc, const char *const *argv)
{
const char *tz = getenv("TZ");
const char *ptz = tz ? tz : "TZ not set";
printf("at entry: %s\n", ptz);
time_t now = time(NULL);
putenv("TZ=US/Pacific");
tzset();
printf("in %s it is now %s", getenv("TZ"), ctime(&now));
putenv("TZ=US/Eastern");
tzset();
printf("in %s it is now %s", getenv("TZ"), ctime(&now));
return 0;
}
When I run the above on our Linux dev machine, I get the following output:
$ printenv TZ
US/Central
$ date "+%F %T %Z"
2024-08-15 10:20:55 CDT
$ ./msystest
at entry: US/Central
in US/Pacific it is now Thu Aug 15 08:20:55 2024
in US/Eastern it is now Thu Aug 15 11:20:55 2024
Under MSys 2, just seconds later, I get the following:
$ printenv TZ
US/Central
$ date "+%F %T %Z"
2024-08-15 10:20:57 CDT
$ ./msystest
at entry: TZ not set
in US/Pacific it is now Thu Aug 15 16:20:57 2024
in US/Eastern it is now Thu Aug 15 16:20:57 2024
Using **ldd** on MSys 2, we've noticed that there are different DLLs referenced by **date** and **msystest**:
$ ldd /usr/bin/date
ntdll.dll => /c/Windows/SYSTEM32/ntdll.dll (0x7ff962d20000)
KERNEL32.DLL => /c/Windows/System32/KERNEL32.DLL (0x7ff961b30000)
KERNELBASE.dll => /c/Windows/System32/KERNELBASE.dll (0x7ff960340000)
msys-intl-8.dll => /usr/bin/msys-intl-8.dll (0x430b30000)
msys-2.0.dll => /usr/bin/msys-2.0.dll (0x180040000)
msys-iconv-2.dll => /usr/bin/msys-iconv-2.dll (0x5603f0000)
$ ldd msystest
ntdll.dll => /c/Windows/SYSTEM32/ntdll.dll (0x7ff962d20000)
KERNEL32.DLL => /c/Windows/System32/KERNEL32.DLL (0x7ff961b30000)
KERNELBASE.dll => /c/Windows/System32/KERNELBASE.dll (0x7ff960340000)
msvcrt.dll => /c/Windows/System32/msvcrt.dll (0x7ff962790000)
So our question is - is our problem the result of the differing DLLs, and if so, how do we get the msys DLLs built into our programs rather than the msvcrt DLL?
We've done a lot of searching online to try to resolve this to little avail. We usually get 1 of 2 answers:
1. Windows doesn't work that way so you can't do what you want with MSys
2. This is how you build a DLL with MinGW
Needless to say, the answers are either (1) wrong, or (2) answering the wrong question. Any help anyone can provide/point us to would be invaluable.
monkboon's evil twin
(41 rep)
Aug 15, 2024, 04:33 PM
• Last activity: Sep 24, 2024, 10:43 PM
11
votes
1
answers
10189
views
How to statically link missing libgcc_s_seh-1.dll and libstdc++-6.dll DLLs for 9.3-win32 MinGW executable
I want to compile a simple Windows application on Linux using MinGW. I compile as follows: x86_64-w64-mingw32-g++ -L. -l:mathlib.dll -o fib main.cpp mathlib.h This results in an executable `fib` that computes the N'th fibonacci number using a function imported from `mathlib.dll`. Now, when executing...
I want to compile a simple Windows application on Linux using MinGW.
I compile as follows:
x86_64-w64-mingw32-g++ -L. -l:mathlib.dll -o fib main.cpp mathlib.h
This results in an executable
fib
that computes the N'th fibonacci number using a function imported from mathlib.dll
.
Now, when executing fib
on Windows, it complains that libgcc_s_seh-1.dll
and libstdc++-6.dll
are missing.
If I copy these DLLs to Windows, then everything works, but I'd like not to copy these MinGW dependencies with every executable.
How can I statically link these MinGW depencies, such that foo
depends on no other DLLs than mathlib.dll
?
Shuzheng
(4931 rep)
Feb 8, 2021, 01:10 PM
• Last activity: Jan 17, 2024, 07:27 AM
2
votes
2
answers
4360
views
chmod not working in minGW64 but working Cygwin?
I need to do some file permission changes on win10, while I can run this command under cygwin but not in git bash minGW64, can someone help to explain why? The result as from the cygwin terminal: ``` $ chmod 777 testfile $ ls -l total 0 -rwxrwxrwx 1 Jon Domain Users 0 Nov 1 11:57 testfile ``` But in...
I need to do some file permission changes on win10, while I can run this command under cygwin but not in git bash minGW64, can someone help to explain why?
The result as from the cygwin terminal:
$ chmod 777 testfile
$ ls -l
total 0
-rwxrwxrwx 1 Jon Domain Users 0 Nov 1 11:57 testfile
But in mingw64:
$ touch test
-rw-r--r-- 1 jon 1049089 0 Nov 1 12:17 test
$ chmod 777 test
$ ll
-rw-r--r-- 1 jon 1049089 0 Nov 1 12:17 test
and while I am using chmod I am not even getting error msg.
How can I solve the problem to make the chmod working?
Tiger
(367 rep)
Nov 1, 2019, 04:20 PM
• Last activity: Jan 11, 2024, 10:10 PM
0
votes
1
answers
632
views
using mingw on Linux Mint
I need to build Windows binaries from a conventional source tarball. I recall that I used to do this in a RedHat environment using specialised configure and make scripts from mingw packages. But I'm now on Linux Mint and have no idea. What packages do I need? What do I use to configure and make? The...
I need to build Windows binaries from a conventional source tarball. I recall that I used to do this in a RedHat environment using specialised configure and make scripts from mingw packages. But I'm now on Linux Mint and have no idea. What packages do I need? What do I use to configure and make? The source files are in C and gcc is fine.
user22108
(101 rep)
Oct 8, 2023, 01:42 PM
• Last activity: Oct 8, 2023, 02:08 PM
1
votes
0
answers
262
views
Tmux: Scroll buffer not working on MSYS2/MINGW64 (Git for Windows SDK)
I installed the [Git for Windows SDK](https://github.com/git-for-windows/build-extra) on Windows 11 to have the `pacman` package installer available to install `tmux`. A lot of stuff works like it used to be on other platforms, but scrolling back using PREFIX + [ does not really work. I can see how...
I installed the [Git for Windows SDK](https://github.com/git-for-windows/build-extra) on Windows 11 to have the
pacman
package installer available to install tmux
.
A lot of stuff works like it used to be on other platforms, but scrolling back using PREFIX+[ does not really work.
I can see how the terminal enters scroll mode (yellow counter in the top right), but I can't move at all and its frozen at 0/XX
. All I can do is exit scrolling with C-c
.
How can I fix this issue?
My .tmux.conf
:
# prefix
unbind C-b
set -g prefix C-t
bind C-t send-prefix
# behavior
set -g escape-time 10 # see https://github.com/tmux/tmux/issues/353#issuecomment-294570322
set -g repeat-time 550 # allows holding down array keys for continuous strokes on MacOS
# theme
set -g default-terminal "screen-256color"
set -g status-bg color234
set -g status-fg white
set-window-option -g window-status-current-style bg=color233
bind § command-prompt -p "(set status-bg)" "set status-bg %1"
# rename
bind $ command-prompt "rename-session '%%'"
bind , command-prompt "rename-window '%%'"
# persistent cwd
bind c new-window -c "#{pane_current_path}"
bind '"' split-window -c "#{pane_current_path}"
bind % split-window -h -c "#{pane_current_path}"
# reload config
bind r source-file ~/.tmux.conf
Martin Braun
(287 rep)
May 30, 2023, 03:22 AM
0
votes
1
answers
41
views
How can I en- and decompress a bootable image?
I have a bootable kernel image, that I had created with MinGW Toolchain's that available for Microsoft Windows 11. The Project is in size tiny, but I would know: "How can I shrink the image, if it grow to pass it on a Floppy Disk." Thanks for Ideas. Edit: You can found a Example OS for this request...
I have a bootable kernel image, that I had created with MinGW Toolchain's that available for Microsoft Windows 11.
The Project is in size tiny, but I would know: "How can I shrink the image, if it grow to pass it on a Floppy Disk."
Thanks for Ideas.
Edit:
You can found a Example OS for this request at my git account: [**paule32**](https://github.com/paule32/JustFunOS_win32/releases/tag/Release)
Jens
(1 rep)
Dec 27, 2022, 08:48 PM
• Last activity: Feb 22, 2023, 11:20 PM
1
votes
1
answers
828
views
Building a cross-compile (mingw) environment
I work in a Debian environment and it works great. If I want to build a project, I `sudo apt install` the build dependencies, and build. However, I'd like to cross-compile from a Debian environment using mingw-w64. I don't have any `-w64` versions of my build-dependencies, so I'll have to build thos...
I work in a Debian environment and it works great. If I want to build a project, I
sudo apt install
the build dependencies, and build.
However, I'd like to cross-compile from a Debian environment using mingw-w64. I don't have any -w64
versions of my build-dependencies, so I'll have to build those.
Is there a method to apt source
, then dpkg-buildpackage
using a specific toolchain?
I'm guessing [--target-arch
](https://man7.org/linux/man-pages/man1/dpkg-buildpackage.1.html) is close to what I need, but I suspect w64 isn't a supported architecture.
I see http://clang.debian.net describes a method to build the debian archive with clang involving:
cd /usr/bin
rm /usr/bin/{g++,gcc,cpp}
ln -s /usr/bin/clang++ /usr/bin/g++
ln -s /usr/bin/clang /usr/bin/{gcc,cpp}
Is that a reasonable method to accomplish this? (but mingw
instead of clang
)?
Stewart
(15631 rep)
Aug 26, 2022, 02:39 PM
• Last activity: Aug 26, 2022, 03:40 PM
0
votes
1
answers
401
views
MSYS2: Command works fine in terminal, but syntax error `(' in script
On Windows, with MSYS2, I want to add the file extension for an executable back to the output of `which`, if it has one. Here's a one-liner: ```bash locAlt="$(which "mingw32-make")" ; echo "$locAlt" ; locAlt=("$locAlt"+(|.*)) ; echo "$locAlt" ``` When run in the MSYS2 MinGW terminal, this works just...
On Windows, with MSYS2, I want to add the file extension for an executable back to the output of
which
, if it has one. Here's a one-liner:
locAlt="$(which "mingw32-make")" ; echo "$locAlt" ; locAlt=("$locAlt"+(|.*)) ; echo "$locAlt"
When run in the MSYS2 MinGW terminal, this works just fine on my machine and prints:
/mingw64/bin/mingw32-make
/mingw64/bin/mingw32-make.exe
However, now I put the same line into a script (one-liner.sh
):
#/bin/bash
locAlt="$(which "mingw32-make")" ; echo "$locAlt" ; locAlt=("$locAlt"+(|.*)) ; echo "$locAlt"
I tried both nano
and Notepad++
(where you can choose line endings, and they're set to "UNIX (LF)", and checked the output of cat -v one-liner.sh
, which shows the file as above (no ^M
, as in this question ).
However, when trying to run the file with ./one-liner.sh
, I get the error
./one-liner.sh: line 2: syntax error near unexpected token `('
./one-liner.sh: line 2: `locAlt="$(which "mingw32-make")" ; echo "$locAlt" ; locAlt=("$locAlt"+(|.*)) ; echo "$locAlt"'
Why could that be?
RL-S
(141 rep)
Aug 12, 2022, 07:33 AM
3
votes
2
answers
4044
views
how to install csvkit in bash
Kusalananda nicely recommends using `csvformat` from [csvkit](https://csvkit.readthedocs.io/en/latest/) to format `jq` `@csv` into a csv format without double quotes `"` [answering how to parse json with jq](https://unix.stackexchange.com/a/506790/530603). This answer does not seem to involve the us...
Kusalananda nicely recommends using
csvformat
from [csvkit](https://csvkit.readthedocs.io/en/latest/) to format jq
@csv
into a csv format without double quotes "
[answering how to parse json with jq](https://unix.stackexchange.com/a/506790/530603) .
This answer does not seem to involve the use of python. But the csvkit [installation tutorial](https://csvkit.readthedocs.io/en/latest/tutorial/1_getting_started.html#installing-csvkit) and its [installation troubleshooting](https://csvkit.readthedocs.io/en/latest/tricks.html#troubleshooting) do seem to rely on, perhaps require, the use of python. This makes me, a newbie, confused:
Is it possible to install csvkit in git bash without using python (read: open spyder or anaconda, let's say)? How?
**Edit.** MINGW64 (git bash) displays bash: pip: command not found
. Same for conda
.
How do you recommend moving on from there?
python is installed, pip.exe being in ...\Anaconda\Scripts
. There are several suggested solutions on other sites e.g. in various ways adding the dir of pip.exe to PATH [here](https://www.stackoverflow.com/questions/6318156/adding-python-to-path-on-windows) and [here](https://www.stackoverflow.com/question/32597209/python-not-working-in-the-command-line-of-git-bash)) .
Johan
(439 rep)
Jun 20, 2022, 05:40 PM
• Last activity: Jun 22, 2022, 12:17 PM
4
votes
1
answers
1257
views
Interactive bash in Docker under mingw on Windows
I'm using a bash shell (Mingwg64) on windows, to run bash from a docker container. ``` Tobi@DESKTOP MINGW64 / $ docker run -i debian bash ls ``` gives the result: `bash: line 1: $'ls\r': command not found` which from what I can tell is because there's a `\r` prepended to the usual `\n` when I press...
I'm using a bash shell (Mingwg64) on windows, to run bash from a docker container.
Tobi@DESKTOP MINGW64 /
$ docker run -i debian bash
ls
gives the result: bash: line 1: $'ls\r': command not found
which from what I can tell is because there's a \r
prepended to the usual \n
when I press the enter key - as I'm on windows.
Anyone know a good fix for this?
Tobi
(143 rep)
Nov 16, 2021, 06:35 PM
• Last activity: Nov 16, 2021, 07:24 PM
5
votes
1
answers
23853
views
E: Unable to locate package mingw32, Linux Mint
I would like to compile some C programs for Windows. So I used a search engine and I found that I probably need to install `mingw32`. If I run: sudo apt-get install mingw32 and I got: > E: Unable to locate package mingw32 So, I used a search engine again, and I found [this answer on AskUbuntu][1] an...
I would like to compile some C programs for Windows. So I used a search engine and I found that I probably need to install
mingw32
.
If I run:
sudo apt-get install mingw32
and I got:
> E: Unable to locate package mingw32
So, I used a search engine again, and I found this answer on AskUbuntu and this answer on StackOverflow .
I ran:
sudo add-apt-repository universe
and:
sudo apt-get update
But I still the same error. What can I do to solve it?
Nati V
(165 rep)
May 27, 2017, 10:42 AM
• Last activity: Mar 10, 2021, 08:28 AM
5
votes
3
answers
14132
views
Where can I find and install the mingw-w64 packages for centos-7?
Trying to get cross compiling working on centos7. (I have jenkins running in that environment.) There is a lot of out of date documentation on the web for mingw. Apparently there was an answer **[here][1]** but is gone. The cross compilation steps are discussed **[here][2]**. I can do a **sudo yum g...
Trying to get cross compiling working on centos7. (I have jenkins running in that environment.) There is a lot of out of date documentation on the web for mingw. Apparently there was an answer **here ** but is gone. The cross compilation steps are discussed **here **. I can do a **sudo yum groupinstall -y packagename**, but nothing I try works (MinGW-64 mingw-64 mingw64, MinGW64, or MinGW cross-compiler) as I have seen in various posts and forums. I also tried downloading the source but had no luck with that also as various pre-requsites are missing, and when I try and obtain them they don't exist or are the wrong version.
ggb667
(171 rep)
Nov 30, 2016, 07:49 PM
• Last activity: Feb 5, 2021, 08:15 AM
0
votes
1
answers
61
views
Failed attempt to expect and send
I'm trying to write a script which git clone. my script: git clone ssh://git@domain.com/myproject.git expect "Enter passphrase for key..." send "myPassword" read -p "enter..." and after run it I got: Cloning into 'myproject'... Enter passphrase for key...: | and the program is waiting for password n...
I'm trying to write a script which git clone.
my script:
git clone ssh://git@domain.com/myproject.git
expect "Enter passphrase for key..."
send "myPassword"
read -p "enter..."
and after run it I got:
Cloning into 'myproject'...
Enter passphrase for key...: |
and the program is waiting for password now, it seems like 'expect' and 'send' don't work properly.
What can be wrong in my script ?
discCard
(101 rep)
Dec 15, 2020, 12:38 PM
• Last activity: Dec 17, 2020, 05:18 PM
0
votes
1
answers
309
views
How to compile lighttpd .tar file using cygwin to run executable file in Windows 10
I have downloaded [lighttpd tar](https://www.lighttpd.net/) file and I need it to compile it using cygwin for Windows 10 machine. I did some extensive research on how to compile lighttpd files using cygwin in google but most of the articles are very old. I need some guidance. ***UPDATE*** I know I n...
I have downloaded [lighttpd tar](https://www.lighttpd.net/) file and I need it to compile it using cygwin for Windows 10 machine.
I did some extensive research on how to compile lighttpd files using cygwin in google but most of the articles are very old.
I need some guidance.
***UPDATE***
I know I need to use Mingw application to compile
LighTpd file to make it a Standalone application.
I tried looking up instruction online but I couldn't find any.
krillavilla
(111 rep)
Sep 19, 2020, 09:34 AM
• Last activity: Nov 14, 2020, 08:12 AM
1
votes
1
answers
1245
views
CentOS 8 Mingw Compile Error with cc1plus
I recently setup a fresh install of CentOS 8 to use the Mingw Compiler for C++ (I believe it's removed from CentOS 7). Everything was installed as follows yum -y groupinstall "Development Tools" yum --enablerepo=PowerTools install mingw32-gcc yum --enablerepo=PowerTools install mingw64-gcc Which did...
I recently setup a fresh install of CentOS 8 to use the Mingw Compiler for C++ (I believe it's removed from CentOS 7).
Everything was installed as follows
yum -y groupinstall "Development Tools"
yum --enablerepo=PowerTools install mingw32-gcc
yum --enablerepo=PowerTools install mingw64-gcc
Which did give me the commands I wanted both
i686-w64-mingw32-gcc
and x86_64-w64-mingw32-gcc
(specifically for targeting Windows builds)
I am unable to use them though because calling both on a simple cpp file gives the error
x86_64-w64-mingw32-gcc: error trying to exec 'cc1plus': execvp: No such file or directory
I can still compile for Linux with the g++
command though without any issue but what am I missing to be able to use the Mingw compilers?
*UPDATE*
By the way this CentOS 8 is running in Docker, I don't know if that makes a difference
TheLovelySausage
(4443 rep)
Sep 29, 2020, 06:50 AM
• Last activity: Sep 29, 2020, 08:42 AM
0
votes
1
answers
344
views
How to upgrade lighttpd on Windows 10 using Cygwin/Mingw
There is this project I took from a client who my friend who owes Gym. They have a POS security scan every month because they use the credit card machine. if they don't pass the security scan, they get charge until next month. In order for the owner to pass the security check is to have current web...
There is this project I took from a client who my friend who owes Gym.
They have a POS security scan every month because they use the credit card machine.
if they don't pass the security scan, they get charge until next month. In order for the owner to pass the security check is to have current web service running in the background.
I have to install Lighttpd web server on his Windows 10 as a localhost service running in the background a year ago. It passed the security scan. Now, the program [lighttpd] (http://lighttpd.dtech.hu/) is outdated.
The current version is 1.4.55 [Light](https://www.lighttpd.net/download/) but the only available file is .tar.
I tried looking up on Google how to upgrade lighttpd on windows 10 or install the latest version of lighttpd from scratch LightTPD but I came up short.
I need some guidance on how to proceed. Currently, I am using Windows 10 on VMWare Workstation virtual machine on Ubunut OS laptop
***UPDATE***
I found some articles how to setup lighttpd web services on Google:
But they are outdated by several years ago.
***UPDATE #2***
I installed Ubuntu WSL on the windows 10 machine for testing but the localhost only runs if ubuntu program window is open. if its close, the service will stop.
I am looking for Standalone program or maybe have Cygwin running in the background for LightTPD
krillavilla
(111 rep)
Sep 29, 2020, 06:22 AM
• Last activity: Sep 29, 2020, 07:41 AM
0
votes
1
answers
1908
views
Cannot cross-compile SDL2 with Mingw-w64 on Ubuntu
[SDL downloads][1] I am on Ubuntu using WSL2 and I want to create an executable that will run on Windows. Currently I can build executables for linux just fine. I downloaded the SDL MinGw windows development tools (link above) to my /opt folder. When I execute `make cross`, I receive this output: fo...
SDL downloads
I am on Ubuntu using WSL2 and I want to create an executable that will run on Windows. Currently I can build executables for linux just fine. I downloaded the SDL MinGw windows development tools (link above) to my /opt folder. When I execute
make cross
, I receive this output:
for arch in i686-w64-mingw32 x86_64-w64-mingw32; do \
make install-package arch=$arch prefix=/usr/local/$arch; \
done
make[1] : Entering directory '/opt/SDL2-2.0.12'
*** ERROR: i686-w64-mingw32 or /usr/local/i686-w64-mingw32 does not exist!
make[1] : *** [Makefile:21: install-package] Error 1
make[1] : Leaving directory '/opt/SDL2-2.0.12'
make[1] : Entering directory '/opt/SDL2-2.0.12'
*** ERROR: x86_64-w64-mingw32 or /usr/local/x86_64-w64-mingw32 does not exist!
make[1] : *** [Makefile:21: install-package] Error 1
make[1] : Leaving directory '/opt/SDL2-2.0.12'
make: *** [Makefile:16: cross] Error 2
If I search for those I get
which i686-w64-mingw32-g++
/usr/bin/i686-w64-mingw32-g++
which x86_64-w64-mingw32-g++
/usr/bin/x86_64-w64-mingw32-g++
/usr/bin is on my path and I see executables with those names in the /opt/SDL2-2.0.12
folder.
The genesis of this is when I try to compile my SDL program with x86_64-w64-mingw32-g++ instead of g++.
smuggledPancakes
(103 rep)
Jun 10, 2020, 02:09 PM
• Last activity: Jun 10, 2020, 02:41 PM
0
votes
1
answers
1489
views
How to install MinGW on RH 7 without internet?
I am trying to install MinGW on a Linux Red Hat 7 machine. Unfortunately I have no internet on that machine for security reasons, although I can copy over files. This question tells me that there should be MinGw in the EPEL 7. https://unix.stackexchange.com/questions/327156/where-can-i-find-and-inst...
I am trying to install MinGW on a Linux Red Hat 7 machine. Unfortunately I have no internet on that machine for security reasons, although I can copy over files.
This question tells me that there should be MinGw in the EPEL 7.
https://unix.stackexchange.com/questions/327156/where-can-i-find-and-install-the-mingw-w64-packages-for-centos-7
So I was able to install EPEL 7 following the directions here: https://fedoraproject.org/wiki/EPEL However I did have to manually download the epel-release-latest-7.noarch.rpm package, and then run
yum install
However, then I get stuck. I try sudo yum install mingw64-gcc
, and I get a long error message ending in:
One of the configured repositories failed (Unknown),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:
1. Contact the upstream for the repository and get them to fix the problem.
2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).
3. Run the command with the repository temporarily disabled
yum --disablerepo= ...
4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:
yum-config-manager --disable
or
subscription-manager repos --disable=
5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:
yum-config-manager --save --setopt=.skip_if_unavailable=true
Cannot retrieve metalink for repository: epel/x86_64. Please verify its path and try again
So, I try both sudo yum install mingw64-gcc --disablerepo=x86_64
and sudo yum install mingw64-gcc --disablerepo=epel/x86_64
, as the error message suggests, and I get the same message both times.
At this point, I suspect the issue is yum can't find EPEL packages because I have no internet, and I am failing due to that.
I also tried sudo yum --enablerepo=extras install epel-release
since that was suggested in some posts but that also failed. I don't know what this is, but I suspect that just installs EPEL 7, which I have already done.
Questions:
1. Are the EPEL packages like MinGw contained within the the epel-release-latest-7.noarch.rpm package I downloaded? Or does the sudo yum install mingw64-gcc
command go to some URL and try to get mingw from there?
2. If sudo yum install mingw64-gcc
is trying to get MinGw information from some other location on the internet, is there a way I can download it and copy it over the way I did with EPEL 7?
3. Finally, it looks like my attempt to install minGw is failing because EPEL 7 can't get info for some other packages which I don't think should be related to MinGw (x86). This is a guess though. If that is the case, can I tell yum to stop looking for all other repos other than mingw?
Finally, I am really just trying to install MinGw on my RH 7 without internet, so if anyone has some other way to do that, I will be happy with that.
John Smith
(1 rep)
Mar 9, 2020, 04:39 PM
• Last activity: Mar 9, 2020, 04:51 PM
-1
votes
1
answers
189
views
Exclude file paths from a list based on contents of the files
I have a command that I execute that gives me a list of relative paths to files under a directory. Think in terms of using `find my_dir`, although the command itself is different. For each file in the list, I want to pipe it into a command that will filter the list down depending on contents of the...
I have a command that I execute that gives me a list of relative paths to files under a directory. Think in terms of using
find my_dir
, although the command itself is different.
For each file in the list, I want to pipe it into a command that will filter the list down depending on contents of the file itself. I'm looking for semantics identical or similar to egrep -v
but it needs to open & read the file to run the regex on the file contents instead of the path itself.
How can I accomplish this using a simple piped command stream? Example:
find some_dir/ | egrep_contents -v 'Exclude pattern' | xargs -n1 do_something_with_filtered_files
In this case, egrep_contents
is ideally the command I'm asking for in this question. It would run the specified exclude pattern on each line in the file until it finds a match. If a match is found, it prevents that file path from being passed down to the next piped command.
For context, I'm running these commands in Git Bash included with Git for Windows (MINGW).
void.pointer
(355 rep)
Feb 28, 2020, 03:44 PM
• Last activity: Feb 28, 2020, 06:04 PM
Showing page 1 of 20 total questions