1999Q2/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev] [TECHNICAL]  How to generate pre&#45;processor output (template problem). -->
<!--X-From-R13: Ayvire Xbjrgg <vprphorNvuht.pb.am> -->
<!--X-Date: Fri, 28 May 1999 19:40:48 &#45;0700 -->
<!--X-Message-Id: Pine.LNX.3.96.990529142936.1126G&#45;100000#agrajag,internal -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: 374E16BC.46930065#cyberhighway,net -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Re: [MUD-Dev] [TECHNICAL]  How to generate pre-processor outpu</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:icecube#ihug,co.nz">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00345.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00347.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00347.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00328.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00346">Author</A>
&nbsp;|&nbsp;<A HREF="#00346">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00346">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: [MUD-Dev] [TECHNICAL]  How to generate pre-processor output (template problem).</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: "<A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A>" &lt;<A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A>&gt;</LI>
<LI><em>Subject</em>: Re: [MUD-Dev] [TECHNICAL]  How to generate pre-processor output (template problem).</LI>
<LI><em>From</em>: Oliver Jowett &lt;<A HREF="mailto:icecube#ihug,co.nz">icecube#ihug,co.nz</A>&gt;</LI>
<LI><em>Date</em>: Sat, 29 May 1999 14:40:20 +1200 (NZST)</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Sender</em>: <A HREF="mailto:mud-dev-admin#kanga,nu">mud-dev-admin#kanga,nu</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
On Thu, 27 May 1999, Ben Greear wrote:

&gt; I added a cute little templated array class, and everything works like a charm
&gt; on my egcs RH 6.0 Linux box.  However, my primary mud server is BSD, and it's
&gt; compiler is g++ 2.7.2.  It gets all the way to the end and then complains about
&gt; a missing symbol (*puke*).  To add to the fun, its mangled so badly I haven't a
&gt; real clue what it really is supposed to be.  Also, I have neither root nor the
&gt; permission to install a new compiler or any other useful software
&gt; on the BSD box.
&gt; 
&gt; The interesting thing is that it is listed as line 905 in a .h file that
&gt; contains only about 100 lines.  I imagine that is because the #include
&gt; that pulls in the template class....

2.7.2 is really "interesting" to get working correctly with templates..

There are several possible ways to get it working; from memory we did:

- make sure that everything that uses the template pulls in the entire
  template code (ie. you have to declare the whole template body in the
  header)
- put a #pragma interface at the top of each template header
- have a file with #pragma implementation "somefile.h", #include
  "somefile.h" lines for every template header you use
- in the body of that file, reference all the template instantiations you
  need:

  template class list&lt;int&gt;; // I think this is the syntax
  template class map&lt;String, SomeOtherObject&gt;;

  etc.

- compile everything with -fexternal-templates

Then, in theory, g++ should only generate non-inline template code in the
one place - the file with all the #pragma implementation lines. Maybe :)

I moved to using egcs a while back, which has its own set of template
peculiarities, so YMMV.

--
Oliver Jowett - icecube#ihug,co.nz - <A  HREF="http://homepages.ihug.co.nz/~icecube/">http://homepages.ihug.co.nz/~icecube/</A>
KeyID: 1024/679D94C5  Fingerprint: CD94 5270 E2F4 339F 6A90 05C9 9DE4 EECC



_______________________________________________
MUD-Dev maillist  -  MUD-Dev#kanga,nu
<A  HREF="http://www.kanga.nu/lists/listinfo/mud-dev">http://www.kanga.nu/lists/listinfo/mud-dev</A>


</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00331" HREF="msg00331.html">[MUD-Dev] [TECHNICAL]  How to generate pre-processor output (template problem).</A></STRONG>
<UL><LI><EM>From:</EM> Ben Greear &lt;greear#cyberhighway,net&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00345.html">Re: [MUD-Dev] [TECHNICAL]  How to generate pre-processor output (template problem).</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00347.html">Re: [MUD-Dev] [TECHNICAL]  How to generate pre-processor output (template problem).</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00347.html">Re: [MUD-Dev] [TECHNICAL]  How to generate pre-processor output (template problem).</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00328.html">[MUD-Dev] ScryMUD 1.9.3 released.</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00346"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00346"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><STRONG>Re: [MUD-Dev] [TECHNICAL] [SOLVED] (template problem).</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<LI><strong><A NAME="00362" HREF="msg00362.html">Re: [MUD-Dev] [TECHNICAL] [SOLVED] (template problem).</A></strong>, 
Ben Greear <a href="mailto:greear#cyberhighway,net">greear#cyberhighway,net</a>, Tue 01 Jun 1999, 00:05 GMT
</LI>
</ul>
<LI><strong><A NAME="00341" HREF="msg00341.html">Re: [MUD-Dev] [TECHNICAL]  How to generate pre-processor output (template problem).</A></strong>, 
Greg Miller <a href="mailto:gmiller#classic-games,com">gmiller#classic-games,com</a>, Sat 29 May 1999, 00:50 GMT
<UL>
<LI><strong><A NAME="00345" HREF="msg00345.html">Re: [MUD-Dev] [TECHNICAL]  How to generate pre-processor output (template problem).</A></strong>, 
Ben Greear <a href="mailto:greear#cyberhighway,net">greear#cyberhighway,net</a>, Sat 29 May 1999, 01:47 GMT
<UL>
<LI><strong><A NAME="00347" HREF="msg00347.html">Re: [MUD-Dev] [TECHNICAL]  How to generate pre-processor output (template problem).</A></strong>, 
Greg Miller <a href="mailto:gmiller#classic-games,com">gmiller#classic-games,com</a>, Sat 29 May 1999, 03:42 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
<LI><strong><A NAME="00346" HREF="msg00346.html">Re: [MUD-Dev] [TECHNICAL]  How to generate pre-processor output (template problem).</A></strong>, 
Oliver Jowett <a href="mailto:icecube#ihug,co.nz">icecube#ihug,co.nz</a>, Sat 29 May 1999, 02:40 GMT
</LI>
</ul>
</LI>
<LI><strong><A NAME="00328" HREF="msg00328.html">[MUD-Dev] ScryMUD 1.9.3 released.</A></strong>, 
Ben Greear <a href="mailto:greear#cyberhighway,net">greear#cyberhighway,net</a>, Fri 28 May 1999, 00:54 GMT
<UL>
<LI><strong><A NAME="00334" HREF="msg00334.html">Re: [MUD-Dev] ScryMUD 1.9.3 released.</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Fri 28 May 1999, 05:32 GMT
</LI>
</UL>
<UL>
<li>&lt;Possible follow-up(s)&gt;<br>
<LI><strong><A NAME="00329" HREF="msg00329.html">Re: [MUD-Dev] ScryMUD 1.9.3 released.</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Fri 28 May 1999, 03:48 GMT
<UL>
<LI><strong><A NAME="00330" HREF="msg00330.html">Re: [MUD-Dev] ScryMUD 1.9.3 released.</A></strong>, 
Ben Greear <a href="mailto:greear#cyberhighway,net">greear#cyberhighway,net</a>, Fri 28 May 1999, 04:37 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>