How to install working MinGW in my 32-bit Windows 10 - c

I'm a complete newbie to programming and I want to start learning C. I downloaded Visual studio code and MinGW, then tried to execute a simple 'hello world'. However, I get this error:
This version of C:\MinGW\bin\gcc.exe is not compatible with the version of Windows you're running.
After some searching, I think I have figured out that it is because I'm using Windows 10 32-bit. I can't find helpful videos or tutorials. What should I do?

Try with MinGW-w64 (e.g. from https://winlibs.com/) instead of old MinGW, and make sure VSCode is properly configured for it (see: https://code.visualstudio.com/docs/cpp/config-mingw).

Related

I have installed MinGW and codelite and everything works except showing "locals" when stoping at a breakpoint when debugging

I have installed recently on my windows 10 the MinGW for using it on C development plus codelite.
Everything works, I can compile and run programs, but I can't find the way to make the debugger show me the value of locals. I am newbie on software development world and I have no idea what can be missing.
I downloaded mingw, installed it for c and c++ languages, added the paths on the environment variables config and then installed codelite, where I could scan the MinGW compiler.
If anyone can guide, I would by highly grateful.
Best regards,

installing GSL library for C programming in windows

I want to install the GSL library (https://www.gnu.org/software/gsl/) in windows. I have downloaded the files but i do not know what to do apart from that in order to be able to use the functions of the library (apart from the #include <...> in my program.c file).
I am using visual studio code and i have installed mingw.
Thanks in advance
EDIT
I am adding more information about this issue. I am not the original poster, but I have the same problem.
I am trying to use the GSL and I work with Visual Studio Code on Windows 10.
I have already installed the basic packages to work with C/C++ in
Visual Studio Code. More precisely, if I am not wrong, VS Code is
using the compiler gcc.exe from mingw64 (last version). This was
installed using an 'extension' available at VS Code (https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools).
I downloaded the last version of the GSL (2.7) and unzipped it.
I get stuck when I try to follow the installation instructions. When I
execute either .\configure or ./configure in the DOS command line,
I get an error of "unknown command" (even if I am placed in the same directory where the file is stored).
When I execute .\configure in PowerShell, I get a message asking me
which programme should be used to open this file.
And here is where I get lost. :/
I have discovered an alternate path, which is installing GSL from vcpkg (https://vcpkg.io/). This is suggested by VS Code, actually. This vcpkg seems to be a programme by Microsoft to make it easier to install third-party C/C++ packages in Windows.
The specifications to install vcpkg are (https://vcpkg.io/en/getting-started.html):
Windows 7 or newer
Git
Visual Studio 2015 Update 3 or newer
I can try this path, but first I would like to be sure there is no easier way (installing Visual Studio to not really use it seems a lot to me!).

lldb Windows errors with clang 10

I have clang 10.0.0 for Windows installed from here
I also used the community VS installer to install 3 components that I understood were needed for clang 10:
C++ 2019 Redistributable Update
MSVC v142 - VS 2019 C++ x64/x86 build tools (v14.26)
Windows 10 SDK (10.0.18362.0)
clang itself works ok - I can compile, link with -fuse-ld=lld, run some code with concepts, std::span, looks good.
When I run lldb.exe, I get:
..python36.dll was not found..
If I put python36.dll on the path, I then get:
The application was unable to start correctly (0xc000007b)..
I'm learning C++, wanted to start using a debugger but I'm getting stuck here.
Do I need to install the entire Python 3.6 for this to work? (I have 3.8 already installed)
I needed the 64bit version of python36.dll, got it from wikidll

How to install C Compiler to Eclipse?

I have install the C/C++ CDT Version of Eclipse.
After making a HelloWorld.c file and get the code in there I get an error of "Launch failed. Binary not found".
I found in google that my Eclipse miss the compiler and I install MinGW on my computer and add the path to env variables (tested it with "gcc -v" in cmd and succeded).
But poorly it get the same Launch Failed error - any ideas, what step I forgot?
Some things to check:
1.) MinGW tools are installed as well. Make sure you have the C compiler and the Make program
2.) Check your Environment variables. Make sure both the compiler and Make are on the path.
3.) Eclipse is a temperamental beast at times, don't lose heart :-)
4.) If you're looking for a good IDE (without care for ideological concerns), might be worth looking at Bloodshed C++ IDE and Visual C++ 2010 express (or whatever they call their free version).
5.) Check the options menu in Eclipse to make sure it's looking at the correct environment variables for finding the Path.
IMHO, the simplest setup for eclipse on windows these days is cygwin - it seems to have been updated more recently than mingw, and works better.
Go to http://www.cygwin.com/, download the installer, select the default directory of c:\cygwin. Select 'All users'.
When it offers a list of packages, select 'gcc', 'binutils' and 'make' under the 'devel' category.
Add c:\cygwin\bin to your windows environment PATH.
Make sure Eclipse knows where to find your gcc compiler. An easier way would be to use EasyEclipse until you are more comfortable with your dev env.
I needed to move from the MinGW gcc to the CygWin gcc - all the C++2011 works and others say it is a better option too. Download the CygWin binaries etc. and then open up Eclipse.
In project properties, C/C++ Build -> Environment and set the CYGWIN_HOME variable. This worked fine for me on Eclipse Kepler Windows 7 (64Bit)
I also put the cygwin bin directory at the front of my Windows PATH variable.
Full details here:
http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.cdt.doc.user%2Fconcepts%2Fcdt_o_home.htm
You can try installing wascana. It automatically set up GNU compiler for you on Windows.

How does one configure Eclipse to compile using -std=c99?

The question is in the title. Using GCC version 3.4.5 on Windows Vista and a recent version of the Eclipse C/C++ IDE (not sure what version exactly because it's hard to figure out which version is the one for the whole IDE, but I downloaded it two weeks ago so it can't be that old).
This depends on the build system you use, but you can always try adding the "CFLAGS=-std=c99" as a build and/or environment variable the the builder.

Resources