How do I install libraries for ?
I am running Kali-Linux (debian+gnome). When I compile I get compilation error: cc -Wall -g -c -o frag.o frag.cfrag.c:7:10: fatal error: stropts.h: No such file or directory 7 | #include...
View ArticleWhy does a do-nothing program, written in C, take up 14KB even when compiled...
I was reading an article on static and dynamic linking of libraries in C which suggested that I should compile a program which simply returns 0 through the main function and compare its size with and...
View ArticleHow to overload the
I made the following minimal example for operator overloading in C++. I would like to print the vector as shown below.#include <iostream>#include <vector>using namespace std;ostream&...
View Articlewhat's the meaning of exit code of program with empty void main()?
I made a simple C program with empty main as given below and compiled it with gccint main(){}upon execution, it return exit code as 25,and if I add a printf statement,after including stdio.h, it...
View ArticleParallel bit deposit / parallel bit extract on intel compiler/LLVM?
For CPUs that come with BMI2 instructions, one can use parallel bit deposit (pdep) and parallel bit extract (pext) with GCC using the builtin functions :unsigned int _pdep_u32 (unsigned int, unsigned...
View ArticleCompiling with both -g3 and -O3
Most build environments I've seen have at least two strategies: debug build vs final/optimized/release build. With gcc, this usually means some version of -g vs -O. Now I'm seeing a situation where the...
View ArticleGCC Backend Development - How do I fix `insn does not satisfy its...
I am working on writing a GCC backend for a new architecture. When I try to compile the following simple program with -O0 (note: this error does not occur when optimizations are enabled):int main(){...
View ArticleTradeoffs for gcc configuration options when installing via brew
A coworker and I have both have macbook pro's with macOS 14.x installed. We are starting a project that is using haskell. We ended up with sharply divergent results in installing the haskell stack. His...
View ArticleLinker can't find -lgcc [CMU Malloc Lab]
I'm trying to make the following makefile code## Students' Makefile for the Malloc Lab#TEAM = bovikVERSION = 1HANDINDIR = /afs/cs.cmu.edu/academic/class/15213-f01/malloclab/handinCC = gccCFLAGS = -Wall...
View ArticleCodeBlocks : Starting debugger makes codeblocks crash
so I uninstalled the last codeblocks version (17.12) and installed the new version (20.03 with the combined MinGW installer). now when I use codeblocks it runs well and I am able to build and run...
View ArticleHow do I run GDB and accept GDB commands through Java output console?
I am trying to build a GUI for GCC which has some basic functionalities like compile, link, execute, debug, etc for C++ programs using Java. I am creating strings of command which I pass to the...
View ArticleHow can I simply use pure Mingw GCC after installing MSYS(2)?
So I've been reading online but I'm still very confused. I understand that there are different tools in the Linux-on-Windows world: Msys, Msys2, Cygwin, Mingw and Mingw-64.Here is what I think I know,...
View ArticleBinutils fails to build when building GCC Cross Compiler
I am building a GCC 6.10 cross-compiler. I am using the tutorial from OSDev. When I go and build binutils using my shell sript, I get an error like this: I used a shell script to move ClooG and ISL...
View ArticleLink an ELF binary with a c program
Given only access to a standalone ELF program I want to be able to call a function within the program from my own program.Let's say the below code is main.c#include <stdio.h>extern int...
View ArticleMIPS: what does "lw$28,16($fp)" mean in .s file created by gcc?
I write a simple code for test.After assembly:funadd: addiu $sp,$sp,-24 sw $fp,20($sp) move $fp,$sp sw $4,24($fp) sw $5,28($fp) sw $0,8($fp) lw $3,24($fp) lw $2,28($fp) addu $2,$3,$2 sw $2,8($fp) lw...
View ArticleWhy is MIPS GCC reloading $28 from 16($fp) after function calls (a GOT...
I think I need to paste the full code although it looks long.I write a simple code for test.#include <stdio.h>int funadd(int a, int b){ int x = 0; x = a + b; return x;}int fun(int a, int b){ int...
View ArticleDifference between the GNU ARM Embedded Toolchain and normal gcc/g++ with...
First time poster long time lurker.So I have been using the GNU ARM Embedded Toolchain for a while and compiling my embedded C++ code using arm-none-eabi-g++, because it is what we did in my embedded...
View ArticleSolved: Routine with Do While and For make a unknow error GCC Core dump...
After compiling this program with GCC (Linux or Windows or online test compiler), it fails in different ways each time it runs. I don't understand where I made the mistake.On Ubuntu Linux, the program...
View ArticleLex & Yacc: gcc while compiling y.tab.c gives many expected token errors
I'm implementing a programming language (katir) with the help of yacc and lex. Lex and yacc files are prepared and lex.yy.c and y.tab.c files are created without any error. But when I call gcc -o katir...
View ArticleHow does `g++ -O3` generated `xmm` things affect branch prediction for...
I think code tells everything:➜ project cat branch_prediction_victim.cpp#include <algorithm>#include <ctime>#include <iostream>int main(int argc, char* argv[]){ const size_t...
View Article