Solved

Visual C++ 6 : Multiple projects in the same workspace with dependencies (strange behavior...)

Posted on 2003-11-02
6
407 Views
Last Modified: 2008-01-09
Hi all!

I'm using visual c++ 6.0, with SP5.  I've got a workspace with three projects in it (i've created a test project reproducing the strange behavior) :
Core (which is a dll)
Engine (another dll, depends on Core)
Test (an exe, depends on both dlls)
All of these projects configurations are builded in separate directories (ie. the defaults : "Debug" & "Release").

The problem i'm having is that when I try to do a "Batch Build" -> "Rebuild all" (with all projects configurations checked out), visual c++ is building the projects in this order :

Deleting intermediate files and output files for project 'Core - Win32 Release'.
Deleting intermediate files and output files for project 'Engine - Win32 Release'.
Deleting intermediate files and output files for project 'Core - Win32 Debug'.
Deleting intermediate files and output files for project 'Engine - Win32 Debug'.
Deleting intermediate files and output files for project 'Engine - Win32 Release'.
Deleting intermediate files and output files for project 'Test - Win32 Release'.
Deleting intermediate files and output files for project 'Engine - Win32 Debug'.
Deleting intermediate files and output files for project 'Test - Win32 Debug'.
--------------------Configuration: Core - Win32 Release--------------------
Compiling...
StdAfx.cpp
Compiling...
Core.cpp
Linking...
--------------------Configuration: Engine - Win32 Release--------------------
Compiling...
StdAfx.cpp
Compiling...
Engine.cpp
Linking...

Engine.exe - 0 error(s), 0 warning(s)
--------------------Configuration: Core - Win32 Debug--------------------
Compiling...
StdAfx.cpp
Compiling...
Core.cpp
Linking...
--------------------Configuration: Engine - Win32 Debug--------------------
Compiling...
StdAfx.cpp
Compiling...
Engine.cpp
Linking...

Engine.exe - 0 error(s), 0 warning(s)
--------------------Configuration: Engine - Win32 Release--------------------
Compiling...
StdAfx.cpp
Compiling...
Engine.cpp
Linking...
--------------------Configuration: Test - Win32 Release--------------------
Compiling...
StdAfx.cpp
Compiling...
Test.cpp
Linking...

Test.exe - 0 error(s), 0 warning(s)
--------------------Configuration: Engine - Win32 Debug--------------------
Compiling...
Skipping... (no relevant changes detected)
StdAfx.cpp
Compiling...
Skipping... (no relevant changes detected)
Engine.cpp
Linking...
--------------------Configuration: Test - Win32 Debug--------------------
Compiling...
StdAfx.cpp
Compiling...
Test.cpp
Linking...

Test.exe - 0 error(s), 0 warning(s)


As you can see, the "Configuration: Engine - Win32 Release" & "Configuration: Engine - Win32 Debug" are both being rebuilded twice.  In this case it's not that bad because there's only 3 projects with a few files, but in my real workspace i've got like 12 projects that are much bigger, and 4 configurations are being rebuilded twice.  A working "Batch Build" would be very useful...  I would like to know what I could possibly be doing wrong and how I can fix this.

Thanks for the help!
Sebastien Lussier
0
Comment
Question by:BobJelly
6 Comments
 
LVL 48

Expert Comment

by:AlexFM
ID: 9669339
Core (which is a dll)
Engine (another dll, depends on Core)
Test (an exe, depends on both dlls)

Try to uncheck dependency of Test on Core in the Project Dependencies dialog. Leave onlu dependencies:
Engine on Core
Test on Engine
0
 
LVL 5

Expert Comment

by:rendaduiyan
ID: 9669393
Try to remove such two configuration under menu "Build->Configuration"
At project tree node "Test", remove 'Engine - Win32 Debug', so to the other one.
good luck.
0
 

Author Comment

by:BobJelly
ID: 9671526
Thanks for your help guys.  Unfortunatelly i've already tried that.  I've also inspected the dsw file and everything seems to be ok in there.  Plus, I deleted all temp files for the dsw and the projects.  I keep getting this strange behavior...

What annoys me is that I had done such thing in the past and never ran into this behavior...  Maybe there's a problem with my VC++ installation, I should try to reinstall it.
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 3

Expert Comment

by:RJSoft
ID: 9675837
I think you need to have your object output directed to one directory. Since there is a dependancy, re-compilation may be happening from a failure of the next project to locate the object results of the previous build. Also how would they run unless you had a path variable set??

RJ
0
 
LVL 5

Expert Comment

by:rendaduiyan
ID: 9676958
You are welcome. The last way left is to modify your makefiles.
Try to remove some rules(or constraits?) from the file generated by VC.
Here, TestMain depends on Dll2, and the makefile belongs to TestMain.
!IF  "$(CFG)" == "TestMain - Win32 Release"

"Dll2 - Win32 Release" :
   cd ".\Dll2"
   $(MAKE) /$(MAKEFLAGS) /F .\Dll2.mak CFG="Dll2 - Win32 Release"
   cd ".."

"Dll2 - Win32 ReleaseCLEAN" :
   cd ".\Dll2"
   $(MAKE) /$(MAKEFLAGS) /F .\Dll2.mak CFG="Dll2 - Win32 Release" RECURSE=1 CLEAN
   cd ".."
!ENDIF
I have no other ideas.
0
 
LVL 49

Accepted Solution

by:
DanRollins earned 500 total points
ID: 9865063
Don't mess with the MAKE file!

It is building twice becasue you are asking it to do that.
In the Batch Build dialog, just uncheck Core and Engine.  
Set the project dependancies of Test to include both DLLs.  When you build Test, it will build the dependant DLLs first.

Then you are done.

-- Dan
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
returning a dereferenced pts in C++ 10 151
Find Visual Studio Tools 2 105
Path to  STL Map header file 1 58
Beginner to Unreal Engine 4 5 80
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

822 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question