Trouble installing CudaSift

流过昼夜 提交于 2020-08-06 04:46:06

问题


I just moved to C++ from Python. I'm using VSCode and I'd like to use the following library: https://github.com/Celebrandil/CudaSift .

So I clone the repo, make a build folder inside, cd to the build folder, use: cmake .. then sudo make and finally sudo make install I get the following output in console:

After completing these steps, I get a shared library file called 'cudasift'.

From what I understand, I must then compile my code, which is the following:

#include <iostream>
#include <opencv4/opencv2/opencv.hpp>
#include <cudaImage.h>
#include <cudaSift.h>

int main(){
    SiftData siftData;
    cv::Mat img;
    cv::imread("Cam_0-19129655-STATIC-exp:200-gain:27.jpg").convertTo(img, CV_32FC1);

    CudaImage cuda_img;
    // cuda_img.Allocate(4000, 3000, 4000, false, NULL, (float*) cuda_img.d_data);

    // cuda_img.Download();

    int numOctaves = 5;
    float initBlur = 1.0f;
    float thresh = 3.5f;
    float minScale = 0.0f;
    bool upScale = false;

    // ExtractSift(siftData, cuda_img, numOctaves, initBlur, thresh, minScale, upScale);

    // FreeSiftData(siftData);

    return 0;
}

So I should run something like: g++ test.cpp -o test 'pkg-config opencv --cflags --libs' -I/path/to/my/headers -L/path/to/my/shared/library -lmylib

The problem being: my newly obtained shared library is called 'cudasift', but -lmylib will look for a file called 'libmylib.so', so I rename my library to 'libcudasift.so', and I get the following error:

/usr/bin/ld: /home/user/Documents/packages/CudaSift/build/libcudasift.so: _ZSt4cout: invalid version 13 (max 0)
/home/user/Documents/packages/CudaSift/build/libcudasift.so: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
Makefile:2: recipe for target 'test' failed
make: *** [test] Error 1
The terminal process terminated with exit code: 2

I then remain stuck here after spending hours searching for an answer. PS: I use VSCode

来源:https://stackoverflow.com/questions/60074229/trouble-installing-cudasift

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!