Skip to content

Tag: c++

SIGALRM, interval timers and problems with sleep()

I am working with porting one of our embedded microcontroller libraries to linux and writing a python wrapper around it. One of my low level modules depends on a callback that gets called every 10ms. This callback counts up software timers that each have callbacks of their own. These timers are used all over …

What does `OBJECTS = $(SOURCES:.cpp=.o)` mean in a makefile

I am going over this tutorial and it has something like this I am not sure if I understand the document and would appreciate it if someone could explain the last two statements. Here are my three questions regarding Makefile Question 1 : Whats the difference between and It says that the second case only works…

Shared library on Linux and -fPIC error

I am trying to compile a shared library in Linux using a Makefile created with Cmake, but running make I obtain the following error: I provide the following command in the CMakeLists.txt in order to say that I want a shared (.so) library: add_library(cpp-lib SHARED ${CPP_FILES}) What else do I need to specify…

Retrieve path of symbolic link

I want to store the path of the file the symbolic link is pointing to into bufff. This works with my current implementation using readlink but it grabs extra data I don’t need because my bufsize is arbitrarily valued. I’m not sure how to size it according to the path of what the symbolic link poin…