Questions tagged as 'gcc'

1
answer

How 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 wish to do it straight from Windows just using GCC (MinGW, in that case). Is this possible in relation to cross-compiling ? How would you do it in my ca...
asked by 01.02.2015 / 18:53
1
answer

Error undefined 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 quadrada est ; " << carre ; } When c...
asked by 24.02.2017 / 11:49
2
answers

How do I create a Makefile in C

I'm having trouble running the 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 the linker er...
asked by 01.10.2016 / 20:41
2
answers

How to generate an .o of the implementation of a .cpp class without the main function in g ++?

I would like to compile the implementation of a related class to only generate an object code of it. This is the class implementation: #include <iostream> #include "gradebook.h" using namespace std; GradeBook::GradeBook(string name_cou...
asked by 17.09.2016 / 22:15
1
answer

How can I upgrade C ++ to C11 on Ubuntu 14.10?

How can I upgrade from C ++ to C11? Details: Ubuntu 14.10 32b GCC 4.9.1 (Ubuntu 4.9.1-16ubuntu6)
asked by 27.03.2015 / 00:15
1
answer

Undefined 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> #include <sstream> using namespace std; us...
asked by 12.07.2015 / 03:49
1
answer

Headers Configuration

I'm trying to compile some code in "C" via GCC (Derbian - Kali Linux), and when compiling, I get error messages saying that files like linux/linkage.h and asm/linkage.h could not be found. When issuing the locate linkage.h command,...
asked by 12.05.2016 / 13:14
1
answer

Problem compiling: no input files compilation terminated

I'm starting to program in C, but then to use GCC it's giving me the following problem when I use cmd:    gcc.exe: fatal error: no imput files compilation terminated I would like to know what to do, since all I found was just about instal...
asked by 17.09.2015 / 19:00
2
answers

Compile c ++ code with make

I'm trying to compile a project in C ++ using the following makefile code: OBJS = main.o src.o SDIR = ./src IDIR = ./include BDIR = ./bin/ ODIR = $(BDIR)/obj all: main %.o: $(SDIR)/%.cpp $(IDIR)/%.h g+...
asked by 27.12.2017 / 16:31
1
answer

About the inclusion of headers (.h) and the proper compilation

Assuming I create a .h file for the specification of a function func.h #ifndef FUNC_H #define FUNC_H int xPy(int x, int y); #endif //FUNC_H Then I created the implementation of this function in a .c file, like: func.c...
asked by 01.01.2019 / 21:01