Questions tagged as 'gcc'

3
answers

Open compiled program in terminal

Hello, I have a console program in C, it compiles well in Ubuntu, but when I open it, it does not generate the console window, I have to open it from the console in order to achieve this. What should I do to have the program open automaticall...
asked by 28.02.2017 / 17:06
1
answer

Linking multiple files

I was doing tests with a couple of files that are planned to be an attempt of script that can be started in bootloader . In principle to link between the 2 files that made the executable ( kernel.c and loader.asm ) wit...
asked by 29.07.2017 / 13:30
1
answer

Is it possible not to declare new memory for a dynamic arrray?

Well, I came across this, and I do not know what to think, I know that to allocate memory the operator new is necessary, however I do not understand why this code works ?, and in any case, what are the possible failures? (Maybe it's a new...
asked by 22.06.2017 / 08:22
1
answer

Error compiling in GCC linux

#include <stdio.h> #include <string.h> #include <stdlib.h> int main(int argc, char const *argv[]) { int a; a=50; //imprimo a printf("El valor de a: %i \n",a); printf("La dire de a: %i \n",&a); //...
asked by 29.03.2017 / 18:54
1
answer

Linker does not link

I'm trying to compile a package; specifically, the plugin gkrellm-leds for gkrellm . I downloaded the sources from packages.ubuntu.com/source/zesty/gkrellm-leds . After compiling and installing it, it does not work. The progra...
asked by 29.05.2017 / 07:52
1
answer

Sum of two integers by inline asm in C

This is my code, I'm running it with gcc on linux, I try to save the result of 3 + 5 in the variable c, and display it on the screen: #include<stdio.h> int main(){ double c; __asm__ ("movw $0x05,%ax"); __asm__("movw $0x0...
asked by 10.01.2018 / 18:58
1
answer

ARM Undefine Instruction

I am compiling in IDE DS-5 an embedded C software for a NXP IMX6UL bare metal product that is an ARM cortex A7 . I'm not using any operating system. The issue is that I am using the compiler of AMR GCC 7.2.1 [arm-none-eabi]...
asked by 05.07.2018 / 22:12
1
answer

Memory addresses of local and global variables

as far as I knew when a program is loaded into memory uses 4 segments: text, data, stack, and heap. The global variables are recorded in the data segment while the local variables in the stack. In addition, by theory it is known that the address...
asked by 13.09.2017 / 21:21
0
answers

Obtain the absolute path of a file in C [Linux]

I'm currently trying to get the absolute path of a file in C [Linux] but I do not get the expected path, but it skips a folder at least that seems to be the error. main.c int main() { char archivos[MAXARCHIVOS][MAXLONG];...
asked by 04.11.2018 / 16:11
1
answer

Segment violation in Nasm with Debian

I did this Hello world with Nasm .. and I'm trying to call C functions by libc .. but the program throws me "segment violation" ; Filename:libc.nasm ; author:me extern printf extern exit global main section .text main: push m...
asked by 04.07.2017 / 01:31