Skip to content
Advertisement

Tag: gcc

How to link C language libraries?

I am interested in executing a function which is written in C language:- I want to call this fun() through assembly language which i have written:- (NASM 64bit) I have created object file by using these commands nasm -f elf64 MyAsm.asm and gcc -c CLang.c. When I merge these two file with gcc gcc MyASM.o CLang.o i get an error

Errors occurs while the final step of gcc make

I build gcc for arm from scratch. In the final step of building gcc occur errors. I’m counting on your help. make Update Solution: bogdan@bogdan-VirtualBox:~/xtools/build2/final-gcc-2$ $gcc_src/configure –build=$buildmach –target=$targetmach –prefix=$installdir CC=gcc –with-sysroot=$sysrootdir –enable-languages=c –with-gnu-as –with-gnu-ld –disable-multilib –with-float=soft –disable-sjlj-exceptions –disable-nls –enable-threads=posix –disable-libmudflap –disable-libssp –enable-long-longx –with-shared –with-gmp=$installdir –with-mpfr=$installdir With that another errors appeared: Answer Solution: bogdan@bogdan-VirtualBox:~/xtools/build2/final-gcc-2$ $gcc_src/configure –build=$buildmach –target=$targetmach –prefix=$installdir CC=gcc –with-sysroot=$sysrootdir –enable-languages=c

Why does running C code in Vim skip scanf()?

I’m using neovim in arch linux with the gcc C compiler, this is what I use in my .vimrc to compile and run map <F5> :w <CR> :!gcc % -o %< && ./%< <CR> The issue is that my code will run fine but any scanf() functions won’t prompt an input and will be ignored as the program will runs.

How to install gcc8 using devtoolset-8-gcc

I am using CentOS Linux release 7.3.1611 which has gcc 4.8.5 20150623 installed. I am looking for a way to install a newer version of gcc, specially 8.1. I found the following site on how to install gcc v7 link 1 which describes how to install gcc v7 (using devtoolset-7-gcc*). I did follow the guidelines and was able to install

C realloc assertion

Not sure why I’m getting the following error when trying to use realloc: malloc.c:2401: sysmalloc: Assertion `(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize – 1)) == 0)’ failed. Aborted (core dumped) Here is the code fragment Answer In your loop, you check for nstructs

Advertisement