inclusion compilation model question

B

bluekite2000

I have a bunch of template functions in foo.h and foo.cc using the
inclusion compilation model. Now when I write the make file must I
write it so that foo.h and foo.cc are both installed in the INCLUDE
directory. Can I have foo.cc compile into foo.so or something and
intall it in LIB directory instead??? It seems weird to have .cc files
in a header directory!
 
V

Victor Bazarov

I have a bunch of template functions in foo.h and foo.cc using the
inclusion compilation model.

What's that?
> Now when I write the make file must I
write it so that foo.h and foo.cc are both installed in the INCLUDE
directory. Can I have foo.cc compile into foo.so or something and
intall it in LIB directory instead??? It seems weird to have .cc files
in a header directory!

What's 'foo.so'? What's LIB directory? If it seems weird to have .cc
files in a header directory, rename them to .h.

V
 
?

=?iso-8859-1?q?Stephan_Br=F6nnimann?=

I have a bunch of template functions in foo.h and foo.cc using the
inclusion compilation model. Now when I write the make file must I
write it so that foo.h and foo.cc are both installed in the INCLUDE
directory. Can I have foo.cc compile into foo.so or something and
intall it in LIB directory instead??? It seems weird to have .cc files
in a header directory!

foo.cc contains the definition of the template functions, so usually it
must be available together with foo.h and you can't create a shared
library (unless you instantiate the template functions for all
possible/supported types).
If you don't like the .cc suffix, just rename the files to .icc (inline
c++ code)
or whatever seems suitable to you.

Regards, Stephan
 

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

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top