Subject: Newbie template linking problem
From: [email-masked] (Berns, Brian)

10 Jun 1998 03:19:58 -0700
Message-ID: <c=US%a=_%p=NASD%l=[email-masked]>
To: "[email-masked]'" <[email-masked]>

I am trying to compile the following trivial C++ program using Cygwin32
Beta 19 on Windows NT 4.0:

   #include <string>
   using namespace std;

   void main()
   {
      string s = "hello";
   }

All my attempts are choking in the link phase:

   % g++ hello.cpp
   [...]/libstdc++.a [...] multiple definition of `basic_string[...]'
   [...]hello.cc: first defined here

Or, if I try:

   % g++ -frepo -c hello.cpp
   % g++ hello.o -o hello.exe

I get essentially the same problem.

I am new to cygwin32, but I have read the documentation about Borland
vs. Cfront support for templates, Mumit's STL guide for newbies, egcs
(not supported for Windows NT, right?) searched the archives, etc.

Any insight would be appreciated.  I'd love to get my hands on a decent
Win32 C++ compiler, as I am quite tired of Visual C++'s lack of support
for templates.  Hopefully, Cygwin32 is such a compiler, and this will be
an easy question to answer.  Thanks.

-- Brian
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".