New answers tagged

0

Actually, I was think that problem is related to Raspberry Pi but it wasn't. Somehow, OpenCV doesn't recognize GStreamer library when building OpenCV with cmake and make. Also when I use OpenCV in C++ code stack, OpenCV didn't throw exception when it couldn't find gstreamer support. I added -D WITH_GSTREAMER=ON flag when I'm using cmake command. You can ...


1

The problem is the order of linking. You have to compile your code first (or specify your object files first), and then specify the libraries you want to link to. g++ main.cpp -lboost_system -o test Using this command, and after fixing a small bug in your code (st::cout → std::cout), everything compiles and links correctly. You can simplify the build ...


1

Install (where XX is the last version : sudo apt-cache search libboost-system1): sudo apt-get install libboost-dev libboost-system1.XX-dev libboost-system1.XX libasio-dev C++ #include <iostream> #include <boost/array.hpp> #include <boost/asio.hpp> int main(){ std::cout << "Hello World!" << std::endl; std::cout &...


2

Example server side : // accept one connection client = accept(s, (struct sockaddr *)&rem_addr, &opt); // read data from the client (Rx) bytes_read = read(client, buf, sizeof(buf)); if( bytes_read > 0 ) { printf("received [%s]\n", buf); if(strncmp(buf[0], 'A', 1) == 0){ /* send a response to ...


0

Here is some working code which waits for a sysfs interrupt. Please note the preconditions assumed by the code which are noted in the comments. As an aside please note that the sysfs interface is deprecated and has been removed from some Linux kernels. If you are writing a new library I suggest you use the /dev/gpiochip interface instead. /* 2014-07-06 ...


Top 50 recent answers are included