Skip to content
Advertisement

Tag: c++

Reading 2 byte at a time from a binary file

I have an elf file that called example. I wrote following code which it’s read the content of the example file in the binary mode and then I wanted to save their content in another file called example.binary. But when I run the following program it shows me a segmentation fault. What’s wrong with this program? I can’t find out

Serial data over UART gets corrupted

I’m developing an application for a development board (Beagle Bone Black) that will send some data over UART peripheral. The developing board runs Linux Kernel (some Debian distribution, 3.8.x Linux Kernel version). For sending and receiving data over UART I use the standard UNIX API: open(), read(), and write() family functions. For setting the communication parameters (baud rate, stop/start bits,

QSqlDatabase: QMYSQL driver not loaded on Ubuntu 15.04 64bits

In Ubuntu 15.04 64 bits I installed Qt5.6 (online installer) and while trying to move my development environment from Windows 7 to Linux I faced the following: Following this, I managed to find ~/Qt/5.6/gcc_64/plugins/sqldrivers/libqsqlmysql.so and then: Tells libmysqlclient_r.so.16 => not found. In fact, it seems I have a newer version: Perhaps that’s the problem. Could some one confirm? How should

Read system call taking forever on Linux

I’m writing a TCP server application in c++. I’m trying to read a line one char at a time from a socket, but the read() system call never returns. And here is the read_from_conn() function Answer The problem is that connfd wasn’t initialized.

Unit test a variable for both true and false

I’m working on a C++ production code here with googletest/googlemock. I’ve stumble upon this idea when working with one of the function in A.cpp: where the header contains: I am stuck in a way that I can only test the function for an expected output of true or an input of false like so: Is there a way to test

Running qt creator via remote desktop

We are developing a software using QT creator. The software is meant to run on windows and on an ARM mini-computer running Debian. To test the software on the mini-computer, we logged in on the mini computer using ssh and an exported display. Some programs like Inkscape run fine, but we can’t get to run QT Creator. It always displays

Building Boost unit test framework on Debian 8.3 ARM

I’m trying to port a larger project to an embedded Linux system (Debian 8.3 ARM). The project requires Boost libraries newer than the system’s Synaptic (1.55 vs. 1.58), so I’ll need to build Boost from source. Usually I pick the most recent version, which was 1.60 when I downloaded things two weeks ago (current is 1.61). The project contains test

Linux. Not printing to file

i’m just coding module for HLDS server extension metamod. I wrote a simple utility function for writing logs in format %LOGNAME%_%DATE%.log In windows that function is working fine, but in linux it create file but write nothing. First I try to search information about that, but I do not found a solution. I try to fflush file handle, set buffer

Advertisement