Question

I have a problem building wxWidgets 3.0.0 using Visual Studio Express 2010. I have built 2.9.x from trunk for years using nmake and I've never had any problem. But all of a sudden it seems that directories are not created any more etc...

To reproduce:

  • Download wxWidgets-3.0.0.7z and extract it to "c:\home\vs2010\wx30"
  • Start a Visual Studio command prompt
  • cd \home\vs2010\wx30\build\msw
  • nmake -f makefile.vc

This is the output:

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" is "path not found" in swedish.

I checked after the build and none of the directories that should be created if they did not already exist were in fact created. Instead they were created directly in the file system root! (C:\lib\vc_lib\mswud\wx)

I tried printing current working directory and MAKEDIR in makefile.vc:

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

This is the output:

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
        ...

For some reason chdir reports c:\home but MAKEDIR is as expected.

I have no idea how to debug this ...

Was it helpful?

Solution 2

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.

OTHER TIPS

I don't know what is going on here, I'd suspect some weird interaction with anti virus software as this is the only thing which can explain "impossible" behaviour on Windows systems IME. However you should be able to build wxWidgets by creating these directories manually.

Also, to debug it further, have you tried running all these if not exist... commands directly from the command line? Do they work at least in this case?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top