使用 Qt Creator 和项目文件,如何使用 QMAKE_POST_LINK 复制创建的 dll/so
这个问题似乎在这个步骤中得到了回答
但它对我不起作用。我正在尝试在 Windows 7 上使用 Qt SDK 4.7.0 在 Qt Creator 2.0.1 中执行此操作
如果我尝试:
QMAKE_POST_LINK=copy /Y \Projects\TestFile.txt \Projects\OSPF\TestFile.txt
即使在静态文件上,我得到的输出是:
copy /Y \Projects\TestFile.txt \Projects\OSPF\TestFile.txt
process_begin: CreateProcess(NULL, copy /Y \Projects\TestFile.txt \Projects\OSPF\TestFile.txt, ...) failed.
make (e=2): The system cannot find the file specified.
如果我尝试:
QMAKE_POST_LINK=cmd.exe /C copy /Y \Projects\TestFile.txt \Projects\OSPF\TestFile.txt
我得到的输出是:
cmd.exe /C copy /Y \Projects\TestFile.txt \Projects\OSPF\TestFile.txt
The system cannot find the file specified.
有人吗知道这个问题的答案吗?
This question appears to be answered in this tread
qmake: How do I copy .dll/.so's to the output directory?
but it does not work for me. I'm trying to do this within Qt Creator 2.0.1 with Qt SDK 4.7.0 on Windows 7
If I try:
QMAKE_POST_LINK=copy /Y \Projects\TestFile.txt \Projects\OSPF\TestFile.txt
on even a static file, the output I get is:
copy /Y \Projects\TestFile.txt \Projects\OSPF\TestFile.txt
process_begin: CreateProcess(NULL, copy /Y \Projects\TestFile.txt \Projects\OSPF\TestFile.txt, ...) failed.
make (e=2): The system cannot find the file specified.
If I try:
QMAKE_POST_LINK=cmd.exe /C copy /Y \Projects\TestFile.txt \Projects\OSPF\TestFile.txt
The output I get is:
cmd.exe /C copy /Y \Projects\TestFile.txt \Projects\OSPF\TestFile.txt
The system cannot find the file specified.
Does someone know the answer to this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如错误消息所示,问题出在您要复制的文件的路径中。
我创建了一个简单的 .pro 文件,并使用相同的命令复制文件 - 路径相应更改 - 并且它工作正常。
它相当于
使用此命令将 .pro 文件同一目录中的文件 hello.h 复制到调试文件夹。
As the error message suggests the problem is in the path to the file you want to copy.
I created a simple .pro file and used the same command to copy a file - with the path changed accordingly - and it worked correctly.
it's equivalent to
With this command the file hello.h, in the same directory of the .pro file, is copied to the debug folder.
我得到了它!
显然,如果您从驱动器的根目录开始,则副本将不起作用。回去看看我的例子。我从当前驱动器的根源开始。我也试过了
也没用。
显然你必须相对于你的目录???我不确定真正的限制是什么。
I got it!
Apprently the copy does not work if you start at the root of your drive. Go back and look at my example. I was starting at the root of my current drive. I also tried
That did not work either.
Apprently you have to be relative to you directory???? I'm not sure what the real limitations are.