0

我在使用Visual Studio Express 2010构建wxWidgets 3.0.0 时遇到问题。多年来,我使用nmake从主干构建了 2.9.x,但从未遇到任何问题。但突然之间似乎不再创建目录等等......

重现:

  • 下载 wxWidgets-3.0.0.7z 并解压到“c:\home\vs2010\wx30”
  • 启动 Visual Studio 命令提示符
  • cd \home\vs2010\wx30\build\msw
  • nmake -f makefile.vc

这是输出:

c:\home\vs2010\wx30\build\msw>nmake -f makefile.vc

Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.

        if not exist vc_mswud mkdir vc_mswud
        if not exist ..\..\lib\vc_lib mkdir ..\..\lib\vc_lib
        if not exist ..\..\lib\vc_lib\mswud mkdir ..\..\lib\vc_lib\mswud
        if not exist ..\..\lib\vc_lib\mswud\wx mkdir ..\..\lib\vc_lib\mswud\wx
        if not exist ..\..\lib\vc_lib\mswud\wx\setup.h copy ..\..\include\wx\msw\setup.h ..\..\lib\vc_lib\mswud\wx\setup.h
Det går inte att hitta sökvägen.
NMAKE : fatal error U1077: 'if' : return code '0x1'
Stop.

c:\home\vs2010\wx30\build\msw>

“Det går inte att hitta sökvägen”在瑞典语中是“找不到路径”。

我在构建之后进行了检查,实际上没有创建任何应该创建的目录,如果它们不存在的话。相反,它们是直接在文件系统根目录中创建的!( C:\lib\vc_lib\mswud\wx)

我尝试在makefile.vc中打印当前工作目录和 MAKEDIR :

clean:
    chdir
    echo $(MAKEDIR)
    -if exist $(OBJS)\*.obj del $(OBJS)\*.obj
    ...

这是输出:

c:\home\vs2010\wx30\build\msw>nmake -f makefile.vc clean

Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.

        chdir
c:\home
        echo c:\home\vs2010\wx30\build\msw
c:\home\vs2010\wx30\build\msw
        if exist vc_mswud\*.obj del vc_mswud\*.obj
        if exist vc_mswud\*.res del vc_mswud\*.res
        if exist vc_mswud\*.pch del vc_mswud\*.pch
        ...

由于某种原因 chdir 报告c:\home但 MAKEDIR 符合预期。

我不知道如何调试这个......

4

2 回答 2

0

I've found the problem, and it has nothing to do with wxWidgets.

Some time ago I wanted to set a default startup directory for cmd so that I didn't always have to do a cd after starting the terminal. I found a trick using the registry (as documented here and many other places) so that the command cd /D c:\home is always executed when a new terminal window is started.

But I had no idea that nmake executes the autorun command as well! So the first thing that happens is that nmake changes directory to c:\home and then tries to run from there, which obviously fails.

于 2013-11-15T07:45:22.887 回答
0

我不知道这里发生了什么,我怀疑与防病毒软件有一些奇怪的交互,因为这是唯一可以解释 Windows 系统 IME 上“不可能”行为的东西。但是,您应该能够通过手动创建这些目录来构建 wxWidgets。

另外,为了进一步调试,您是否尝试过if not exist...直接从命令行运行所有这些命令?它们至少在这种情况下有效吗?

于 2013-11-14T22:14:46.470 回答