Skip to content
Advertisement

Tag: c++

boost timed_wait doesn’t wait if date is in 2116 year

The example: It works perfectly on Linux at the time – the timed_wait waits for 10 seconds and then returns false. However if I move the system date to 2116 year and re-run the app, the timed_wait call returns false immediately. There is the same problem with the boost’s condition vars. Could please anybody explain what’s wrong with it? Info:

Is it safe to assume memory page size is a power of two?

I am currently working on a portable C program which makes use of the memory page size (as returned by sysconf(_SC_PAGESIZE)). I know most often page size is a power of two to allow efficient management using bitwise operations; I found no guarantee of this anywhere, though. So how safe is it to assume page size is a power of

Netbeans Cpp compiles and runs project, but not test with cppunit

I have a C++ project using libraries such as wiringPi and MySQL Connector. My regular project compiles normally when I run it. When I try to Test one of my tests, it fails building the project. Here’s the output: The tests used to work before the implementation of the DatabaseAdapter & SerialDriver classes. I have added library options to the

qt run shell commands via qprocess

I am developing a small QT application to interact with the terminal, to send commands to the terminal and to read back information printed out. Example: get output of all processes using ps -aux PROBLEM I am able to write information out to the terminal but I dont think it is in the system scope, actual example: Command passed to

How to properly set up ALSA device

Edit: This question is different than the proposed duplicate because I’m asking How do you set the period/buffer size that will work with multiple targets each with different sound hardware?. I have created some code that attempts to set up ALSA before playback of an OGG file. The code below works on one embedded Linux platform, but on another it

uninterrupted execution of Cpp Linux code

Hi is there a method on which I can make my code safe from other OS interrupts etc in Linux GNU? For example if I have the code below and I need to find the exact execution time without other things interrupting my code. I have already looked into pthread_mutex_lock(&cs_mutex); but wasn’t able to stop other operations to run. Answer

compiling c++ projects with dlib library on linux

I want to use dlib library for my c++ projects in linux. I have installed it successfully and able to compile and run the .cpp samples files given under the dlib. I have compiled the sample files through the “g++ -std=c++11 -O3 -I.. ../dlib/all/source.cpp -lpthread -lX11 example_program_name.cpp” given in [http://dlib.net/compile.html][1] but I am unable to use the same command to

Advertisement