On Saturday, April 20, 2002, at 03:25  PM, Kyle Moffett wrote:

> I am working on porting a c++ program that I may bring to fink if I can
> get it to work, and I keep running into a problem.  Every time I try to
> link two object files, one with a template the other needs, I get an
> error, for example:

Most compilers (including gcc) don't support separate compilation of 
template functions/methods. This is why almost all the templates in the 
system headers (eg: std::string) have all their methods defined in the 
headers (eg: <string>), rather than compiled into a library.

There is supposed to be a way around this--the C++ standard supports the 
"export" keyword to allow separate compilation. Unfortunately, nothing 
supports the "export" keyword (so much for standards, eh?).

Your best bet is to just cut-paste the method definitions from the 
source file to the header file where the class is defined.

Link: http://www.comeaucomputing.com/techtalk/templates/#whylinkerror

Hth,
Dave


_______________________________________________
Fink-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/fink-devel

Reply via email to