gcc-11 macOS doesn't compile [duplicate]
I installed gcc-11 with home-brew (brew install gcc) and tried to compile a simple cpp file with gcc-11 -o main main.cpp but I get the following error:Undefined symbols for architecture x86_64:...
View ArticleBuild gcc from sources - GLIBC
we have old Linux distribution and the vendor doesn't support its updates. We want to build our c++ code with a modern compiler, for that we are building GCC compiler from sources (something very...
View Articlegcc-arm-none-eabi toolchain - Where are c++ std includes included?
I am trying to switch from libc_nano to picolibc. I just compiled picolibc from source, and installed the libraries (ninja followed by ninja install). The latter command copied the lib and headers to...
View ArticleSetting up SDL in MinGW
Currently, I'm trying to figure out how to set up SDL with MinGW. I've seen a couple of sites that have methods (or rather, the same method re-published), but I'd rather not have a "quick 'n dirty"...
View ArticleCan a label (branch target) be labeled "volatile" to prevent it from being...
Is it possible to have volatile labels? Something like this:volatile coroutine:orcoroutine volatile:or maybe evencoroutine: volatileI want a label that won't be touched by optimizations. Is that...
View ArticleMake gcc warn on conversion within if
Is there any way to have gcc or g++ emit a warning when an implicit conversion within an if, something like if(25.0), is used?This question is inspired by a bug I recently observed where a parenthesis...
View ArticleStatic cast with derived keyword (Code understanding)
I was trying to compile c++ code got from internet, unfortunately it is not failed to compile. Since it is heavily templeted code I am struggling to understand and fixing this. The code is giving...
View ArticleHow can i install LightGBM? Error about Could not find OpenMP_C in Mac
I am using Mac os and installing Lightgbmpip uninstall lightgbmgit clone --recursive https://github.com/Microsoft/LightGBM ; cd LightGBMexport CXX=g++-8 CC=gcc-8mkdir build ; cd buildcmake ..make -j4I...
View ArticleHow to configure Codelite to compile a C program against C17/C18 standard
I am using Codelite 14.0.0 with the gcc.exe (MinGW.org GCC Build-2) 9.2.0 compiler.When I go to Menu > Workspace > Open Active Project Settings > Compiler> C Compiler Options...I can't see...
View ArticleParser for *.d dependency files [closed]
I have created a build system: https://github.com/GauravDawra/Beast.I want to add support for dependency files that gcc creates using the -MMD flag (the files with .d extension).I am looking for an...
View ArticleLinking mosquitto library to hello.c program on Linux
I am trying to compile the mosquitto library with my custom c program. So WHat I have done is wrote a hello.c file, git cloned the latest mosquitto library from the below...
View ArticleCan't getting a segmentation fault
I've seen from a Numberphile video (https://youtu.be/1S0aBV-Waeo) a way to run a buffer overflow, and I wanted to try it out.I have written a piece of code, which is identical to the one shown in the...
View Articlesnprintf occur different Performance [closed]
here is code:while((nread = read(fd1,read_buf,sizeof(read_buf)))){ int ret = snprintf(write_buf,sizeof(write_buf),"%s",read_buf); int vprintf(const char *format, va_list ap); if(ret < 0){ │ int...
View Articlecorrect usage of rpath (relative vs absolute)
When building a binary or library, specifying the rpath, i.e.-Wl,rpath,<path/to/lib>tells the linker where to find the required library at runtime of the binary.What is the UNIX philosphy...
View ArticleC++ Queue::Pop function acts weird when compiled with -O1
I have been writing my own queue in c++.The problem is that it has a function called Queue::Pop() which calls the destructor of the first item in the queue which is kept track of by an index called...
View ArticleClion Cmake Static Library link -static-libgcc -static-libstdc++
I'm using centos 8GccUsing built-in specs.COLLECT_GCC=gccCOLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/8/lto-wrapperOFFLOAD_TARGET_NAMES=nvptx-noneOFFLOAD_TARGET_DEFAULT=1Target:...
View Articleinclude SFML Library in VSCode "SFML/Graphics.hpp no such file or directory" gcc
I've seen other question's relating to this and most if not all that I could find have some round about way of getting SFML to compile and run in VSCode I'm hoping that there is a way to simply append...
View ArticleWhy the `libstdc++.so` compiled from source seems to be incorrect?
I try to compile gcc and libstdc++(as a part of gcc) from the source code.With:$ git clone https://github.com/gcc-mirror/gcc.git # mirror repo$ cd gcc && md build && cd build$...
View ArticleApparently undocumented GCC behaviour with "constant" initializers in C
Consider the following C code:#include <stdio.h>int x = 5;int y = x-x+10;int z = x*0+5;int main(){ printf("%d\n", y); printf("%d\n", z); return 0;}The ANSI C90 standard states "All the...
View ArticleApparent GCC bug with comma operator in constant initializer
I was messing around with C and discovered an apparent bug in GCC:#include <stdio.h>int y = (1, 2);int main(){ return 0;}in gcc gives error: initializer element is not constant while it works...
View Article