小编Pué*_*uis的帖子

使用make install在Raspbian Raspberry Pi 3+中安装OpenCV 4时编译错误

`您好,我已经在Raspberry上安装了OpenCV两次。但是,由于一切都在不断发展(操作系统,库等)。这次我收到以下错误:

-- Installing: /usr/local/lib/python2.7/dist-packages/cv2/python-2.7/cv2.so
CMake Error at modules/python2/cmake_install.cmake:61 (file):
  file RPATH_CHANGE could not write new RPATH:

    /usr/local/lib

  to the file:

    /usr/local/lib/python2.7/dist-packages/cv2/python-2.7/cv2.so

  No valid ELF RPATH or RUNPATH entry exists in the file; Error reading ELF
  identification.
Call Stack (most recent call first):
  modules/cmake_install.cmake:162 (include)
  cmake_install.cmake:95 (include)


Makefile:83: recipe for target 'install' failed
make: *** [install] Error 1
Run Code Online (Sandbox Code Playgroud)

我尝试了以下脚本:

    sudo apt-get upgrade
    sudo apt-get install -y build-essential cmake pkg-config
    sudo apt-get install -y libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev
    sudo apt-get install -y …
Run Code Online (Sandbox Code Playgroud)

cmake python-3.x raspbian raspberry-pi3 opencv4

8
推荐指数
1
解决办法
518
查看次数

检测按键何时被释放

我想检查一个键何时被释放,但我不能在没有无限循环的情况下这样做,这使其余的代码暂停。如何在没有无限循环的情况下运行我的程序的其余部分时检测键是否被释放?这是我找到的并且一直在使用的代码:

#include "stdafx.h"
#include <windows.h>
#include <iostream>
#include <fstream>
using namespace std;

int main()
{
    int counter=0;
    ofstream myfile;
    short prev_escape = 0, curr_escape = 0;
    myfile.open("c:\\example.txt");
    while(true)
    {
        if(GetAsyncKeyState(VK_ESCAPE))
            curr_escape = 1;
        else
            curr_escape = 0;
        if(prev_escape != curr_escape)
        {
            counter++;
            if(curr_escape)
            {
                myfile <<"Escape pressed : " << counter << endl;
                cout<<"Escape pressed !" << endl;
            }
            else
            {
                myfile <<"Escape released : " << counter << endl;
                cout<<"Escape released !" << endl;
            }
            prev_escape = curr_escape;
        } …
Run Code Online (Sandbox Code Playgroud)

c++ winapi

1
推荐指数
1
解决办法
7538
查看次数

标签 统计

c++ ×1

cmake ×1

opencv4 ×1

python-3.x ×1

raspberry-pi3 ×1

raspbian ×1

winapi ×1