🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #41941

GCC 2.7.2+repo templates & libraries

#41941
From: Sean Kelley
Date: Sat, 03 Feb 1996 00:00
36 lines
1660 bytes
Hi,
	I have been using gcc 2.7.2 + repo patch successfully to
build projects using templates on my linux-1.3.5x system. Now I
am trying to build a library containing code which uses templates.
The setup I have tried:

%.so : %.cc
	$(CC) $(CFLAGS) -c -frepo -fpic $< -o $@

%.o : %.cc
	$(CC) $(CFLAGS) -c -frepo $< -o $@

# I have tried using .o extentions but that doesn't seem
# to make a difference
OBJS=a.so b.so c.so ...
libx.so : $(OBJS)
	$(CC) $(CFLAGS) -shared $(OBJ) -o $@ $(LIBS)

APPOBJ=main.o ....
app: $(APPOBJ)
	$(CC) $(CFLAGS) $(APPOBJ) -o $@ -L. -lx $(LIBS)

The library builds but does not instantiate the templates used by
the library (this is the behavior CFRONT compilers use when building
shared libraries). When the application builds, all templates seen
by the application source files (i.e. all templates not used internally
by the library) are instantiated. However, the templates used internally
by the library are not instantiated. Is there a way of doing this? Can
I force GCC to instantiate all template methods used by the library?

	Thanks in advance for any advice!
		Sean.
--
---
skelley@dgs.dgsys.com  [home]
skelley@dsava.com      [work]
Technical Details
Message-ID: <4f06md$lhc@news.dgsys.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,5aeb3c349ca612ba
X-Google-Attributes: gid11318c,public
From: skelley@dgsys.com (Sean Kelley)
Subject: GCC 2.7.2+repo templates & libraries
Date: 1996/02/03
Message-ID: <4f06md$lhc@news.dgsys.com>
X-Deja-AN: 137941726
organization: Digital Gateway Systems
keywords: templates libraries
newsgroups: gnu.gcc.help
summary: looking for a way of building libraries using templates