Category : mingw

i want to use Asio standalone library for networking in my c++ project, but i’m having issues with my compiler/linker (MinGW). I put the "include" folder in the "asio-1.18.1" folder in the "include" folder of MinGW and renamed it to Asio, but it doesn’t work. I also tried to use the "LIBRARY_PATH" environement variable, but ..

Read more

I’ve been trying to compile my code with CMake using the "MSYS Makefiles" generator. I wrote the following command: cmake -S . -B build/ -G "MSYS Makefiles But I was presented with the following error: CMake Error: CMake was unable to find a build program corresponding to "MSYS Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably ..

Read more

I have two cpp files: main.cpp using my_math.cpp. I don’t want to invoke two commands below g++ -E my_math.cpp > my_math.ii g++ -E main.cpp > main.ii How to get the same result but with just one invocation of g++ -E? Note 1 Don’t suggest me to use g++ main.cpp my_math.cpp -save-temps -o output.exe that actually ..

Read more

When I add winsock2 to my MinGW-w64 C/C++ project, it then gets make error: undefined reference to `InitializeConditionVariable’. NOTE: InitializeConditionVariable built and ran ok prior to adding Winsock. main.c … #undef UNICODE #define WIN32_LEAN_AND_MEAN #include <winsock2.h> #include <stdlib.h> #include <stdio.h> #include <stdint.h> #include <errno.h> #include <string.h> #include <unistd.h> #include <signal.h> #include "infrastructure.h" #include "common.h" #include ..

Read more

I want to change the standard language in c++ permanently so I no longer need to type g++ -std=c++17 <filename> repeatedly to change the language version which was previously c++14, and that also affects vscode which I use because the compiler can’t track the language rules of version c++17, it affects the editor and displays ..

Read more

I am currently using scanf() but it doesn’t have the features of readline() (like custom autocomplete and proper history). The history is the main issue as I cannot load or save history like in readline() and I had to remove this feature from the Windows port of my application. I dislike this decision because I ..

Read more