| delorie.com/archives/browse.cgi | search |
| Mailing-List: | contact cygwin-help AT cygwin DOT com; run by ezmlm |
| List-Subscribe: | <mailto:cygwin-subscribe AT cygwin DOT com> |
| List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT cygwin DOT com> |
| List-Help: | <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs> |
| Sender: | cygwin-owner AT cygwin DOT com |
| Mail-Followup-To: | cygwin AT cygwin DOT com |
| Delivered-To: | mailing list cygwin AT cygwin DOT com |
| Message-ID: | <71A0F7B0F1F4F94F85F3D64C4BD0CCFE0EDC1A@bmkc1svmail01.am.mfg> |
| From: | "Parker, Ron" <rdparker AT butlermfg DOT com> |
| To: | cygwin AT cygwin DOT com |
| Subject: | C++ Link Error |
| Date: | Mon, 14 Apr 2003 14:39:31 -0500 |
| MIME-Version: | 1.0 |
I am experiencing a link error with C++ on Cygwin. I have boiled it down to
a simple test case. As far as I know I have every Cygwin package installed.
But I have been upgrading this installation for quite some time.
If I take a simple test.cpp file:
=================================
#include <iostream>
using std::cout;
main()
{
cout << "Test\n";
return 0;
}
=================================
And run g++, g++ (GCC) 3.2 20020927 (prerelease), against it. I get the
following:
$ g++ -o test test.cpp -lstdc++
/e/DOCUME~1/rdparker/LOCALS~1/Temp/ccWlq6qX.o(.text+0x27):test.cpp:
undefined reference to `_STL::cout'
/e/DOCUME~1/rdparker/LOCALS~1/Temp/ccWlq6qX.o(.text+0x5d):test.cpp:
undefined reference to `_STL::ios_base::_Loc_init::_Loc_init[in-charge]()'
/e/DOCUME~1/rdparker/LOCALS~1/Temp/ccWlq6qX.o(.text+0x78):test.cpp:
undefined reference to `_STL::ios_base::Init::Init[in-charge]()'
/e/DOCUME~1/rdparker/LOCALS~1/Temp/ccWlq6qX.o(.text+0x93):test.cpp:
undefined reference to `_STL::ios_base::Init::~Init [in-charge]()'
/e/DOCUME~1/rdparker/LOCALS~1/Temp/ccWlq6qX.o(.text+0xae):test.cpp:
undefined reference to `_STL::ios_base::_Loc_init::~_Loc_init [in-charge]()'
/e/DOCUME~1/rdparker/LOCALS~1/Temp/ccWlq6qX.o(.text$_ZN4_STL8ios_base23_M_ch
eck_exception_maskEv+0x1d):test.cpp: undefined reference to
`_STL::ios_base::_M_throw_failure()'
collect2: ld returned 1 exit status
Having '-lstdc++' on the end or not doesn't seem to matter.
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |