collect2.exe: error: ld returned 116 exit status
windows 10, gcc is installed via msys2, path: "C:\msys64\ucrt64\bin".When compiling with g++, i get an error "collect2.exe : error: ld returned 116 exit status.",example: g++./project.cpp -...
View ArticleIs there a way to link C++ to musl?
I installed the musl-tools package on Ubuntu, which comes with a musl-gcc wrapper for GCC that automatically links C programs to musl instead of glibc. There is, however, no equivalent musl-g++, or...
View ArticleHow to get CMake find_package to find and use PkgConfig for cross-compilation
I am trying to cross-compile an application for a Beaglebone black.I've successfully compiled the application directly on the Beaglebone while commenting out the cross-compile related section in my...
View ArticleIs it possible for a GCC compiler internal error (ICE) to show up depending...
I'm developing two slightly different IOT projects, sharing a large part of the code base, and we are using GCC 6.3.0 due to compatibility requirements. To help in part of the code, I included the fmt...
View ArticleC Loop Unrolling GCC vs Clang (linear search, no jump table)
Why do the compilers produce inefficient loop unrolling.GCC Version 14.2Clang Version 19.1.0Compile args for both: -Ofast -lm Example code:#define MIN(a,b) ((a) < (b) ? (a) : (b))void to_test(size_t...
View ArticleWhy can't GCC's typeof() be stringified?
I'd like to print the type that typeof() outputs, but typeid is only available in C++. Why can't I use stringification to get the name of this type?#define GET_STRING(s) #s#define example(input) \ do {...
View ArticleHow can i fix the "The specified executable is not a valid application for...
I have recently moved to VScode so chances are I am doing something very dumb, when I run my code using VScode run/debug button on the top right my code runs but when I try to compile and run my code...
View ArticleGolang execution freezes
I have a basic Golang script and when I run it on windows using go run ./Core/Main nothing happens. And when I run it using verbose mode all that outputs is github.com/go-gl/gl/v2.1/gl. My code runs...
View ArticleGo execution freezes [closed]
I have a basic Go script and when I run it on Windows using go run ./Core/Main nothing happens. And when I run it using verbose mode all that outputs is github.com/go-gl/gl/v2.1/gl. My code runs just...
View ArticleGCC plugin, detect 'typedef' and 'using'
I'm writing a GCC plugin and would like to identify typedef and using.plugin.cpp#include <gcc-plugin.h>#include <tree.h>#include <tree-pretty-print.h>#include...
View Article__STDC_LIB_EXT1__ availability in gcc and clang
Since a quick Google search did not find anything, I will try to ask here (since many people involved in gcc/clang hang around here) - What is the status of __STDC_LIB_EXT1__ in gcc/clang? We are...
View ArticleIgnoring or redefining GCC Standard Predefined Macros
Is it possible to tell GCC to compile the source code, and ignore macros like __FILE__, __LINE__ , etc, etc, or redefine them to expand into let's say - an empty string?
View ArticleWhat is the difference between `-fpic` and `-fPIC` gcc parameters?
I've already read the gcc manpage, but I still can't understand the difference between -fpic and -fPIC. Can someone explain it, in a very simple and clear way?Related questions:What does -fPIC mean...
View ArticleStrange GCC error: stray '\NNN' in program
The following issue popped up in my open source library, and I can't figure out what's going on.Two of my users have (GCC) compiler errors that look like:/home/someone/Source/src/._regex.cpp:1:1:...
View ArticleRust installation on Windows
I was trying to get Rust to work on my Windows box. I followed the instructions, however when I tried hello world program, it spits the below. It looks like it has not been able to link up to gcc.. and...
View Articleno matching function for call to 'lower_bound' with newer gcc
I'm having some trouble compiling code that uses std::lower_bound on systems with newer versions of gcc. From my tests, 4.1 works, but 4.6 fails.Here is the relevant code snippet:template <typename...
View ArticleRemove console window with SDL application
I have this code:#include <stdio.h>#include "SDL/SDL.h"SDL_Surface *screen = NULL;int main(int argc, char* args[]) { SDL_Init(SDL_INIT_EVERYTHING); screen = SDL_SetVideoMode(640, 480, 32,...
View ArticleHow to configure QT 5.15.16 to use C++20 instead of С++17?
I am trying to use C++20 with Qt, but no matter what I do, it always defaults to C++17.Here is the relevant part of the output after configuration:# head config.summaryBuild type: linux-g++ (x86_64,...
View ArticleMultiple glibc libraries on a single host
My linux (SLES-8) server currently has glibc-2.2.5-235, but I have a program which won't work on this version and requires glibc-2.3.3.Is it possible to have multiple glibcs installed on the same...
View Articlegcc-arm-none-eabi 11.3 "is not implemented and will always fail"
I'm working on a bare-metal STM32 project, compiling on a Linux x64 host.After upgrading my toolchain from gcc-arm-none-eabi-11.2-2022.02 to arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi, I get the...
View Article