From: khan AT xraylith DOT wisc DOT edu (Mumit Khan) Subject: Re: Standard Template Library 1 Jul 1997 23:42:05 -0700 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: <9707020459.AA26234.cygnus.gnu-win32@modi.xraylith.wisc.edu> Original-To: Cheung Kwok Hung , gnu-win32 AT cygnus DOT com In-Reply-To: Your message of "Wed, 02 Jul 1997 02:41:25 +0800." <199707011841 DOT CAA01890 AT cssu147 DOT cs DOT ust DOT hk> Original-Sender: owner-gnu-win32 AT cygnus DOT com Cheung Kwok Hung writes: > Hi, > > Is there anybody try to use the gcc for Win32 with STL? I encounter a lot > of multiple definition errors during linking phase if I use STL container > in more than one source files. When I trace into the system header files. > I find that there is a header file "alloc.h" in /usr/include/g++ which > declare some static variables, which originate multiple declaration. I > also find that the STL headers provided in beta 18 is different from that > I got in "normal" gcc v.2.7.2. What is the problem? > I use quite a bit of STL in my code, and some of it works under gnu-win32 (unfortunately, g++ can't grok most of the most the recent code I've written, so I have to stick to EDG based compilers). It'll be helpful to know what options you use. I tend to instantiate explicitly using instantiation files, and supply -fno-implicit-templates for everything (except for the instantiation files). See my STL Newbie guide (horribly outdated, but still has some useful info IMO) for more info on using STL with g++. URL after sig. regards, Mumit -- khan AT xraylith DOT wisc DOT edu http://www.xraylith.wisc.edu/~khan/ http://www.xraylith.wisc.edu/~khan/software/stl/STL.newbie.html Cc: gnu-win32 mailing list, Cheung Kwok Hung - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".