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
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.
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...
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 ...
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 ...
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...
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...
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
Calling member function of an incomplete type compiles in gcc and does not compile in clang and msvc
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",...
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...
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...
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 $...
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>
...
1 Next >
© 2022 - 2024 — McMap. All rights reserved.