Questions tagged [gcc]
GCC is the GNU Compiler Collection. 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.
41,795
questions
0
votes
1
answer
56
views
Passing `volatile` buffers to library functions which do not take `volatile`
I have a multi-processor system with a "shared" memory region used for communication. In some cases one of the processors needs to process some considerably large data in the shared memory ...
0
votes
0
answers
21
views
Problems compiling CMSIS-RTOS library in ARM A7 firmware
I'm writing a firmware for STM32MP135 A7 ARM micro.
I'd like to include CMSIS-RTOS2 libraries and compile a simple basic program (to blink 2 LEDS in 2 different threads) by gcc cross toolchain and ...
0
votes
0
answers
20
views
Libsanitizer Error When Building GCC Cross-Compiler
I'm encountering compilation issues while building a GCC cross-compiler for RISC-V. Here is the last part of the GCC make command output if it might be helpful:
../../../../../src/gcc-14.1.0/...
2
votes
2
answers
91
views
C++ Compile-Time Class With std::vector Member Variable and Use It's Data at Run-Time [duplicate]
I am trying to make a writer class, which would be used to turn data into a binary stream, at compile-time using a std::vector, and then converting it to std::array to be used at runtime. eg:
#include ...
0
votes
1
answer
31
views
Tensorflow 2.17.0 build failed with bazel linux
I download the source code of tensorflow-2.17.0 from github, then i run 'configure' and build with bazel-6.5.0 successfully,
> bazel build //tensorflow/core:tensorflow
then i create a folder 'test'...
1
vote
0
answers
55
views
No compile time errors or warnings are being shown on my terminal window in vs code
I am using c language and I am working on windows using gcc compiler..I have also installed extensions like code runner and c\c++ Microsoft one too.
For example,
If I put an assignment operator in the ...
0
votes
1
answer
26
views
When cross-compiling for an ARM embedded target using GCC, is it reasonable to expect the Windows and Linux versions to produce identical output?
I have a build for an ARM embedded target that is developed using eclipse and GCC toolchain release 12.2-rel1.
I have set up a build in TeamCity that runs in a Linux-based Docker container, also using ...
1
vote
0
answers
34
views
C - Packed struct - different behavior in different compilers
I've wrote a function that writes file-info into another file (in bin-format).
I've built it for WINDOWS executable, in two different environments:
eclipse, using mingw gcc:
GCC: (MinGW.org GCC-6.3.0-...
-1
votes
0
answers
17
views
Im new to C++ idk how to run the code and im getting some errors
I am new to C++ because I've been using python and I just learned how to install packages with vcpkg and I installed dpp/dpp.h but when I put it in a file it says it recognizes the package but as ...
1
vote
0
answers
36
views
Correct Method to Place Multiple Arrays in a Custom Flash Section in C using GCC
I need to store a constant array in flash memory at a specific location using GCC in my embedded C project. For a uint32_t value, I managed to do it like this, and it works:
const uint32_t ...
-1
votes
0
answers
17
views
Error while compiling with makefile and gcc [closed]
I'm new to this forum, so please forgive me for any mistakes.
I'm encountering an error while compiling a project created with CubeMX 6.12.0. The error message is:
make[1]: arm-none-eabi-gcc: Argument ...
0
votes
0
answers
13
views
Why does clang fail on mabi but not gcc?
Given my file test.c:
#include <stdarg.h>
int a(int b, ...) { __builtin_ms_va_list list; __builtin_ms_va_start(list,b); }
I try:
$ clang -m64 -c -g -O2 -mabi=ms test.c -Wall -Wextra
which ...
0
votes
0
answers
14
views
How to use gcc compiler on Github windows runners when using scikit-build-core [duplicate]
I'm using scikit-build-core to build my c++ program on github windows runners. I would like to use gcc instead of microsoft visual studio as the compiler. Below is how I configure compiler settings in ...
-1
votes
0
answers
32
views
i386-elf-gcc: fatal error: cannot execute 'cc1plus': execvp: No such file or directory
I have this c code:
extern "C" void main() {
*(char*)0xb8000 = "Q";
return;
}
and when I try to compile it whit this command: i386-elf-gcc -ffreestanding -m32 -g -c "...
0
votes
1
answer
80
views
why huge local variable array doesnt cause segment fault
#include<iostream>
using namespace std;
int main()
{
char arr[40960];
for(auto i =0;i<40960;++i)
arr[i]='c';
std::cout<<sizeof(arr)<<std::endl;
...
1
vote
1
answer
29
views
how to compile MinGW32 for C-SKY processors?
for C-SKY processors there is an IDE CDS for Windows, it uses MinGW, but it has a very old version of GCC 6.3, I would like to update to 13.2, how to do this correctly?
I tried to google and didn't ...
0
votes
1
answer
24
views
compiling errors for R 4.4.1 on alma linux 9.4
I am compiling R 4.4.1 from source on alma linux 9.4 (docker container)
./configure --prefix ${installdir} \
--enable-year2038 --with-cairo --with-x --with-libpng --with-jpeglib --with-libtiff \
...
1
vote
1
answer
70
views
gcc and clang disagree on using alias templates as template template argument [duplicate]
The code below compiles using gcc 14.1.1 but clang 18.1.8 doesn't accept it. Which one is right and is there any workaround?
template <template <typename...> class T>
struct s {
...
0
votes
0
answers
35
views
How to build and Install compiler g++-4.8.5 on ubuntu 24.04 from source code?
I am getting error while building gcc-4.8.5 on ubuntu 24.04
I had followed the below steps as mentioned in the page How to Install compiler g++-4.8.5 in ubuntu 20.04
sudo dpkg --add-architecture i386
...
0
votes
0
answers
21
views
Unable to generate intermediate .i files (preprocessed files) in Linux kernel
In Linux kernel, I need to analyze the source code files, I choose intermediate .i files (preprocessed files) to analyze because of the macro definitions (preprocessed files have the macro definitions ...
0
votes
0
answers
11
views
gcovr cant process file
I am trying to generate a some coverage reports using gcov and gcovr, but gcovr fails to process my files.
The compile line for a particular file is the following
"command": "/usr/bin/...
0
votes
0
answers
40
views
cc -o out out.s on macOS with M1 chip
I have been learning the chapter of 04_Assemblyhttps://github.com/DoctorWkt/acwj/tree/master/04_Assembly. According to the README.md, after I typed cc -o comp1 -g cg.c expr.c gen.c interp.c main.c ...
0
votes
0
answers
68
views
Error cross compiling on windows 64 bit to x86 32bit with i368-gcc - "Warning: .type pseudo-op used outside of .def/.endef ignored."
I'm trying to make a simple os that uses the x86 32 bit architecture,
my kernel is the following: kernel.c:
void dummy_test_entrypoint() {
}
void main() {
char* video_memory = (char*) 0xb8000;
...
1
vote
1
answer
50
views
Setup libstdc++ for a given gcc version
New to Linux here.
Already had gcc 11 and 12 on my ubuntu but compiled gcc-14 using following command:
./configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --...
0
votes
0
answers
59
views
How to locate the file that defines specific symbol through #define in C++?
For example, I want to locate the header file that defines _WIN32_WINNT, how can I do? I tried g++ -E but it does not work.
Note that there may be multiple definitions of the same symbol. I want to ...
0
votes
1
answer
29
views
Why CSAPP say Gcc do not use vcvtss2sd?
Computer Systems: A Programmer's Perpective (3rd), in section 3.11.1, say "Suppose the low-order 4 bytes of %xmm0 hold a single-precision value; then it would seem straightforward to use the ...
0
votes
0
answers
32
views
Need to convert a Visual studio C++ project to a Cmake [duplicate]
I have a c++ code repo it has almost 68 projects within it. It was initially created using MSVC. I need to build that same project with gcc using cmake. Is there a way to convert that to a CMAKE ...
1
vote
1
answer
23
views
Understanding GCC Compilation: Preprocessing vs Linking with Libraries
I have a question regarding compilation with GCC.
I have a slight confusion that I believe I've figured out but would like confirmation on. In the first compilation step, preprocessing (cpp) organizes ...
0
votes
0
answers
32
views
Different execution times for the same code
I'm working with the Texas Instruments (TI) RM57L843 microcontroller, where I'm observing the execution time of a for loop that performs matrix multiplication. I compiled the same code using TI's ...
0
votes
1
answer
58
views
How to compile and run a C script in MSYS2
beginner programmer here, I am trying a rudimentary approach, where I write some c code in a text editor (notepad++) and wish to compile it using gcc. The way to do this I found would be to install ...