Connecting Tech Pros Worldwide Help | Site Map

inclusion compilation model question

bluekite2000@gmail.com
Guest
 
Posts: n/a
#1: January 24th, 2006, 06:55 PM
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!

Stephan Brönnimann
Guest
 
Posts: n/a
#2: January 24th, 2006, 07:15 PM

re: inclusion compilation model question


bluekite2000@gmail.com wrote:[color=blue]
> 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![/color]

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

Victor Bazarov
Guest
 
Posts: n/a
#3: January 24th, 2006, 07:25 PM

re: inclusion compilation model question


bluekite2000@gmail.com wrote:[color=blue]
> I have a bunch of template functions in foo.h and foo.cc using the
> inclusion compilation model.[/color]

What's that?
[color=blue]
> 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![/color]

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
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Boost Workshop at OOPSLA 2004 Jeremy Siek answers 205 July 22nd, 2005 08:05 PM
C++ Header Inclusion Matthew Burgess answers 2 July 19th, 2005 05:51 PM