From: p DOT maggi AT studenti DOT to DOT it (Paolo Maggi) Subject: Linking problems using STL with Mingw32 GCC 2.8.0 26 Feb 1998 09:06:03 -0800 Message-ID: <01bd41fa$6b8d6560$111774c2.cygnus.gnu-win32@s77399.saluzzo.alpcom.it> Reply-To: "Paolo Maggi"

Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit To: Hi, I have a problem with Jan-Japp's Mingw32-GCC 2.8.0 (released on Feb 16, 1998). When a try to compile (and link) programs that use STL I get the following error messages: E:\MINGW32\lib/libstdc++.a(stlinst.o)(.data+0x40):stlinst.cc: multiple definition of `__default_alloc_template::start_free' d:\TEMP\cc9864451.o(.data$_t24__default_alloc_template2b0i0$start_free+0x0): ex04-01.cc: first defined here E:\MINGW32\lib/libstdc++.a(stlinst.o)(.data+0x44):stlinst.cc: multiple definition of `__default_alloc_template::end_free' d:\TEMP\cc9864451.o(.data$_t24__default_alloc_template2b0i0$end_free+0x0):ex 04-01.cc: first defined here E:\MINGW32\lib/libstdc++.a(stlinst.o)(.data+0x48):stlinst.cc: multiple definition of `__default_alloc_template::heap_size' d:\TEMP\cc9864451.o(.data$_t24__default_alloc_template2b0i0$heap_size+0x0):e x04-01.cc: first defined here E:\MINGW32\lib/libstdc++.a(stlinst.o)(.data+0x4c):stlinst.cc: multiple definition of `__malloc_alloc_template<0>::__malloc_alloc_oom_handler' d:\TEMP\cc9864451.o(.data$_t23__malloc_alloc_template1i0$__malloc_alloc_oom_ handler+0x0):ex04-01.cc: first defined here For example, I get these error messages compiling (and linking) the following source code: #include #include #include #include #include int main() { // Initialize array a with 10 integers: int a[10] = {12, 3, 25, 7, 11, 213, 7, 123, 29, -31}; // Find the first element equal to 7 in the array: int* ptr = find(&a[0], &a[10], 7); assert(*ptr == 7 && *(ptr+1) == 11); // Initialize list1 with the same integers as in array a: list list1(&a[0], &a[10]); // Find the first element equal to 7 in list1: list::iterator i = find(list1.begin(), list1.end(),7); assert(*i == 7 && *(++i) == 11); cout << "Type some characters, including an 'x' followed\n" << "by at least one nonwhite-space character: " << flush; istream_iterator in(cin); istream_iterator eos; find(in, eos, 'x'); cout << "The first nonwhite-space character following\n" << "the first 'x' was '" << *(++in) << "'." << endl; } Is there a way out? Thanks a lot. Paolo - 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".