Category "gcc"

gcc cross compiling for raspberry pi /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.34' not found

On Ubuntu 22.04 LTS, I'm cross-compiling for raspberry pi. When I run any built executable on the pi, I get this linking error: /lib/arm-linux-gnueabihf/libc.so

How can I make sure `iostream` is available to the linker?

I have the following C++ code in a file called helloworld.cpp: #include<iostream> int main() { std::cout << "Hello, World!\n"; } I would like

Use macro definitions (e.g. M_PI) in math.h as float not double

I noticed that all the mathematical constants are declared as double, which leads to conversion problems on some platforms where no double precision units exist

How do I properly pass command line arguments to a C program in CLion?

I need someone to outline how to pass command line arguments to CLion. What I've found so far hasn't worked for me. Specifically I need to know how to pass mult

Why does ld need /lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 while its default dynamic linker is /lib64/ld-linux-x86-64.so.2?

In x86-64 target Debian, most of the programs are link against shared objects with the /lib64/ld-linux-x86-64.so.2. And there is also one in /lib/x86_64-linux-g

C++ union struct with struct member works on Clang and MSVC but not GCC

I am trying to define a union struct with some struct and primitive members overlapping in memory with a simple array. This works perfectly in Clang and MSVC, b

undefined reference to `__imp___gmpz_init', building GMP program on Cygwin

I'm trying to compile this simple GMP program on Cygwin: #include <gmp.h> int main(){ mpz_t i; mpz_init(i); } This is the command: gcc -lgmp t

Explaining "g++ not found in PATH" for an idiot

So, I just installed Eclipse for C/C++ and whenever I make a new project, I get two errors saying that the programs g++ and gcc are not in my PATH. All of the a

The procedure entry point _ZNSt7_cxx1112basic_stringlcSt11char_traitslcESalcEEC1Ev could not be located in the dynamic link library

I am having immense difficulty trying to use std::string. The program compiles absolutely fine, but when I run the program, I receive this error: error I have

/usr/bin/ld: final link failed: Illegal seek collect2: ld returned 1 exit status

I am running my program on linux server and it was compiling and running fine then i made another directory and tried to compile it in that directory and it w

How to include omp.h in OS X?

I'm new in C and have some problems compiling my code in OS X. I code Java a lot both in Eclipse and use terminal to compile my code. However now I'm learning

Is there a direct way to get clear details on gcc acceptable option values (e.g. for -std) without grep-ing through irrelevant material?

The gcc (or g++) compiler has a -std option to specify the language standard to use for compiling C or C++. At the top level one can see that this option exists

Flutter for linux build fail

A linux build of any flutter application with linux enabled, results in the following error: flutter run -d linux Launching lib/main.dart on Linux in debug mode

How does #include <bits/stdc++.h> work in C++? [duplicate]

I have read from a codeforces blog that if we add #include <bits/stdc++.h> in a C++ program then there is no need to include any other h

What are my available march/mtune options?

Is there a way to get gcc to output the available -march=arch options? I'm getting build errors (tried -march=x86_64) and I don't know what my options are. The

Does gcc initialize long strings to `""` but not short ones?

Note: I know that reading an uninitialized string is undefined behaviour. This question is specifically about the GCC implementation. I am using GCC version 6.2

How do I fix "ld: library not found for -lubsan" while compiling with g++?

When I try to compile my eek.cpp file with g++ eek.cpp -o eek -fsanitize=undefined flag, it shows: ld: library not found for -lubsan collect2: error: ld returne

How to remove "noise" from GCC/clang assembly output?

I want to inspect the assembly output of applying boost::variant in my code in order to see which intermediate calls are optimized away. When I compile the fol

Confusion about different clobber description for arm inline assembly

I'm learning ARM inline assembly, and is confused about a very simple function: assign the value of x to y (both are int type), on arm32 and arm64 why different

How to build a standalone C ELF binary without installing libraries on a remote machine?

I am trying to build a C ELF binary on linux and try to execute it directly on another machine. (Sent via scp linux command) The problem is that even when I bui