g++ Questions

5

Solved

I have some C++0x code. I was able to reproduce it below. The code below works fine without -std=c++0x however i need it for my real code. How do i include strdup in C++0x? with gcc 4.5.2 note i...
Milagrosmilam asked 6/4, 2011 at 22:34

3

Solved

I am trying to set up a cross-compiler for i686-elf on Ubuntu following the OSDev GCC Cross-Compiler Tutuorial. However, the code to set up GCC fails to build every time. I know my sources are not ...
Craunch asked 31/10, 2015 at 10:13

6

I am using ubuntu 12.04. I'm trying to "make" a project. I get this error: g++: error trying to exec 'cc1plus': execvp: No such file or directory I have g++ installed.
Earlineearls asked 14/3, 2014 at 19:30

2

The GCC C++ compiler (any many other C++ compilers as well) provide nonstandard extentions such as alloca() for stack based allocation variable length arrays, as they are part of the C standard C...
Acrobatic asked 17/5, 2021 at 19:47

9

Solved

gcc (or other compilers) often generate huge text output and it's very difficult to see where the error is or miss warnings. I've done some search but havn't found a clean simple solution to color ...
Bildungsroman asked 17/2, 2013 at 15:56

4

I want to know what the default c++ language standard version that is used by my compiler is when I do something like g++ main.cpp. I know I can run g++ -v for the compiler version, which for examp...
Carnauba asked 9/3, 2023 at 1:5

1

Solved

Let's assume I have the following code (https://godbolt.org/z/MW4ETf7a8): X.h #include <iostream> struct X{ void* operator new(std::size_t size) { std::cout << "new X\n"; ...
Alcaic asked 24/6 at 21:25

3

Solved

I'm have an Arduino Uno R3. I'm making logical objects for each of my sensors using C++. The Arduino has very limited on-board memory 32KB*, and, on average, my compiled objects are coming out arou...
Padishah asked 9/3, 2013 at 18:53

2

Solved

When I compile my C++ program with g++ using the -Og option I see variables that are <optimized out>, and also the current line sometimes skips around. Is this behaviour expected at this opti...
Clerical asked 15/7, 2015 at 16:16

5

Solved

Recently, I upgraded to Xcode 15, and with that the update of the xcodebuild tools. However, suddenly, my standalone C++ applications are not able to use the g++-13 compiler for some reason? Anyone...
Cima asked 23/9, 2023 at 17:12

1

Solved

I've reduced my code to the following example, which fails -O3 C++20 compilation on my g++ (x64 12.3) as well as apparently 14.1 when using godbolt: Again according to godbolt, clang works without ...
Testimony asked 22/5 at 10:26

1

For some reason GCC regards variable a as an rvalue within the initialization of variable b (of which the expression is of type int&). And, as a result, rejects the code as it's not able to bin...
Oskar asked 13/5 at 23:58

1

Solved

I encountered a problem where g++ optimized out something it should not have. I reduced the problem to the following example: I have a static lib with a function bool my_magic_function(int* x), whi...
Trilemma asked 3/5 at 11:5

4

I've a strange phenomenom happening that I don't know how to investigate. I hope someone already encountered this an can provide tips I'm using gitlab CI to build some Qt based projects. gitlab r...
Rehearse asked 14/3, 2019 at 7:56

3

Solved

I am limited on what I can share as this is part of a huge stack of code that I am porting from Ubuntu 14.04 to 16.04. It should be trivial, but somehow I am struggling with this. It doesn't find ...
Militarize asked 3/7, 2017 at 15:8

16

Solved

I'm trying to compile my program and it returns this error : usr/bin/ld: cannot find -l<nameOfTheLibrary> in my makefile I use the command g++ and link to my library which is a symbolic li...
Farmhand asked 23/5, 2013 at 9:20

2

Solved

Is it possible to use CMake to enclose a target's libraries in --start-group/--end-group without manually writing the argument string into target_link_options? Background: I'm having library orderi...
Fairlead asked 7/9, 2022 at 17:50

1

Q: Is there a way to speed up clang++ STD Library fstreams? (And does anybody know why it is so much slower than g++?) I am trying to process very large (many GBs) binary data files and was surpri...
Fateful asked 27/7, 2016 at 22:51

1

I compiled the following code with g++ -Wuninitialized (g++ Version 7.5.0) and I didn't get any warning: #include <algorithm> int main() { int a, b; b = std::min(a, 0); } As you ...
Tricot asked 19/12, 2020 at 17:41

1

Solved

Here is an example: struct TestClass { void testFunction() const {} static TestClass* ptr_; constexpr static auto funcPtr = +[](){ ptr_->testFunction(); }; }; TestClass* TestClass::ptr_ = ne...
Osbert asked 29/2 at 9:7

2

When trying to compile the following example: std::chrono::sys_time<std::chrono::microseconds> timestamp; std::stringstream ss = foo(); ss >> std::chrono::parse("%Y-%m-%d %T",...
Prediction asked 12/8, 2021 at 11:39

7

Solved

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 openMP and have troubles with it. Fi...
Linders asked 23/9, 2014 at 8:23

2

Solved

I just updated my GCC compiler version to 13.1 from 11.4. And I found the following code which used to work on my old GCC 11.4 no longer works on GCC 13.1. #pragma GCC optimize("Ofast,unroll-l...
Installation asked 2/1 at 9:8

4

Solved

I am compiling some project with dependency so i won't have to recompile each time, but when i am adding -Dsome_flags to my CFLAGS, it is not recompiling. dep: $(CPPS) $(CC) $(CFLAGS) $(INC) -M $...
Aldosterone asked 26/4, 2015 at 12:16

2

Solved

I want to compute a lookup table at compile time for a mathematical function in a given range and then retrieve values from the table at run time. My code is as follows: #include <iostream> ...
Samphire asked 8/4, 2016 at 10:42

© 2022 - 2024 — McMap. All rights reserved.