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,786
questions
0
votes
0
answers
8
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 ...
0
votes
1
answer
64
views
'gcc' command does not give any output
I have been trying to run a c code from my terminal. The command:
gcc abc.c
is not giving any output and instead it gives me a new command line without any messages.
When I try
python3 abc.py
the ...
0
votes
0
answers
8
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
19
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
50
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 ...
0
votes
1
answer
15
views
STM32CubeIDE: How to exclude memory sections in linker script from output file
In my cube project, I need to generate a bin file as the output. The output bin file is over 2GB because it includes a RAM section (0x30000000) in the output as well as the required flash section (...
-2
votes
0
answers
47
views
growisofs - How do I fix the errors returned by attempting to compile it in cygwin? [closed]
Context: I'm attempting to build growisofs from its source code (version 7.1) using the following command in the Cygwin terminal: make TARGET_ARCH=-m64, but it gives me several errors when I attempt ...
1
vote
1
answer
73
views
Why do I get a "for declaration does not refer into a class, class template or class template partial specialization" on Clang and not GCC [duplicate]
I currently have this block of code which does not throw a compiler error on GCC, but throws this compiler error on clang:
error: nested name specifier 'MyEnum::' for declaration does not refer into ...
1
vote
0
answers
17
views
Select specific version present in ld version script
Consider the setup present in this question:
GNU LD symbol versioning & C++ binary backwards-compatibility
Consider the version script. Is it possible to explicitly tell ld to limit the exposed ...
3
votes
2
answers
94
views
GCC 14 "possibly dangling reference to a temporary" warning or not, depending on the function argument
In the following C++ code GCC 14 with -Wall -Wextra flags produces a possibly dangling reference warning for function g(), but not f(). Why?
/* getval.h */
#include <string>
std::string const &...
0
votes
0
answers
13
views
Memcpy specified bound exceeds maximum object size - gcc bug?
I'm getting a very weird warning when trying to compile Fribidi with gcc. Take a look at the following line:
memcpy (visual_str, str, len * sizeof (*visual_str));
(source)
It triggers this gcc ...
-2
votes
0
answers
44
views
Address sanitizer CHECK failed [closed]
I am writing a program using the gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux toolchain. There is a task to check if there are any memory leaks in the program.
I saw in tutorials that adding ...
1
vote
1
answer
63
views
dSYM not generated when building with make
On macOS 12.7.5 (Monterey) using gcc to compile *.c: gcc version 13.2.0, with gnu make 3.81, (I prefer command line tools over XCode), when I pass CFLAGS = -g in a makefile I get full debugging ...
1
vote
1
answer
39
views
Failing to compile package from Mac [duplicate]
I'm trying to install a package in R, and I get the following error:
clang: error: unsupported option '-fopenmp'
This, is after I got an error:
ld: warning: search path '/opt/gfortran/lib/gcc/aarch64-...
1
vote
2
answers
103
views
Why exception can not be caught on windows by msvc but on Linux by GCC [duplicate]
The same files on Windows and Linux as follow:
std_exp.cpp
#include <iostream>
#include <string>
#include <stdexcept>
using namespace std;
int main() {
try {
std::...