Most voted "gcc" questions
GCC is a set of programming language compilers produced by the GNU project to build a Unix-like operating system. It is part of the GNU and FSF operating system, and is one of the essential tools for keeping software free, as it allows compiling the source code into binary executables for the various common computer platforms. If the doubt is not about "GCC", do not use this tag.
Learn more…64 questions
Sort by count of
-
8
votes1
answer147
viewsGCC compiler command to display #ifdef
What compiler command do I use to display this line at runtime? #ifdef DEBUG double tInicio_=clock() ; #endif
-
8
votes1
answer1466
viewsDifference between GCC Clang
The systems based on Unix (a large majority), usually use the GCC, to compile the files in C, but I also possessed the Clang for the same purpose. There is difference when compiling some project…
-
8
votes1
answer148
viewsAccess null pointer is not generating error
Testing the code below, I noticed a strange behavior. It’s working when it shouldn’t. The correct in my view was to give a segmentation failure and abort, but it seems that the compiler is doing…
-
7
votes1
answer85
viewsHow is it possible for the same memory address to have 2 different values at the same time?
I had a question about the behavior of the type qualifier const of the C++. I was testing how much a variable declared as a constant is protected from changes. For this I tried to change its value…
-
5
votes1
answer363
viewsHow to compile C/C++ for Linux/Mac OS on a Windows?
The title says it all. I have code that can be compiled on the two (three?) platforms and I want to do it straight from Windows only using GCC (Mingw in this case). Would that be possible in…
-
5
votes3
answers389
viewsCompiler error when trying to reset vector
Compilers error when I try to reset an array with the command vetor[10] = {0}; And he only makes a mistake in that line because I also used it in the assignment int vetor[10] = {0} and there does…
-
5
votes1
answer1457
viewsError while creating Makefile
When I am trying to use Makefile with the following content: all: teste teste: arp_discover.o arp_poisoning.o gcc -o teste arp_discover.o arp_poisoning.o arp_discover.o: arp_discover.c…
-
4
votes3
answers633
viewsLoop variable declaration error
I made the following command: for(int i = 1 ; i <= 3 ; i++) {etc } Then it made the following mistake when I went to compile: game.c:11:2: error: "for" loop initial declarations are only allowed…
-
4
votes1
answer124
views -
4
votes1
answer571
viewsIs there a difference between C++ from GCC and C++ from Visual Studio?
I already programmed in C++ compiling with GCC and when I started using Visual Studio I noticed that it has support for C++, but the implementation is aimed at the platform . Net. There is a…
-
4
votes1
answer162
viewsCompiling code on Ubuntu and running on windows
Hi, I was wondering how can I compile a C code on Ubuntu and what execute on Windows. I tried to put the extension ". exe" at the end of the file, but when I sent the executable to my teacher he…
-
4
votes1
answer152
views"Output" with special characters
I am using the GCC compiler version 5.3 for the following program, written in Aptana: #include <stdio.h> void main(void) { int positivo = 32767; int negativo = -32768; printf("%d +1 é %d\n",…
-
4
votes1
answer395
viewsHow to vector code in C++?
Would you like to know how to vector code in C++ ? because the material I found on the internet is a bit excasso. I understand as vectorization the use, not only of vectors, but of doing in a single…
-
4
votes1
answer133
viewsC++: Addition of ". cpp" implementations in Visual Studio and GCC
In C++, what is observed in a quick internet search is the orientation that only ". h" files should be included. A sample of this can be observed here and especially here. In Visual Studio, the…
-
4
votes2
answers263
views -
3
votes1
answer891
viewsHow do I update C++ to C11 on Ubuntu 14.10?
How can I upgrade the version of C++ to C11? Details: Ubuntu 14.10 32b GCC 4.9.1 (Ubuntu 4.9.1-16ubuntu6)
-
3
votes1
answer5699
viewsProblem compiling: no input files Compilation terminated
I’m starting to program in C, but ai to use GCC ta giving me the following problem when using cmd: gcc.exe: fatal error: no imput files Compilation terminated I would like to know what to do,…
-
3
votes1
answer79
viewsUndefined Reference to Symbol when compiling program in C++
I’m testing the curlPP library and wrote the following program: #include <iostream> #include <curlpp/cURLpp.hpp> #include <curlpp/Easy.hpp> #include <curlpp/Options.hpp>…
-
3
votes2
answers377
viewsHow to generate a . of the implementation of a class . cpp without the main function in g++?
I would like to compile the implementation of a class in order to only generate an object code from it. This is the implementation of the class: #include <iostream> #include "gradebook.h"…
-
3
votes1
answer2472
viewsUndefined error Reference to Std
#include <iostream> using namespace std; int main() { int nombre, carre ; cout << "Introduza un numero : " ; cin >> nombre ; carre = nombre * nombre ; cout << "A raiz…
-
3
votes1
answer60
viewsWhy do you have to add -pthread option when compiling with the Std thread library?
If in the main.cpp I use the library thread of std, to compile I have to use the following command: g++ main.cpp -pthread And even applies to Ang. This is the only case I know of the standard…
-
2
votes1
answer61
views -
2
votes1
answer453
viewsitt' is not recognised
I am trying to compile the code below with GCC 4.7.4, but always get the bug error: ạ itoa' was not declared in this Scope #include "otpch.h" #include <iomanip> #include <stdlib.h>…
-
2
votes1
answer1145
viewsCompiling with g++
I am compiling an example code provided on the GLFW bookstore website as follows: g++ main.cpp -o main.exe glfw3dll.a <- this way it is possible to compile, but what if I want to change the files…
-
2
votes1
answer116
viewsTemplate error when returning value
I am implementing a class that represents an array using template and dynamic allocation. However, when the +(addition) operator was overloaded, the following build error occurred (only when I try…
-
2
votes1
answer937
viewsHow to compile . cpp codes that have separate interfaces and implementations in g++?
I’m studying C++ for the book Deitel, and I’m trying to compile a program where we have a file gradebook.h which is the interface, gradebook.cpp which is the implementation and…
-
2
votes2
answers2311
viewsHow do I create a C Makefile
I’m having problems running Makefile. main: ex09.o funcao1.o gcc -c ex09.o funcao1.o -o main ex09.o: ex09.c gcc -c ex09.c funcao1.o: funcao1.c funcao1.h gcc -c funcao1.c clean: rm *.o One of Linker…
-
2
votes1
answer83
viewsC++: Compile using Batch
I’m using cmd to program, and I want to make a batch file that automates the build process. I want him to Compile the files using the command g++ -c ./scr/Nome.cpp -o ./obj/Nome.o -std=c++1z This…
-
2
votes1
answer5984
viewsConvert C code to Assembly MIPS?
How can I generate the assembly code corresponding to the code below: #include <stdio.h> #define LINHA 4 #define COLUNA 5 int tab [LINHA][COLUNA] = { 2016,2012,2008,2004,2000,…
-
2
votes1
answer90
viewsHeader files in C++ using more than once
I am developing a cross-platform project (Windows - Linux - Macos). During its development and while generating documentation (via Doxygen) I realized that there are many files *.h to be called by…
-
2
votes1
answer130
viewsOptimization with GCC
Recently I was wondering if it is possible to compile with some flag optimization, avoid copying two arrays for the section .rodata? Thus, memory addresses would be equal, example const char str[7]…
-
2
votes1
answer180
viewsOn the inclusion of headers (.h) and due compilation
Assuming I create a file .h for the specification of a function func. h #ifndef FUNC_H #define FUNC_H int xPy(int x, int y); #endif //FUNC_H and then created the implementation of this function in a…
-
2
votes2
answers458
viewsError while clearing buffer in GCC (Ubuntu 18.04)
I was watching a tutorial of C, and appeared a part about buffer cleaning using the functions fflush and __fpurge. So far so good, but when I tried applying with __fflush, the GCC returns me the…
-
2
votes2
answers62
viewsVolatile and optimization
I’m studying about the type qualifier volatile in C language, and I took a test. In the attached image we have the comparison of two programs written in C. The one on the left has a variable without…
-
2
votes0
answers53
viewsWhat makes this C program unusable when compiled in different versions of GCC or Clang?
This C language program is compiled in all versions of GCC without any error message, but specifically in GCC 6.3 and 8.3, the executable produces totally inconsistent results. In GCC 8.1 and 10.2…
-
1
votes1
answer8213
viewsError compiling C in gcc: No such file or directory
I’m trying to compile a file. c but I’m not getting it. I type the following command: gcc main.c -o HELLO and the following error appears: gcc: error: main.c: No such file or directory gcc:fatal…
-
1
votes1
answer319
viewsHow to compile c++ with SFML library within the project itself
Hello people who like to program. I have a problem that so far searching on the father of donkeys (Google) I could not solve. I’m doing a little game as part of the evaluation of the programming…
-
1
votes1
answer407
viewsStruct defined in file. c auxiliary (with definition of functions and structs) is not recognized in main
I’m doing a C project, and I have 3 files: 1 . c containing the definitions of functions and structs. 1 . h containing the prototypes of these functions and structs Ae1 . c containing the main. No .…
-
1
votes1
answer260
viewsProblem to install gcc in Ubuntu
I’m trying to install GCC in Ubuntu. When I type sudo apt-get instal gcc asks for a password, but I can’t enter the password. What might be the problem?
-
1
votes1
answer901
viewsHow to install mingw-W64-x86_64-GCC with MSYS2 if I get the message mingw64 is already installed on the system
I am trying to install GCC on my Windows station to do new tests with the use of GCC and some C compiled programs that can be ported to Windows. I’ve used several versions of GCC for Windows, some…
-
1
votes0
answers72
viewsHow to compile gettext on MSYS2 using x86_64-W64-mingw32-gcc
I am doing a series of recompilations to build a custom QEMU for my microcontroller studies, I have succeeded in compiling some packages up to gettext, after reading all the instruction files in…
-
1
votes2
answers268
viewsError when compiling Cmake project
I have the following problem when trying to build a project using Cmake: -- The C compiler identification is unknown -- The CXX compiler identification is unknown CMake Error at CMakeLists.txt:2…
-
1
votes1
answer108
viewsUndefined Reference to 'dlopen'
I’m trying to upload a file .so, but this title error is showing up. Can anyone help me? #include <iostream> #include <dlfcn.h> #include <stdio.h> using namespace std; int main() {…
-
1
votes0
answers82
viewsHow to install Jflex, Yacc, and GCC to create a compiler in windows 8.1?
I know I need to add in the windows path too, because I will do in Otepad, so to compile directly in cmd, I need to add in the windows path.
-
1
votes1
answer1280
viewsHow to compile in Visual Studio Code
I installed the Mingw and in the instutions there is the indication of: Make sure your Compiler Executable is in your Platform form path so the Extension can find it. How do? Thank you, this is all…
-
1
votes1
answer32
viewsMakefile linux - is it possible to restrict the compilation per machine?
Hello I have the following scenario, several machines shared in network, and with directories visible to each other. A developer called the program build on machine 1, but the program only compiles…
-
1
votes0
answers20
viewsProblems with Makefile when switching from debian to freebsd (ifeq and endif)
I am using netbeans to compile some programs in C/C++ it compiles the code remotely on a debian machine (GNU), everything works smoothly, but I tried to compile the same project on a freebsd that…
-
1
votes1
answer184
viewsHow to downgrade gcc, g++ and gfortran compilers?
I’m trying to install the package mice in Rstudio, but the installation fails and shows the error/usr/bin/ld: -lgfortran not found. I noticed that there is no directory called /usr/bin/ld on my PC,…
-
0
votes1
answer323
viewsFailure error[INSTALL_FAILED_INVALID_URI] in GCC
I’ve done everything, installed the GCC C4droid by Google Store, already installed the Android Terminal Emulator and also root ei and free access to $su. However when I try to install GCC using the…
-
0
votes1
answer19
viewsProfiling deposited in the Versioning Repository (Github)
I am doing some tests with an experimental code that makes count of cyclists in the bike lane, for these tests I am using the gprof and gcov that generate several analysis files, one of these…