Re: [Dev-C++] Template member function (C++ obviously)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Tom C. <jat...@nt...> - 2003-07-29 22:33:36
|
Hi Paul, PDvZ> It appears I'm still having problems... I thought they were gone. TC > TC > Have you tried what I suggested on Sunday? PDvZ> PDvZ> Nope, haven't tried that yet. It's not quite clear to me how this PDvZ> would benefit anything, or how to implement it even :) PDvZ> PDvZ> How can I declare a class's member function outside of the class? PDvZ> The member function I'm having problems with isn't inlined, the PDvZ> implementation of it resides in a .cpp file... only the declaration is PDvZ> in the header file, so I think I shouldn't have any problems with PDvZ> separate definitions anyway... or am I wrong here? I know it sounds an unlikely workaround, but it solved a similar problem I had. Hopefully it will for you, too. You simply place the implementation of your member function, Parse, in a header file called, say, configparser_parse.h, instead of the CPP file you say it currently resides in, and then write '#include "configparser_parse.h"' at the bottom of the header file containing the class definition (but within its inclusion guard). With luck, the linker stops complaining. Here's a link to a page that provides a bit more information: http://www.comeaucomputing.com/techtalk/templates/#whylinkerror --Tom |