public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Template problems with link
@ 2002-01-30 16:22 Saravanan
  2002-01-31  8:56 ` alias analysis in gcc sumesh
  0 siblings, 1 reply; 2+ messages in thread
From: Saravanan @ 2002-01-30 16:22 UTC (permalink / raw)
  To: gcc-help

Hi all,
   I have a template declaration as follows in three different files

///////////////////Template.h file///////////////////////////////

#ifndef _TEMPLATE_
#define _TEMPLATE_

template<class Y>
class MyTemplate
{
	Y m_Member;
public:
	Y ob();
};

#endif

////////////////////Template.cpp file////////////////////////

#include "Template.h"

template <class Y>
Y MyTemplate<Y>::ob()
{
	return m_Member;
}

template class MyTemplate<int>; ----> Line that gives error

/////////////////////////Main file//////////////////////////////

#include "Template.h"

main()
{
	MyTemplate<int> ob1;
	ob1.ob();
}


when I compile this, I am able to link properly. But if I remove the 
line that gives error, then I get a link problem. I understand that this
is because of not manually instatiating the template. How do I do
automatic instantiation with g++. I use version 2.96. It is not feasible
for my project to do manual instantiation as done above because there are 
too many templates. Previously we had not seperated the implem and
defenition of the templates. But now that we have, we face link errors.
Someone help!!!!!!!!!!!!!!!!!!!!!!!!!!!!1

		Regards
	Saravanan Palanichami



---------------------------------------------------------
This message sent using EMUmail -- http://www.emumail.com
---------------------------------------------------------

Jumping through hoops to get E-mail on the road? 
You've got two choices: Join the circus, or use MollyMail.

Molly Mail -- http://www.mollymail.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

* alias analysis in gcc
  2002-01-30 16:22 Template problems with link Saravanan
@ 2002-01-31  8:56 ` sumesh
  0 siblings, 0 replies; 2+ messages in thread
From: sumesh @ 2002-01-31  8:56 UTC (permalink / raw)
  To: gcc-help

Hi
    Iam working on trying to develop a optimization technique based on alias
analysis . Can anybody give me pointers on how i can use the alias analysis
module of gcc . Specifically can i get the output of the alias aanalysis of
a program and use it independently ?? Additionaly what kind of a algorithm
is the alias analysis based on ??

thanx
sumesh

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-01-31 16:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-30 16:22 Template problems with link Saravanan
2002-01-31  8:56 ` alias analysis in gcc sumesh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).