Skip to content
Advertisement

Tag: c++

weird issue with time function in C

I’m trying to get my Beaglebone Green to read an input from a certain pin, and when that pin sees a 1 to 0 transition (defined in pulse()), then it should set a timer. I want to make my timer like this: In idle, the timer is set to a TIMER_HOLD value (900000) To start the timer, I set it

How to compile opencv with gtk 2.x rather than gtk3.x

I’m using tensorflow 1.4 & qt in ubuntu 16.04. The problem is when I include tensorflow(version: 1.4) and opencv (version: 3.2.0) simultaneously, protobuf is conflicted. The error msg is as follows: [libprotobuf FATAL external/protobuf_archive/src/google/protobuf/stubs/common.cc:79] This program was compiled against version 2.6.1 of the Protocol Buffer runtime library, which is not compatible with the installed version (3.4.0). Contact the program author

rlim_t errors with login_cap.h in Debian

I’m trying to compile the bsdmainutils package in Debian that uses the /usr/include/login_cap.h header (from libutil-freebsd-dev), and I’m getting a bunch of errors like this: I’m using Debian testing. Is this a bug in login_cap.h? I see rlim_t defined in /usr/include/x86_64-linux-gnu/bits/resource.h – can I just include that file within login_cap.h? If so, do I have to include the arch-dependent path

Scanning numbers from a file in C

I tried to scan some coordinates [X, Y, Z] from a file, but always returned as segmentation fault. So, I’ve some questions to make: I don’t know how many points are in the file, but if I leave the struct arrays empty, there will be an error. There is a way to do this without defining a max number? Are

how does getline read only up to a newline without seeking?

I’m imagining reading byte by byte would be very inefficient, but reading in bulks would almost always read more than needed, requiring to store the rest of the read input in a global context for all subsequent read operations to find. What am I missing? Answer The prototype is: So it’s clearly using FILE, which is already buffered. So reading

Writing to Linux device driver causes infinite loop

I have been writing a kernel space device driver that can be read from and written to from user space. The open, read, release operations all work perfectly. The problem I am having is with the user-space code that should access the device driver and and write something to it. The user-space program writes to two files: 1) to a

Advertisement