Visual Studio 2008找不到指定的路径 [英] Visual Studio 2008 cant find the path specified

查看:379
本文介绍了Visual Studio 2008找不到指定的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些项目,我没有编译在一个特定的计算机上一段时间,虽然他们在其他人上编译良好 - 相同的确切的项目,而不是副本。我从同一个网络目录编译代码。正如我所说,在一些电脑上,它工作正常。



然而,在我的办公室的电脑上,视觉工作室似乎已经失去了所有的目录结构的感觉。 / p>

首先我遇到麻烦moc(这些项目使用Qt)发现mainwindow.h文件。这是在与.sln,.vproj等相同的目录。我发布了一个关于这个alread的问题:
visual studio 2008 moc无法找到mainwindow.h



通过删除并重新加载mainwindow.h到项目,moc和视觉工作室都能看到它。



现在moc可以找到mainwindow.h,但是uic找不到mainwindow.ui在这一点上没有惊喜。这是我从visual studio得到的错误:

  1> UIC mainwindow.ui 
1>系统找不到指定的路径。
1>文件'mainwindow.ui'无效
1>项目:错误PRJ0019:工具从UIC mainwindow.ui返回错误代码



此处是构建日志中的违规行

  C:\ QtSDK\Desktop\Qt\4.8.1\\\\\\\\\\\\\ ui \\ mainwindow.ui -o ui_mainwindow.h 

现在,如果我进入到解决方案的目录,我可以运行这一行上面,它生成ui_mainwindow.h美丽。



我在这里。显然,文件和权限是罚款,因为我可以编译他们(虽然不是从我的本地副本的visual studio)。显然.vcproj文件是正确的,因为我可以在其他机器上编译。似乎有一些全局调整关于路径,我不知何故无意中对我的视觉工作室的副本。



此外,我重新安装它,同样的行为仍然存在。我想如果在Windows文件结构中有一些令人讨厌的配置文件被分解,这将清除它,但显​​然不是。



在这个设置的计算机工作,我得到这作为第一个输出:

  1> UIC mainwindow.ui 
1> Z:\ dmedine\git-lsl-tst-wrkng\labstreaminglayer\Apps\XDFBrowser> doskey python26 =C:\python26\python
1> MOC mainwindow.h
1> Z :\dmedine\git-lsl-tst-wrkng\labstreaminglayer\Apps\XDFBrowser> doskey python26 =C:\python26\python

我对这些doskey命令感到困惑(我没有创建这些项目,所以有很多困惑)。 moc和uic在Windows上需要python吗?我最近也在玩python,所以也许这是问题的根源,但我想知道为什么。

解决方案

正如我怀疑,我在regedit中添加了一些别名调用不同版本的python的关键是真正的罪魁祸首。这是文件(万一有人好奇):

  doskey ls = dir $ * 
doskey python27-64 = C:\Python27-64\python.exe $ *
doskey python35-32 = C:\python35-32\python.exe $ *

显然(我只注意到这是从检查工作设置和注意doskey行)这些调用doskey销毁Windows上的moc / ui进程。



这没有意义。此外,这是非常不方便,因为现在我必须努力工作真的很难调用不同版本的python。


I have some projects that I haven't compiled on a particular computer for a while, although they compile fine on others -- the same exact projects, not copies. I am compiling code from the same network directory. As I said, on some computers, it works fine.

However, on the computer in my office, visual studio seems to have lost all sense of a directory structure.

First I was having trouble with moc (these projects use Qt) finding the mainwindow.h file. This is in the same directory as the .sln, .vproj, etc. I posted a question about this alread here: visual studio 2008 moc cant find mainwindow.h

By removing and reloading mainwindow.h into the project, moc and visual studio were able to see it.

Now moc can find mainwindow.h, but uic can't find mainwindow.ui -- which really comes as no surprise at this point. This is the error I get from visual studio:

1>UIC mainwindow.ui
1>The system cannot find the path specified.
1>File 'mainwindow.ui' is not valid
1>Project : error PRJ0019: A tool returned an error code from "UIC mainwindow.ui"

and here is the offending line in the build log

C:\QtSDK\Desktop\Qt\4.8.1\msvc2008\bin\uic.exe mainwindow.ui -o ui_mainwindow.h

Now, if I cd into the directory with the solution in it, I can run this line above and it generates ui_mainwindow.h beautifully.

I am at a loss here. Clearly the files and permissions are fine, because I can compile them (although not from my local copy of visual studio). Clearly the .vcproj files are correct, because I can compile on other machines. It seems like there is some global tweak regarding paths that I somehow inadvertently did to my copy of visual studio.

Also, I reinstalled it and the same behavior persists. I figured if there was some offending config file secreted away in the Windows file structure, this would have cleaned it, but obviously not.

On the computer for which this setup does work, I get this as the first output:

1>UIC mainwindow.ui
1>Z:\dmedine\git-lsl-tst-wrkng\labstreaminglayer\Apps\XDFBrowser>doskey python26="C:\python26\python"  
1>MOC mainwindow.h
1>Z:\dmedine\git-lsl-tst-wrkng\labstreaminglayer\Apps\XDFBrowser>doskey python26="C:\python26\python"  

I am a little confused by these doskey commands (I didn't create these projects, so there is much to be confused by). Does moc and uic need python on Windows? I did play around with my doskeys regarding python recently, so maybe this is the root of the problem, but I would like to know why.

解决方案

As I suspected, the key I added in regedit that had some aliases for calling different versions of python was indeed the culprit. Here is that file (in case anyone is curious):

doskey ls=dir $*
doskey python27-64=C:\Python27-64\python.exe $*
doskey python35-32=C:\python35-32\python.exe $*

Apparently (and I only noticed this from inspecting the working setup and noting the doskey lines) these calls to doskey destroy the moc/ui process on Windows.

This makes no sense. Also, it is quite inconvenient because now I have to work really really hard to call different versions of python.

这篇关于Visual Studio 2008找不到指定的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆