Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/133.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ libarb.so:无法打开共享对象文件:没有此类文件或目录_C++_C_Linux_Linker_Arbitrary Precision - Fatal编程技术网

C++ libarb.so:无法打开共享对象文件:没有此类文件或目录

C++ libarb.so:无法打开共享对象文件:没有此类文件或目录,c++,c,linux,linker,arbitrary-precision,C++,C,Linux,Linker,Arbitrary Precision,我在Ubuntu中使用 ./configure make sudo make install 并尝试运行以下代码: #include <arb.h> int main() { arb_t x; arb_init(x); arb_const_pi(x, 50 * 3.33); arb_printn(x, 50, 0); printf("\n"); printf("Computed with arb-%s\n", arb_version);

我在Ubuntu中使用

./configure
make
sudo make install 
并尝试运行以下代码:

#include <arb.h>

int main()
{
    arb_t x;
    arb_init(x);
    arb_const_pi(x, 50 * 3.33);
    arb_printn(x, 50, 0); printf("\n");
    printf("Computed with arb-%s\n", arb_version);
    arb_clear(x);
}
我怎样才能解决这个问题


我搜索到一个libarb.so在
/usr/local/lib
中检查并验证这些步骤

  • 检查库是否存在,请使用以下命令
  • 查找/-name“libarb.so”

  • 使用-L选项编译程序,示例如下
  • gcc程序.c-L-larb
    
  • 如果需要,请在运行之前导出库路径。下面的例子
  • export LD\u LIBRARY\u PATH=$LD\u LIBRARY\u PATH:
    

    在大多数情况下(考虑到所有访问权限都已正确设置),上述步骤应能解决链接问题。

    使用
    ldconfig
    命令在链接器缓存中添加库


    为此,请添加您的库存储在
    /etc/ld.so.conf
    中的目录,然后以root用户身份执行
    ldconfig

    尝试添加libarb的路径:-L/usr/local/lib-larb,但是,您确定在/usr/local/lib中有libarb.so,或者类似于libarb.so.x.y.z吗?是的。这是LabB.S.,这是如何与C++相关的?我做了一个C++项目。好像是C。
    error while loading shared libraries: libarb.so:
    cannot open shared object file: No such file or directory
    
     gcc program.c -L <path to library> -larb
    
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<path to library>