Do we need to recompile all libraries after we modify the class?

V

Vols

I have a class that many libraries depend on. If I modify the class
with 'adding an argument with default value to an existing member
function', is it necessary to recompile all library?
How about 'changing destructor into virtual' to the class?
I think we don't need to recompile all library if we only add a
constructor to the class or add a data member to the library.
 
M

mlimber

Vols said:
I have a class that many libraries depend on. If I modify the class
with 'adding an argument with default value to an existing member
function', is it necessary to recompile all library?
How about 'changing destructor into virtual' to the class?
I think we don't need to recompile all library if we only add a
constructor to the class or add a data member to the library.

You should recompile them, but see this article on reducing
compile-time dependencies:

http://www.gotw.ca/publications/mill04.htm

Cheers! --M
 
P

Phlip

mlimber said:
Vols wrote:

You should recompile them

Your build system (which is off-topic) should recompile them for you, based
on dependency analysis. If you don't have a build system, get one before
doing anything else. C++ doesn't work without a Makefile or something to
manage these dependencies for you.
but see this article on reducing
compile-time dependencies:

http://www.gotw.ca/publications/mill04.htm

Then read /Large Scale C++ Software Design/ by John Lakos, no matter what
the size of your project.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top