🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.misc
Article #2788

Re: Q: Bor. C++ linker err. when passing template references

#2788
From: Laura Allender
Date: Mon, 11 Sep 1995 20:47
30 lines
1438 bytes
Two possibilities:
1) You haven't included the appropriate classlib files in your code (unlikely)
2) You haven't created an object of TArrayOfString.
      In this case, the template has not been fleshed out so the linker gets
      confused.  If you are trying to test other code and you want to keep this
      problematic stuff around before you finish it add a line like this 
      to your code  (a local variable will do):

            TArrayOfString dontwantitbutneedit;
   
Laura  

In article <431cjr$k49@earth.alpha.net>, pi@earth.execpc.com (Peter Ikusz)
wrote:

> What I am doing should be legal (I think), at least the compiler
> doesn't complain about it.
> 
> typedef TArray<string> TArrayOfString;
> 
> TArrayOfString &Funk(TArrayOfString &MyArray)
>         {
>         string s;
> 
>         MyArray.Flush();  // ok, no linker error
> 
>         MyArray.Add(string); // Fails at link time
> 
>         return MyArray;
>         }
Technical Details
Message-ID: <allender-1109951448000001@129.105.100.106>
Path: arc1-ca.pugleaf.net!movietone.ils.nwu.edu!NewsWatcher!user
References: <431cjr$k49@earth.alpha.net>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!movietone.ils.nwu.edu!NewsWatcher!user
From: allender@ils.nwu.edu (Laura Allender)
Newsgroups: comp.os.ms-windows.programmer.misc,comp.lang.c++
Subject: Re: Q: Bor. C++ linker err. when passing template references
Date: Mon, 11 Sep 1995 14:47:21 -0600
Organization: The Institute for the Learning Sciences
Message-ID: <allender-1109951448000001@129.105.100.106>
References: <431cjr$k49@earth.alpha.net>
NNTP-Posting-Host: allender.ils.nwu.edu