gcc Questions
1
I am trying to compile a simple hello program using gcc, but getting the below error. i am using ubuntu.
gcc -g -o hello hello.c
collect2: fatal error: ld terminated with signal 11 [Segmentatio...
Odeen asked 16/7, 2019 at 21:9
1
Solved
Consider the following simple code:
template<typename ...types>
class myclass
{
using payload_type = mylib::type_traits::type_or_tuple_t<types...>;
template<typename... T>
std...
1
I know that, generally, we can forward-declare enums in C++11.
So, why does this:
enum kind_t { kind1, kind2 };
template <kind_t Kind> struct foo {};
template <> struct foo<kind1&g...
Dobbs asked 24/8, 2022 at 21:22
1
I have installed gcc-10 compiler on my ubuntu 20.04. I needed to test the work of coroutine ts, so I found an example using coroutines and tried to compile it.
exemple:
#include <coroutine>
#...
Alkyd asked 27/11, 2020 at 15:45
1
I was playing around with Compiler Explorer and ran into an anomaly (I think). If I want to make the compiler vectorize a sin calculation using libmvec, I would write:
#include <cmath>
#def...
Eugine asked 20/9, 2016 at 9:54
2
I am trying to ignore the unused parameter warning using the new c++17 attribute [[maybe_unused]], as below.
int main([[maybe_unused]] int argc, char** argv)
{
//...
}
But I still get warning: ...
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
1
I would like to disable specific known warnings in C++ code coming from a library header when compiling my own code. There are clang and gcc specific methods for disabling the warnings. The way thi...
2
I get massive output with the following message (differentiated only by hex address):
ld.exe: DWARF error: could not find variable specification at offset 101cee
What is the meaning of this error ...
3
When I run cargo install cargo-binutils, I get the below error. I have gcc installed and in my path, to the point where where gcc correctly returns the location.
gcc version: gcc.exe (i686-posix-...
Francinefrancis asked 6/5, 2020 at 21:44
5
Solved
I am new to c++.
I want to ignore warning -Wunused-result which I guess popped because of -Wall flag. I did search on net and found that this is I can ignore it by declaring a pragma. I don't have ...
Pinkham asked 13/11, 2016 at 16:17
2
Solved
no match for 'operator='(operand type are 'std::vector<int>' and 'int'
I'm new to c++ and I'm learning about vector. I wrote a basic code to see how it works but i get the following errors.
||=== Build file: "no target" in "no project" (compiler: unknown) ===|
C:\Use...
2
Solved
I'm trying to compile something that depends on gtkspell, which
depends on enchant, under MinGW. I'm getting errors like
gtkspell/gtkspell.c:757: undefined reference to '_imp__enchant_broker_init'...
2
Solved
I have this code:
#include <stdio.h>
#include "SDL/SDL.h"
SDL_Surface *screen = NULL;
int main(int argc, char* args[]) {
SDL_Init(SDL_INIT_EVERYTHING);
screen = SDL_SetVideoMode(640, 4...
3
Solved
I want to get the address of _GLOBAL_OFFSET_TABLE_ in my program. One way is to use the nm command in Linux, maybe redirect the output to a file and parse that file to get address of _GLOBAL_OFFSET...
6
Solved
Everytime I compile and run c file, I have to type:
gcc filename.c
a.out
I don't want to do this in two lines, How to compile and run in one line on linux terminal?
4
Solved
Are there any known false positives with Valgrind? I get a 'Conditional jump or move depends on uninitialised value(s)' with the fmemopen function, writing in C and compiling with GCC. Can I be sur...
1
Solved
Recently we switched to a more recent GCC and it optimized away a whole function and replaced it with "null pointer access" trap code instead when optimizing for size. Looking at godbolt,...
Schnook asked 5/8 at 14:3
6
Solved
I read here it is C90 with extensions. How can I know for sure?
8
Solved
I have a map in a multithreaded app mapping a class called uuid to pointer.
What I want to know if an insert operation succeeded for failed.
e.g.
_mymap.insert(hint, MyMap::value_type(entry.uuid,...
3
Solved
2
Here is a bounded loop that increments two locations of the same buffer.
unsigned int getid();
void foo(unsigned int *counter, unsigned int n) {
unsigned int A = getid();
unsigned int B = getid()...
Marleah asked 7/12, 2023 at 7:37
4
Solved
When building projects in C++, I've found debugging linking errors to be tricky, especially when picking up other people's code. What strategies do people use for debugging and fixing linking error...
Stoneblind asked 29/8, 2008 at 18:27
2
I'm trying to learn operation system using i386-elf-gcc on my mac pro. Os version is Sierra. I use Macports to install the compile environment by typing sudo port install i386-elf-gcc in bash. But ...
6
Solved
I'm getting the following gcc format-truncation warning:
test.c:8:33: warning: ‘/input’ directive output may be truncated writing 6 bytes into a region of size between 1 and 20 [-Wformat-truncatio...
Ninetieth asked 26/7, 2018 at 8:26
1 Next >
© 2022 - 2024 — McMap. All rights reserved.