C++ Threads not working, "error: 'thread' is not a member of 'std'"
I'm going to keep it fast and simple.Here's the code I've written:#include <iostream>#include <thread>void myFunc(){ std::cout << "Hello!"<< std::endl;}int main(){ std::thread...
View ArticleLFS: 9.1 - 6.10 readelf missing libdebuginfod.so.1
First time building LFS, I managed to get to the 6th chapter, but am stuck on the check for the second toolchain, after runninggcc -dumpspecs | sed -e 's@/tools@@g' \-e...
View Articleccache failed to create temp files in /var/cache/ccache/ , permission denied....
System Info: OS : Gentoo Linux x86_64 Kernel : Linux 5.4.38 CPU : Intel core i7-7820HQ RAM : 16GiB CC : GCC 9.3.0This problem always happens when I install the emerge software.My ccache directory is...
View ArticleLeft-shift (of float32 array) with AVX2 and filling up with a zero
I have been using the following "trick" in C code with SSE2 for single precision floats for a while now:static inline __m128 SSEI_m128shift(__m128 data){ return...
View ArticleCustom allocator not correctly called in MSVC
I was playing around with custom allocator, but there is nothing printed using MSVC(Microsoft (R) C/C++ Optimizing Compiler Version 19.26.28805 for x86), while there is in GCC / Clang.The comment part...
View Articlecommand 'gcc' failed with exit status 1
I tried all answers but I can't solve the problem of installing Biopython packageI installed Mingw , but when I try to install the package : python setup.py installI get the following error: running...
View Articlegcc optimization better at -O0 than -O3
I recently made some vector-code and an appropriate godbolt example. typedef float v8f __attribute__((vector_size(32)));typedef unsigned v8u __attribute__((vector_size(32)));v8f f(register v8f x){...
View ArticleHow to compile Jonesforth on OSX Mojave?
Attempting to compile Jonesforth on OSX throws:jonesforth.S:1154:10: fatal error: 'asm/unistd.h' file not found".So I tried this advice for Linux, but still complains.This Power PC port throws other...
View ArticleI wonder if my code can be more optimized
I'm student and taking Microprocessor class.Because of COVID-19, I had gotten a simple mid-term assignment writing inline assembly code of QuickSort.Today, I got a score of this assignment and the...
View ArticleHow can I solve this ? error: unable to find library -lmysqlclient
I want to compile for my program and I am stuck here , I am usig freebsd 12.1 and gcc++6.4 + gnu gmake -j20 comandCurent path # mysqlINCDIR += -I../../../extern/mysqlLIBDIR += -L/usr/local/lib/mysqLIBS...
View ArticleCompiling using arm-none-eabi-gcc and linking library liba.a error
I am compiling a hello world program in C on a 64-bit Linux machine. I am using a GCC ARM embedded toolchain to cross compile my program on a FOX G20 V board with an ATMEL AT91SAM9G20 processor. On the...
View ArticleMakefile can I execute a configuration only once? | GCC error cant have two...
Im trying to create a Makefile which compiles some files and creates some outputs but first I want it to execute the configuration only one time and the next time I type make it wont re-execute the...
View ArticleHow can I detect off-by-one errors (OBOEs) in C++ code?
Consider this simple program:#include <array>#include <iostream>#include <cstdlib>int main(int argc, char* argv[]) { std::array<int, 5> arr = {0, 1, 2, 3, 4}; int idx =...
View ArticleWhy is this code 6.5x slower with optimizations enabled?
I wanted to benchmark glibc's strlen function for some reason and found out it apparently performs much slower with optimizations enabled in GCC and I have no idea why.Here's my code:#include...
View Articlegcc / (g)as ignore breakpoint trap (x86)
I've written a C program which includes some assembler code in which I have some instructions which lead to a breakpoint exception (INT3) This is nice when debugging (since you don't have to save and...
View ArticleHow to build against "file-devel"?
I've installed file-devel with dnf install file-devel --enablerepo=PowerTools and it worked fine.I was expecting to find a libmagic.pc file in /usr/lib64/pkgconfig, and then refer to it in my...
View ArticleWhy GCC -mcmodel=large adds an offset to the function call even with -no-pie...
I try to compile a non-PIC code with gcc and I noticed that the assembly code generated by GCC does not use a pure function address to call but adds to it a weird offset. I use GCC 9.3.0 as gcc test.c...
View ArticleWhy cant i check if i have included stdlib.h on tdm-gcc compiler?
I'm writing a header file in C and need stdlib.h for it to work. But, when I check if _STDLIB_H is defined, the pre-processor says it's not, even if I include the file. I have tried it on multiple...
View ArticleWhy do these two function calls give different answers?
Solved: I had my data segment as 0x0000.0000 - 0x000f.ffff and my stack segment as 0x0003.8000 - 0x0003.ffff. When GCC compiles C code, it assumes that the stack and data segments have the same base....
View ArticleWinhttp.h error during compile process: 'WinHttpOpen' was not declared in...
I try figure out, why gcc/g++ compiler throw error likie this:.\http.cpp: In function 'int main()':.\http.cpp:14:5: error: 'WinHttpOpen' was not declared in this scope WinHttpOpen( L"A WinHTTP Example...
View Article