Unable to understand _IO_puts
I am a computer science 1st year student and we have C programming language as one of our subjects. Since, this is my first time dealing with any programming language at all, please pardon my absolute...
View Articleis there any way to execute binaries without importing anything from .py...
First of all I created binaries of python scripts using the following commands in ubuntu:cython3 --embed -o hello.c hello.py gcc -Os -I /usr/include/python3.5m -o hello hello.c -lpython3.5m -lpthread...
View ArticlePlaying with C++20 Concepts
Is there any option to start playing with C++20 concepts? I have read the story about them written by Bjarne Stroustrup Concepts - The Future of Generic Programming and I am eager to try it out. But in...
View ArticleWhy does address sanitizer overlook seg faults sometimes?
Been using fsanitize=address while compiling C programs, in order to track seg faults for about a year now. Every now and then I encounter a strange behavior, my program would be seg faulting if...
View ArticleJump to a label from inline assembly to C
I have a written piece of code in assembly and at some points of it, I want to jump to a label in C. So I have the following code (shortened version but still, I am having the same problem): #include...
View ArticleValgrind reports thousand of errors in hello world program on Raspberry pi 4B
I have Raspberry pi 4B with latest raspbian upgraded via apt. I am trying to make things work like on raspberry pi 3B but even simple hello_world.c executed via valgrind is not without errors....
View ArticleHow to compile C++ code using modules-ts and gcc (experimental)?
I've been trying to code something using the new experimental feature "modules-ts" that will be included in c++20. I've cloned the gcc branch (found here: https://gcc.gnu.org/wiki/cxx-modules), and I'm...
View ArticleValgrind reports hundreds of errors in Hello World program on RaspberryPi 4B
I have RaspberryPi 4B with latest Raspbian fully updated. I am trying to make things work like on RaspberryPi 3B, but even simple hello_world.c executed via valgrind is not without errors. Installed...
View Articlegcc compile error ld cannot find -l Permission denied
When I execute:gcc D:\project\c\test\collection -Wall -o test main.c -lfoo it reports the error:D:\project\c\test\collection>gcc D:\project\c\test\collection -Wall -o test main.c -lfoo...
View ArticleFASM dll can't run in C (GCC) executable and return 0xC000007B exit code
i have a question about DLL. i want to create a DLL in Assembly with FASM and this is my source code:format PE64 DLL GUI 5.0 entry DllMain include 'EXPORT.INC' SECTION '.test' CODE READABLE EXECUTABLE...
View ArticleHow to compile a static library in Linux?
I have a question: How to compile a static library in Linux with gcc, i.e. I need to compile my source code into a file named out.a. Is it sufficient to simply compile with the command gcc -o out.a...
View Articlevscode gcc.exe errors: main.c: No such file or directory & fatal error: no...
I have encountered this problem. This is my code:#include<stdio.h> int main() { int x; x=1.5+7%3*(int)(2.5+4.7)%2/4; printf("%d",x); getchar(); } It's a simple c program. When I tried to compile...
View ArticleAccess build-id at runtime
I am trying to figure out how to access the build-id generated by the linker at runtime.From this page, https://linux.die.net/man/1/ldWhen I build a test program like:% gcc test.c -o test...
View ArticleUsing pre-compiled headers with CMake
I have seen a few (old) posts on the 'net about hacking together some support for pre-compiled headers in CMake. They all seem a bit all-over the place and everyone has their own way of doing it. What...
View ArticleCMake - Automatically Parsing Dependencies of Precompiled Header?
As of yet, at least to my knowledge, there is no standard way in CMake to specify the addition of a precompiled header (PCH) to a project in a cross-platform manner because the way PCHs are handled by...
View ArticleGCC, CMake, precompiled headers and maintaining dependencies
I'm trying to figure out how to maintain dependencies of my precompiled headers. It includes STL headers, some third-parties like boost and some of our rarely changing infrastructure headers. I came...
View ArticleIn-depth explanation for why we need '-pthread' in Linker option for gcc?
To use pthread_create and other POSIX thread library functions, we need this flag. Why do we need this? Why isn't there a code in /usr that implements these functions like other functions or...
View Articlepkg-config as command line argument in cmd windows 10 back quote problem
Problem description:I am using windows-10 OS and from the cmd window I can use gcc compiler:gcc --version returns: gcc (Rev2, Built by MSYS2 project) 9.2.0 Copyright (C) 2019 Free Software Foundation,...
View ArticleFlex and Bison GCC compile error, ld: library not found for -lfl
While compiling the flex and bison sources for a simple scanner I encounter the following error:$ gcc -o lab5 lab5.tab.c lex.yy.c -lfl ld: library not found for -lfl clang: error: linker command failed...
View ArticleIs it possible to install g++ on CentOS without root?
I've got a core i7 machine wtih CentOS 5.8 that I SSH into and use for running simulations. Unfortunately it only has gcc version 4.1.2. This seems to be producing vastly slower programs than what I...
View Article