Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2003-11-02
6
Medium Priority
?
412 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

636 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