Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/26.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
使用Qt Creator将带有软链接的库复制到远程Linux设备_Linux_Qt_Embedded_Qt Creator_Embedded Linux - Fatal编程技术网

使用Qt Creator将带有软链接的库复制到远程Linux设备

使用Qt Creator将带有软链接的库复制到远程Linux设备,linux,qt,embedded,qt-creator,embedded-linux,Linux,Qt,Embedded,Qt Creator,Embedded Linux,我正在试验一些开源代码,但在将其部署到远程linux设备时遇到了问题。上载库的软链接时出错。我有以下资料: ln: invalid option -- 'v' BusyBox v1.19.4 (2012-09-11 06:53:36 PDT) multi-call binary. Usage: ln [OPTIONS] TARGET... LINK|DIR Create a link LINK or DIR/TARGET to the specified TARGET(s) -s

我正在试验一些开源代码,但在将其部署到远程linux设备时遇到了问题。上载库的软链接时出错。我有以下资料:

ln: invalid option -- 'v'
BusyBox v1.19.4 (2012-09-11 06:53:36 PDT) multi-call binary.

Usage: ln [OPTIONS] TARGET... LINK|DIR

Create a link LINK or DIR/TARGET to the specified TARGET(s)

    -s  Make symlinks instead of hardlinks
    -f  Remove existing destinations
    -n  Don't dereference symlinks - treat like normal file
    -b  Make a backup of the target (if exists) before link operation
    -S suf  Use suffix instead of ~ when making backup files

12:39:46: Failed to upload file '/home/name/Qt/proj/lib/libq.so'.
12:39:46: Deploy step failed.
  • Ubuntu 10.04在Windows 7机器上的VMWare Player中运行
  • 嵌入式linux设备
  • Qt Creator 2.4.1
我在其他Qt项目中使用了相同的系统,并且能够部署到远程linux目标。此项目的不同之处在于,它使用带有软链接的库。现在我的*.pro文件中有以下内容:

# remote deployment of libraries
install_lib.path = /home/name
install_lib.files = ../../lib/*
install_lib.extra = cp ../../lib/* /home/name

# install
target.path = /home/name
sources.path = /home/name
INSTALLS += target sources install_lib
我收到的错误如下:

ln: invalid option -- 'v'
BusyBox v1.19.4 (2012-09-11 06:53:36 PDT) multi-call binary.

Usage: ln [OPTIONS] TARGET... LINK|DIR

Create a link LINK or DIR/TARGET to the specified TARGET(s)

    -s  Make symlinks instead of hardlinks
    -f  Remove existing destinations
    -n  Don't dereference symlinks - treat like normal file
    -b  Make a backup of the target (if exists) before link operation
    -S suf  Use suffix instead of ~ when making backup files

12:39:46: Failed to upload file '/home/name/Qt/proj/lib/libq.so'.
12:39:46: Deploy step failed.
在我未经训练的眼中,Qt似乎试图使用我设备上BusyBox不支持的命令。是否有更好的方法将文件从我的开发环境移动到设备?可能我不需要在库中更改任何内容,但如果需要,我希望自动上传

顺便说一下,我也尝试过使用QMAKE_PRE_LINK和QMAKE_POST_LINK,但没有成功。尝试在Qt Creator中添加部署步骤的情况与此相同。如果有其他方法将我的项目与图书馆联系起来,我也愿意尝试一下

更新

下面是Makefile的一些部分,以显示qmake基于我的*.pro文件生成的内容

INSTALL_PROGRAM = install -m 755 -p

install_install_lib: first FORCE
    @$(CHK_DIR_EXISTS) $(INSTALL_ROOT)/home/name/ || $(MKDIR) $(INSTALL_ROOT)/home/name/ 
    cp ../../lib/* /home/name
    -$(INSTALL_PROGRAM) (edit)/lib/libqhttpserver.so $(INSTALL_ROOT)/home/name/
    -$(INSTALL_PROGRAM) (edit)/lib/libqhttpserver.so.0 $(INSTALL_ROOT)/home/name/
    -$(INSTALL_PROGRAM) (edit)/lib/libqhttpserver.so.0.1 $(INSTALL_ROOT)/home/name/
    -$(INSTALL_PROGRAM) (edit)/lib/libqhttpserver.so.0.1.0 $(INSTALL_ROOT)/home/name/

老实说,install_lib.extra字段似乎没有多大作用。

Creator在不使用Makefile的情况下自行部署文件,因此编辑这些文件不会有帮助


有很多工作要做。从2.4版开始,让Creator更好地与远程linux配合使用,因此您应该尝试获得更新的版本。

BusyBox只有非常简单的实用程序版本。所以BusyBox的ln没有-v选项。也许您可以通过手动从生成的Makefile中删除-v选项来解决这个问题。但是,您需要修改qmake配置,使其生成正确的Makefile。我在Makefile中没有看到“-v”或“ln”。我将用我所拥有的更新我的问题。这可能有助于查看命令导致ln/busybox的错误消息。在Makefile中没有出现任何ln吗?唯一提到ln的是在“SYMLINK=ln-f-s”行中。这也是唯一一次提到符号链接。