从分离的文件夹

时间:2018-03-08 16:30:09

标签: c++ gcc rpm suse

我没有root权限的SUSE 11.4。我需要使用gcc而不是系统附带的/path/to/gcc-6.2.0(4.3)。我想要使​​用的那个(6.2)在一个不同的文件夹中分开:export LD_LIBRARY_PATH=/lib:/lib64:/path/to/gcc-6.2.0/lib:/path/to/gcc-6.2.0/lib64:/usr/lib:/usr/lib64:$LD_LIBRARY_PATH

为了避免将来可能遇到的问题,我做了以下几点:

~

hello_world.cpp文件夹中,我制作了一个/path/to/gcc-6.2.0/bin/g++ hello_world.cpp -o hw 文件并运行以下内容:

/path/to/gcc-6.2.0/libexec/gcc/x86_64-pc-linux-gnu/6.2.0/cc1plus: error while loading shared libraries: libmpc.so.3: cannot open shared object file: No such file or directory

然后我收到了这个错误:

libmpc.so.3

然后,我去了libgmp.so.10。我看到我依赖于.rpm:我转到此site,在wget文件夹中下载~ rpm -ivh -r /home/unix/me/foo libgmp10-32bit-6.1.2-2.11.x86_64.rpm 文件并运行此命令:

error: Failed dependencies:
    /bin/sh is needed by libgmp10-32bit-6.1.2-2.11.x86_64
    libc.so.6 is needed by libgmp10-32bit-6.1.2-2.11.x86_64
    libc.so.6(GLIBC_2.0) is needed by libgmp10-32bit-6.1.2-2.11.x86_64
    libc.so.6(GLIBC_2.1.3) is needed by libgmp10-32bit-6.1.2-2.11.x86_64
    libc.so.6(GLIBC_2.3) is needed by libgmp10-32bit-6.1.2-2.11.x86_64
    libc.so.6(GLIBC_2.3.4) is needed by libgmp10-32bit-6.1.2-2.11.x86_64
    libc.so.6(GLIBC_2.4) is needed by libgmp10-32bit-6.1.2-2.11.x86_64
    libc.so.6(GLIBC_2.7) is needed by libgmp10-32bit-6.1.2-2.11.x86_64

出现此错误:

libc.so.6

我不知道/usr/lib错误的原因,因为它位于LD_LIBRARY_PATH文件夹中(我在/bin/sh var上执行的第一个导出命令中设置)即可。对于/bin/sh错误,我运行了export SHELL=/bin/sh,设置了--nodeps,并再次运行此项(现在使用rpm -ivh --nodeps -r /home/unix/me/foo libgmp10-32bit-6.1.2-2.11.x86_64.rpm ):

error: unpacking of archive failed on file /usr/lib/libgmp.so.10;5aa15ea0: cpio: symlink failed - Permission denied

现在收到此错误:

Permission denied

请注意,/usr/lib存在gcc-6.2.0,我认为这是因为我无法在ldd文件夹上书写。也许更改此文件夹,在其他地方解压缩......如果可能,怎么做?

嗯,我很失落......我是所有这些东西的新手。

问:我如何使用此cc1plus

只需linux-vdso.so.1 => (0x00007fff987bc000) libmpc.so.3 => not found libmpfr.so.4 => not found libgmp.so.10 => not found libdl.so.2 => /lib64/libdl.so.2 (0x00002b782f503000) libstdc++.so.6 => /path/to/gcc-6.2.0/lib64/libstdc++.so.6 (0x00002b782f708000) libm.so.6 => /lib64/libm.so.6 (0x00002b782fa91000) libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00002b782fd0a000) libc.so.6 => /lib64/libc.so.6 (0x00002b782ff22000) /lib64/ld-linux-x86-64.so.2 (0x00002b782f2e1000) 的信息la命令:

gcc-6.2.0/bin
drwxr-xr-x 2 pbsadmin pbsusers 4096 Dec 15 2016 . drwxr-xr-x 8 pbsadmin pbsusers 4096 Dec 15 2016 .. -rwxr-xr-x 4 pbsadmin pbsusers 2868174 Dec 15 2016 c++ -rwxr-xr-x 1 pbsadmin pbsusers 2862280 Dec 15 2016 cpp -rwxr-xr-x 4 pbsadmin pbsusers 2868174 Dec 15 2016 g++ -rwxr-xr-x 3 pbsadmin pbsusers 2859868 Dec 15 2016 gcc -rwxr-xr-x 2 pbsadmin pbsusers 67083 Dec 15 2016 gcc-ar -rwxr-xr-x 2 pbsadmin pbsusers 67067 Dec 15 2016 gcc-nm -rwxr-xr-x 2 pbsadmin pbsusers 67087 Dec 15 2016 gcc-ranlib -rwxr-xr-x 1 pbsadmin pbsusers 1666022 Dec 15 2016 gcov -rwxr-xr-x 1 pbsadmin pbsusers 1673624 Dec 15 2016 gcov-tool -rwxr-xr-x 4 pbsadmin pbsusers 2868174 Dec 15 2016 x86_64-pc-linux-gnu-c++ -rwxr-xr-x 4 pbsadmin pbsusers 2868174 Dec 15 2016 x86_64-pc-linux-gnu-g++ -rwxr-xr-x 3 pbsadmin pbsusers 2859868 Dec 15 2016 x86_64-pc-linux-gnu-gcc -rwxr-xr-x 3 pbsadmin pbsusers 2859868 Dec 15 2016 x86_64-pc-linux-gnu-gcc-6.2.0 -rwxr-xr-x 2 pbsadmin pbsusers 67083 Dec 15 2016 x86_64-pc-linux-gnu-gcc-ar -rwxr-xr-x 2 pbsadmin pbsusers 67067 Dec 15 2016 x86_64-pc-linux-gnu-gcc-nm -rwxr-xr-x 2 pbsadmin pbsusers 67087 Dec 15 2016 x86_64-pc-linux-gnu-gcc-ranlib 上的

//CVAPI(cv::Rect)cvGetWindowImageRect(const char* name); 命令:

var page = require("webpage").create()
var system = require("system"); 

page.onConsoleMessage = function(msg) 
{
        system.stderr.writeLine("console: " + msg);
};

page.open("https://www.mywebsite.com/",function(status)
{   
    if(status !== "success")
        {
            console.log("status !== \"success1\"")
            phantom.exit(1); // 1 = error exit code
    }

        var aa = page.evaluate(function(s) 
        {
            var sbb = document.getElementsByClassName("name")[0].children[0].children[1].children[0].children[1].children[0];

            sbb.click();

            return sbb;
        })

        console.log(aa)
        phantom.exit() // 0 = success exit code
});

1 个答案:

答案 0 :(得分:2)

我确实使用OpenSUSE,但很少使用RPM。也许这可以帮到你:

rpm  -ivh -nodeps --prefix=/some/other/path/ libgmp10-32bit-6.1.2-2.11.x86_64.rpm