DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Writing drivers in C++

Templates

Templates may be used within device drivers, but with care. The issue here is that the C++ template prelinker is not run on links within the idbuild command that relinks the kernel with the driver. So, any necessary template instantiations must be compiled into the driver's .o file that is passed to idbuild.

If the driver consists of just one C++ source file, use the CC -Tused compiler option to include the template instantiations. If the driver contains multiple source files and instantiations must be correctly assigned to individual object files, on SVR5, the template prelinker can be run manually with the CC -Tprelink_objects compile option, before coalescing them with the ld -r command.


© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005