Questions tagged [g++]
g++ is the C++ frontend to the GNU Compiler Collection (GCC). It's the de facto standard compiler for C, C++, Go, Fortran, and Ada on Linux and supports many other languages and platforms as well. Apart from the compiler, GCC has a toolchain (libc, libstdc++, objdump, nm etc.) that is widely used on several platforms and systems.
10,677
questions
0
votes
0
answers
10
views
I'm getting an error when using the Competitive Programming Helper (cph) plugin in the arm version of VScode
I'm an algorithm contestant, I recently installed the win on arm system for my android tablet, when I finished configuring the C++ compilation environment of vscode, I tried to use the plugin to ...
0
votes
0
answers
10
views
I can not add library of Protobuf to Eclipse IDE
I want to add protobuf lib to eclipse ide. I am using protof 27.2 and mingw g++ 9.2 to compile code.
#include <iostream>
#include "C:\Users\PC_5725\Desktop\Eclipse\Protobuf_ornek1\ProtoEx1\...
0
votes
0
answers
20
views
g++ print source-mapped file path in error
I have a C++ file that I'm compiling with g++ with the -ffile-prefix-map option. Is there a way to tell g++ to print the remapped file name when there are build errors? That way, clickable file names ...
2
votes
2
answers
87
views
`static_cast<const bool&>` with `explicit operator bool`
Consider the following:
struct C {
explicit operator bool() const {
return true;
}
};
int main() {
C c;
auto b = static_cast<const bool &>(c);
return 0;
}
...
-1
votes
0
answers
32
views
I'm struggling to compile anything with OpenCV using g++ [duplicate]
For some reason none of the commands I try are working.
Command: g++ file.cpp -o file -I C:\Users\Username\vcpkg\installed\x64-windows\include -L C:\Users\Username\vcpkg\installed\x64-windows\lib -...
2
votes
1
answer
99
views
In C++ std::ranges, how do I build a map out of a views::join result?
I'm using GCC 14 in C+23 mode. In the following code, I create a view of views of pairs, which I then flatten with views::join and put into a vector:
auto c = std::ranges::views::iota(1, 5)
| ...
-4
votes
2
answers
66
views
I was working on vs code in C++ and suddenly I got an error not showing any output in terminal [closed]
I was working on vs code in C++ and suddenly an error appeared that no output was shown in the terminal. I tried
Please help guys, because this error is hindering my work. I was working in oop on ...
1
vote
0
answers
85
views
when unique_ptr implements pimpl, assignment in a class declaration also results in: error: invalid application of 'sizeof' to incomplete type '***'
excuse me, when I was implementing pimpl with std::unique_ptr, I accidentally found that when I set pimpl to nullptr in the header file, gcc(version 9.4.0,14.1.0) cannot be compiled. But cl.exe (...
0
votes
0
answers
39
views
AIX: C++ application with shared Qt5Core lib dependency has thread-local-storage runtime issue
I am on IBM AIX-7.2 and have this sample C++ code:
#include <QtCore/QCoreApplication>
#include <QtCore/QDebug>
#include <QtCore/QDateTime>
#include <cstring>
int main(int argc,...
0
votes
0
answers
58
views
vs code wont run with multiple cpp files [duplicate]
hello i am a beginner and currently following learncpp 2.8 on how to use multiple code files which i was able to build and run manually but build and fail to run in vs code despite setting tasks.json ...
0
votes
0
answers
55
views
When writing my own lex/yacc, my code that was cpmpiled by g++ producted a weird bug
Could you please help me identify where the issue might be in my code, or is there possibly a problem with the compiler itself?"
I was writing my own lex/yacc by cpp. There is some codes for ...
-1
votes
0
answers
38
views
Undefined reference to `??3@YAXPEAX@Z' [duplicate]
I tried to Link my c++ programm with the Rockey library (Rockey is a company that produces usb hardware keys) but during compilation I get the following error [R4ND_Random]+0x12f): undefined reference ...
0
votes
1
answer
56
views
Valgrind complain after modifing reference return variable from a vector in c++
I am trying to modify an std::vector through the use of references, the vector lifetime is designed in such a way modifications through the reference always are valid, in other words the the reference'...
-1
votes
1
answer
70
views
clang++ and g++ Compiler gives different output when printing char pointer [duplicate]
clang++ and g++ Compiler gives different output when printing char pointer
#include <iostream>
int
main(int argc, char** argv){
char a = 'a';
char* aptr = &a;
std::cout << aptr &...
0
votes
0
answers
32
views
G++ cannot link to instantiated template static method in shared library [duplicate]
I have a simple code that's trying to link to a static method of a class template that's already instantiated in a shared library. This is the code:
#include <sym/rot3.h>
int main() {
sym::...