Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Browsing all 22016 articles
Browse latest View live
↧

How to compile without warnings being treated as errors?

The problem is that the same code that compiles well on Windows, is unable to compile on Ubuntu. Every time I get this error:cc1: warnings being treated as errors Now, it's big code base and I don't...

View Article


How to install git and gcc-c++ through Dockerfile?

I have CentOS VM on which I have installed git and gcc-c++ using CentOS Linux commands:sudo yum install git sudo yum install gcc-c++ and everything works smoothly now I want to do this through...

View Article


Linker optimizing out shared library

Using CMake and gcc/clang compilers I want to create a shared library out of this file (Registrator.cpp):#include ... namespace { struct Registrator { Registrator() { ... } ~Registrator() { ... } }...

View Article

Is binary operator '+' a sequence point in C? [duplicate]

I have the following code:#include <stdio.h> int main() { int a = 2, c; c = a++ + a; printf("%d\n", c); // prints: 5 } I thought this would print 4 because the side effect of ++ shouldn't...

View Article

Why does adding inline assembly comments cause such radical change in GCC's...

So, I had this code:constexpr unsigned N = 1000; void f1(char* sum, char* a, char* b) { for(int i = 0; i < N; ++i) { sum[i] = a[i] + b[i]; } } void f2(char* sum, char* a, char* b) { char* end = sum...

View Article


Unable to compile a C GTK app using GCC on Windows

I have installed GTK on my Windows machine an am attempting to compile a C program with GTK using GCC. I am using MSYS.I have used pkg-config to get all of the relevant flags and dependencies text for...

View Article

PyDStool package, symbol table not found

I am trying to use the PyDStool for bifurcation analysis. I have followed the installation instructions here, https://pydstool.github.io/PyDSTool/GettingStarted.html. I am on windows 10 and using...

View Article

GCC extended inline assembly - "invalid instruction suffix for mov"

I try to understand how the extended inline assembly in GCC works. But when I try to run a simple test program I get the error: "invalid instruction suffix for mov"The sample program:unsigned char...

View Article


gdb setup: no acceptable C compiler found in $PATH

So I'm on Windows 10 in the Ubuntu Linux subsystem, and I'm trying to run the configure script for gdb. My c: drive looks like this:C: |_gdb-9.1 -> folder with the gdb files |_gdbBuild -> folder...

View Article


Selection sort sorting incorrectly

I was writing a selection sort, and it's not sorting properly, sometimes it works, but most of the time there is one or two numbers out of place. It's supposed to print an array of numbers, sort those...

View Article

LinkedList Segmentation Fault [closed]

This LinkedList Checkbook program I wrote keeps getting a segmentation fault, and won't display the dates of my checks? I've been trying to debug but can't find the spot where I made a mistake. The...

View Article

How to place multiple const objects from multiple translation units sorted in...

I am developing firmware for some devices and each of them contain configuration objects which values are allowed to be changed by an external application. Here is example of such object:struct...

View Article

Why am I getting a "duplicate symbol" error for my functions in C?

I have three C files, main.c, function1.c, and function2.c. I compile them using gcc -o main main.c function1.c function2.c. I have a helper function helper() defined in function1.c. So function1.c...

View Article


I use valgrind-3.8.1 on c++ program, it points out some errors on gcc [closed]

==20628== Conditional jump or move depends on uninitialised value(s) 8 ==20628== at 0x4019054: ??? (in /home/opt/compiler/gcc-8.2/gcc-8.2/lib/ld-2.21.so) 9 ==20628== by 0x4007EF3: ??? (in...

View Article

How does C compiler `-O0` make code go so crazy?

Please take a look at: https://godbolt.org/z/WGBP8DCode: size_t n; scanf("%d", &n); fprintf(stderr, "(1 <= %d) == %d\n", n, 1 <= n); fprintf(stderr, "(%d <= 1000) == %d\n", n, n <=...

View Article


Why isn't gcc recognizing my .c file even when I provide it as an argument?

I have file1.c:#include <stdio.h> int main() { file2(); } and file2.c:#include <stdio.h> int file2() { } I'm trying to compile file1 with gcc -o file1 file1.c file2.c, but I'm getting the...

View Article

setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with...

When I try to install odoo-server, I got the following error: error: Setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 Could anyone help me to solve this issue?

View Article


Comparing a bit to a boolean

Say I have a set of flags, encoded in a uint16_t flags. For example, AMAZING_FLAG = 0x02. Now, I have a function. This function needs to check if I want to change the flag, because if I want to do...

View Article

configure CXXFLAGS refuses to accept more than one include path

I am trying to build a project that requires two include paths. My command is: ./autogen.sh --prefix /usr/ --libdir /usr/lib/x86_64-linux-gnu/ CXXFLAGS="-I${TensorflowPath}...

View Article

FindOpenMP failed on setting OpenMP_pthread_LIBRARY on alpine

I was trying to build a multi-threading application with cmake in my container. It failed when I tried to find OpenMP 3.0 with FindOpenMP, but worked fine if FindOpenMP was removed. Here is my...

View Article
Browsing all 22016 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>