How do I compile and link a 32-bit Windows executable using mingw-w64

That depends on which variant of toolchain you’re currently using. Both DWARF and SEH variants (which come starting from GCC 4.8.0) are only single-target. You can see it yourself by inspecting the directory structure of their distributions, i.e. they contain only the libraries with either 64- or 32-bit addressing, but not both. On the other … Read more

Serial Port (RS -232) Connection in C++

Please take a look here: RS-232 for Linux and Windows 1) Windows Serial Port Programming 2) Using the Serial Ports in Visual C++ 3) Serial Communication in Windows 1) You can use this with Windows (incl. MinGW) as well as Linux. Alternative you can only use the code as an example. 2) Step-by-step tutorial how … Read more

CMAKE_MAKE_PROGRAM not found

I have two suggestions: Do you have make in your %PATH% environment variable? On my system, I need to add %MINGW_DIR%\bin to %PATH%. Do you have make installed? Depending on your mingw installation, it can be a separate package. Last resort: Can you pass the full path to make on the commandline? cmake -D”CMAKE_MAKE_PROGRAM:PATH=C:/MinGW-32/bin/make.exe” ..\Source

How to use libraries compiled with MingW in MSVC?

Based on this error you put in a comment: error LNK2019: unresolved external symbol “int __cdecl openssl_call(struct ssl_State *,int,int,int)” (?openssl_call@@YAHPAUssl_State@@HHH@Z) referenced in function _main MyAPP.obj all other 4 errors are same only with other functions names Try putting extern “C” around your include files for openssl. For example: extern “C” { include “openssl.h” } using … Read more

How to update GCC in MinGW on Windows?

Update using terminal: Run the command prompt/terminal (cmd or sh). Update the package list: mingw-get update After updating the package list, run: mingw-get upgrade When the command finishes running, all of your packages will be upgraded. Update using the GUI version: If you aren’t used to the terminal, there is also a GUI version of … Read more