Is it bad to have both MinGW and Msys2 installed? - gtk

I have minGW gcc installed on my computer from previous projects, and I have recently installed Msys2 so I could develop with GTK. Is it bad to have MinGW and a instance of MinGW on Msys2 installed on the same computer?

The only problem is that it might confuse you. It should not cause any real issues though, because MSYS2 does not add itself to your PATH environment variable, and when you run MSYS2 it will (by default) use a different PATH so you can only run Microsoft programs in C:\Windows and MSYS2 programs. So this means you won't accidentally run the compiler from one environment when you are in a different environment.

Related

I'm not able to use my C/C++ compiler on vscode

I followed the gcc compiler installation tutorial for windows from the vscode website: https://code.visualstudio.com/docs/cpp/config-mingw
And the bin folder (C:\msys64\mingw64\bin) is empty, so i'm not able to run the "g++ --version" by adding this path to the Windows path environment variable.
My alternative to it was to use the codeblocks compiler to run my code in vscode, by adding this path: (C:\Program Files\CodeBlocks\MinGW\bin) to the "path" selection in the windows environment variables.
I want to make the MSYS2 compiler work properly in my vscode.
Hope you guys can help me!
MSYS2 comes with a package manager pacman that you should use to install any components you need.
In your case, open the MSYS2 shell (by running mingw64.exe) and run the following commands:
pacman -Syu --noconfirm
pacman -S mingw-w64-x86_64-toolchain
The first command will tell the package manager to update it's database, the second command will get the MinGW-w64 64-bit GCC compiler.
If you don't really need MSYS2 (e.g. because you dan't plan to use the MSYS2 shell) you could also consider getting a standalone MinGW-w64 build from https://winlibs.com/

How to compile something using arm-none-eabi-gcc on windows

I am trying to build a project for a raspberry pi 4, using windows 10 as the building platform, I have the compiler installed, arm-none-eabi-gcc however every piece of information I've learned about it relates to how to run it on a linux machine, and I don't really want to run a vm just to load the linux environment, so how do I run the compiler on windows 10, Do I run it from Cmd? or is there a different method to do this?
You could check this PreBuilt GNU Toolchain for building natively on Win10.
Otherwise you could also setup a WSL environment in your win10, then you would also be able use any linux toolchains.
You can download the IDE DS-5 Community Edition
https://developer.arm.com/tools-and-software/embedded/legacy-tools/ds-5-development-studio/editions/community-edition
You can download the toolchains:
https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a/downloads
Then follow the steps in this tutorial:
https://developer.arm.com/tools-and-software/embedded/legacy-tools/ds-5-development-studio/resources/tutorials/getting-started-with-ds-5-ce-and-armv8-foundation-platform
https://community.arm.com/developer/tools-software/tools/b/tools-software-ides-blog/posts/running-bare-metal-software-on-the-raspberry-pi-3-using-arm-ds-5
You should have the arm-none-eabi-gcc.exe for Windows Compile.
Also, you have the linux environment like MinGW and use installed terminal(xterm).
then, you have to copy the .so files into MinGW /lib or /usr/lib folder under C:/MinGW.
Hope this would be helpful for you.

Clion gdb not found, but working with netbeans

I've seen some other stakoverflow question like this one:
CLion Installation: Cmake compilers not found, GDB not found
But it's not quite the same problem.
My problem is that only my gdb.exe is not found by Clion. I can compile and run programs without problem, but when i need to debug the program tell me that only the debbuger is incorrect.
The problem is that my gbd.exe is present in my cygwin/bin folder
and i have it also in my PATH (system variable)
What i've done so far:
delete, shutdown and reinstall cygwin from scratch.
Install Netbeans and try to run with cygwin config (and debugger) -> everthing is working and i can debug my program. I also try to select it manualy.
So the real question is why Clion think my gdb is not present?
An how can i make it work?
Thank you for your help
Try to install GDB version 7.10.1
My settings:
Short answer: check what versions of gcc, g++ and gdb you have installed. They should be of the same major version.
Long answer:
Try to launch gdb.exe from cygwin terminal. You will probably get something like this (I'm using mingw64 from msys2 so folder will be different):
$ gdb
C:/msys64/mingw64/bin/gdb.exe: error while loading shared libraries: libgcc_s_seh-1.dll:
cannot open shared object file: No such file or directory
But you have gcc installed so you will have this DLL inside C:/msys64/mingw64/bin (in your case folder is different). The problem is that your gdb and gcc are of different major versions. I got this problem when installed mingw-w64-x86_64-gcc-7.3.0-2 with mingw-w64-x86_64-gdb-8.2.1-1. That's why gdb was not able to launch and CLion was not able to check GDB version thus outputting "Not found" error.
If this is the case - remove gdb and install it again. Now with correct major version (same as gcc). Since you're using cygwin, launch cygwin setup again, search for gdb package (don't forget to change view to full) and change version to be the same as gcc. Or, alternatively, you can change gcc version to be the same as gdb (in my case this wasn't possible).

Installing Canopy in OSX and Linux in same home directory

I have a networked home directory, which is used by linux and OSX machines. I want to install the linux and OSX versions of Canopy so that I can use it from any machine.
I first installed the linux version by running the '.sh' file. Despite asking where I wanted to put Canopy, the installer puts most of the stuff in ~/Library/Enthought/Canopy_64bit/. This is a problem because later, when I try to install Canopy in OSX, it just assumes again that Canopy is in ~/Library/Enthought so somethings will be overwritten but other binaries will be kept untouched, and the whole thing doesn't work in OSX or Linux.
Is there a way to force the linux version to be installed somewhere else? From the documentation it seems that it used to be ~/Enthought, but it doesn't work for me.
I suspect the problem is with having your locations.cfg file in ~/.canopy which is shared by both the versions of Canopy. Can you try the following:
Install the Linux version of Canopy and run it.
Remove your ~/.canopy/locations.cfg
Install your OSX version, and see if that works?
When you go back to running your Linux version, it'll again prompt you for install locations for the user environment, where you could select the old Linux install location.
Even if this works, I'm not sure, this would be too convenient. Let me know, how it goes. :)

installing packages in cygwin without compiling from source

I have recently installed cygwin as I want to use (and learn) emacs and make it my regular text editor (as I use Notepad++ now).
The motivation for this comes from some sites like this:
http://batsov.com/articles/2011/08/19/a-peek-at-emacs24/
Also, I want to learn the internals of linux. I tried vi but its too CUIish for my taste. So I installed cygwin (with it's default emacs 23.3). But I wanted to try emacs 24 too so I want to install it side by side with cygwin's emacs 23.3. This can be done in a linux distro by installing emacs in /opt and making symlinks. But how do I install emacs binaries in cygwin?
From where do I get such binaries.
Currently I am using 'Emacs for Windows' seperately from cygwin, but it is hard to get it in a portable format. If I manage to install it in cygwin then my whole cygwin environment can be portable.
I generally try to install softwares so that they are portable as far as possible.
You can use the setup.exe that you used to install cygwin, to install Emacs as well.