delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/06/10/03:19:58

From: BernsB AT nasd DOT com (Berns, Brian)
Subject: Newbie template linking problem
10 Jun 1998 03:19:58 -0700 :
Message-ID: <c=US%a=_%p=NASD%l=RKV_SRV_EXC-980609222849Z-296158.cygnus.gnu-win32@rkv_srv_exch3.rkv.nasd.com>
To: "'gnu-win32 AT cygnus DOT com'" <gnu-win32 AT cygnus DOT com>

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
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019