4.00 4.10 4.20
WINDOWS NT
kbtool kbbuglist
The information in this article applies to:
- The Development Environment (was Visual Workbench) included with:
Microsoft Visual C++, 32-bit Edition, versions 4.0, 4.1, 4.2
SYMPTOMS
When you use the nmake utility to build a project containing a subproject
of type makefile that does not use nmake as its command, the subproject is
not built. However, the subproject can be built from Developer Studio.
RESOLUTION
There are two ways to resolve the problem:
- Build the project and sub-project separately. This requires either
typing in a batch file or makefile that calls nmake once for each
configuration.
-or-
- When you insert a project of type makefile, rather than changing the
Command line to execute something other than nmake, specify a makefile
which you create. Then create a makefile that executes the command you
would use instead of nmake.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. We are researching this problem and will
post new information here in the Microsoft Knowledge Base as it becomes
available.
MORE INFORMATION
Steps to Reproduce Problem
Method 1:
- Open the MFC sample DLLHusk.
- From Insert menu, choose Project.
- Select type Makefile, give it a generic name, and select it as a
subproject of DLLHusk.
- Click the Create button. Remove the line "NMAKE /f" from the general tab
of subproject generic, and type:
c:\msdev\samples\mfc\advanced\dllhusk\generic\generic.bat
The batch file generic.bat is executed for the inserted subproject
build.
Method 2:
- Create a batch file named Generic.bat in the subproject directory
generic.
- Add some REM lines in the batch file to verify that this file is being
used in the build process, or you can add commands to build one of your
other projects by using NMAKE.
Method 3:
From the Build menu of Developer Studio, build or rebuild your toplevel
project DLLHusk. Note that the subprojects TestDll1 and TesDll2 are
built, the generic project is built, and then the toplevel project
DLLHusk is built.
Method 4:
- Go to a Command prompt.
- Run Vcvars32.bat from the Msdev\Bin directory.
- Move to the DLLHusk project directory, and run this command:
NMAKE /A /F DLLHusk.mak CFG="DLLHusk - Win32 Debug"
Note that the subprojects TestDll1 and TesDll2 are built, and the
toplevel project DLLHusk is also built. However, the generic project
is not built.
Example Resolution
To implement the first resolution from the Resolution section of this
article, follow these steps:
- Create a batch file in the toplevel project directory. In this example,
the toplevel project directory is the Dllhusk directory.
- Add the following lines to the batch file, and name it Dllhusk.bat
assuming C: as the root directory:
call generic\generic.bat
REM If current directory and environment variables got changed
call c:\msdev\bin\vcvars32.bat
cd c:\msdev\samples\mfc\advanced\dllhusk
nmake %1 /D /F dllhusk.mak CFG=%2
- From the Dllhusk directory, run the following command from the Command
line:
dllhusk /A "DLLHusk - Win32 Debug"
This command builds all the subprojects and the toplevel project.
REFERENCES
For additional information, please see the following article in the
Microsoft Knowledge Base:
ARTICLE ID: Q145936
TITLE : How to Insert Existing Projects as Sub-Projects
Also see "Creating an External Project" from the Visual C++ online
documentation.