Let’s say I have a process A and a process B, and process A would like to pass a C string to process B through a shm_open() + mmap() shared memory. What’s the most latency efficient way? The answer of this post suggested that after C++11, std::atomic is the right way to share data over shared memory. However, I fail
Tag: g++
COTson linux installation
I’m new in linux, and i know that this should be a stupid question, but i didn’t find anything over the internet, so i decide to ask it here: During the configuration of the COTson program using this line of code it gives me an error: CODE: ./configure –simnow_dir ../simnow-linux64-4.6.2pub ERROR : Here is the guide that i follow to
Error installing minqa in a non-standard location in Scientific Linux 6.6
I would ultimately like to install lme4 for R-3.2.5 on a system with Scientific Linux 6.6. I’m on a shared system (I’m compiling R packages for a distributed computing problem), so I need to install all the packages to a non-standard location (/a/lot/of/subdirectories/R-3.2.5 instead of the usual /usr/local/). I’ve already encountered a lot of trouble installing the lme4 dependency, nloptr,
libopencv_core.so.2.4: error adding symbols: DSO missing from command line
I have installed OpenCV 3.3.0 to Ubuntu 16.04. Just want to compile this code. g++ -o main gpu_thresh.cpp ‘pkg-config opencv –cflags –libs’ -lopencv_gpu -lopencv_core g++ -L/usr/local/lib -o main gpu_thresh.cpp ‘pkg-config opencv –cflags –libs’ -lopencv_gpu -lopencv_core I tried to compile it with these ways but still giving same warning and error. /usr/bin/ld: warning: libopencv_core.so.2.4, needed by /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/libopencv_gpu.so, may conflict with libopencv_core.so.3.3
Buggy simple function for binary search (C++)
I wrote a simple function for binary search, but it’s not working as expected. I have a vector with 4000000 32-bit ints. Usually, when I search for a number, if it’s there, it’s found and the index is returned, if it’s not, -1 is returned (the index always corresponds to the value, but that’s not the point). While messing around
What is the maximum number of threads that std::async will create and execute asynchronously?
I have a large number (>>100K) of tasks with very high latency (minutes) and very little resource consumption. Potentially they could all be executed in parallel and I was considering using std::async to generate one future for each task. My question is: what is the maximum number of threads that std::async will create and execute asynchronously? (using g++ 6.x on
Segmentation fault while trying to return a pointer to object from a method
g++ throw me ‘segmentation fault’ while I’m trying to return an object of a classB from a method of a classA. I don’t know how to fix this error, if anybody can tell me why this error happens, I would be grateful. So… here is the code: classA.h classA.cpp classB.h classB.cpp main.cpp Makefile SRC = src INC = include OBJ
Linux – cannot find shared library
Using Code::Blocks (13.12) / g++ to create some test code using the DVB V5 libraries on Ubuntu 14.04. The library was downloaded, built and installed following instructions in the download. Had it all working then had a disk crash. Decided to reinstall everything from scratch rather than use a backup, and downloaded libdvbv5 source again and rebuilt it. All seemed
Calling Assembly code from C++
I’m trying to write my own I/O library, so the first step is just being able to output a character. So far, this only needs to work on Linux. I wrote what I believe to be a solid _putc: label in x86 (with Intel syntax), and I put it in “io.h”, then called it from my main file, “test.cpp”. Here’s
Qt creator platform codegen flags
Seems Qt creator “platform codegen flags” does not take effect (Tools->Options…->Build&Run->Compillers). Mentioned there “-std=c++11” flag however it was not added to Makefile. Also added g++-5 there – also no effect: CXX = g++ CXXFLAGS = -pipe -g -Wall -W $(DEFINES) Should be: CXX = g++-5 CXXFLAGS = -pipe -g -Wall -W $(DEFINES) -std=c++11 How to correctly add flags there. Answer