This is the mail archive of the
cygwin
mailing list for the Cygwin project.
gcc problem
- From: Lauer Rainer <rainer dot lauer at thomson dot net>
- To: "'cygwin at cygwin dot com'" <cygwin at cygwin dot com>
- Cc: "'lauerr at gmx dot net'" <lauerr at gmx dot net>
- Date: Tue, 2 Mar 2004 13:33:14 +0100
- Subject: gcc problem
Hi Gents,
I've installed the latest version of cygwin (as of today 2.03.04). My PC is
running Windows 2000 with service pack 4. Installation is done on my loca
drive d:. I tried a small "C++" and failed, the reason is totally unclear to
me.
The program is:
#include <iostream>
using namespace std;
int main()
{
int selection;
bool loop = true;
while (loop)
{
#if 0
cout << endl;
cout << "*********************\n";
cout << "* Learning bed C++ *\n";
cout << "*********************\n";
cout << ">>> CHAPTER 4 <<<\n";
cout << "=================\n\n";
cout << " 1: Review_5\n";
cout << "-1: Exit\n";
cout << "$ ";
cin >> selection;
cout << endl;
switch (selection)
{
case -1:
loop = false;
break;
case 0:
break;
case 1:
break;
case 2:
break;
case 3:
break;
case 4:
break;
case 5:
break;
case 6:
break;
case 7:
break;
case 8:
break;
case 9:
break;
case 10:
break;
case 11:
break;
}// switch (selection)
#endif
}// while (loop)
return 0;
}//main
The error message is:
$ gcc -o gtest gtest.cc
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccCmpxzX.o(.text+0x4d):gtest.cc:
undefined reference to `std::ios_base::Init::Init[in-charge]()'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccCmpxzX.o(.text+0x68):gtest.cc:
undefined reference to `std::ios_base::Init::~Init [in-charge]()'
collect2: ld returned 1 exit status
Desperatelly I installed the complete (!) cygwin - the result is still the
same.
When I set the #if 0 to #if 1the error message looks like:
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0xa1):gtest.cc:
undefined reference to `std::basic_ostream<char, std::char_traits<char> >&
std::endl<
char, std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&)'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0xa8):gtest.cc:
undefined reference to `std::cout'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0xad):gtest.cc:
undefined reference to `std::basic_ostream<char, std::char_traits<char>
>::operator<<
(std::basic_ostream<char, std::char_traits<char> >&
(*)(std::basic_ostream<char, std::char_traits<char> >&))'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0xbc):gtest.cc:
undefined reference to `std::cout'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0xc1):gtest.cc:
undefined reference to `std::basic_ostream<char, std::char_traits<char> >&
std::operator<< <std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char>>&, char const*)'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0xd0):gtest.cc:
undefined reference to `std::cout'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0xd5):gtest.cc:
undefined reference to `std::basic_ostream<char, std::char_traits<char> >&
std::operator<< <std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char>>&, char const*)'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0xe4):gtest.cc:
undefined reference to `std::cout'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0xe9):gtest.cc:
undefined reference to `std::basic_ostream<char, std::char_traits<char> >&
std::operator<< <std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char>>&, char const*)'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0xf8):gtest.cc:
undefined reference to `std::cout'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0xfd):gtest.cc:
undefined reference to `std::basic_ostream<char, std::char_traits<char> >&
std::operator<< <std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char>>&, char const*)'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0x10c):gtest.cc:
undefined reference to `std::cout'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0x111):gtest.cc:
undefined reference to `std::basic_ostream<char, std::char_traits<char> >&
std::operator<< <std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char>>&, char const*)'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0x120):gtest.cc:
undefined reference to `std::cout'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0x125):gtest.cc:
undefined reference to `std::basic_ostream<char, std::char_traits<char> >&
std::operator<< <std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char>>&, char const*)'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0x134):gtest.cc:
undefined reference to `std::cout'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0x139):gtest.cc:
undefined reference to `std::basic_ostream<char, std::char_traits<char> >&
std::operator<< <std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char const*)'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0x148):gtest.cc:
undefined reference to `std::cout'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0x14d):gtest.cc:
undefined reference to `std::basic_ostream<char, std::char_traits<char> >&
std::operator<< <std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char> >&, char const*)'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0x15b):gtest.cc:
undefined reference to `std::cin'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0x160):gtest.cc:
undefined reference to `std::basic_istream<char, std::char_traits<char>
>::operator>>(int&)'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0x168):gtest.cc:
undefined reference to `std::basic_ostream<char, std::char_traits<char> >&
std::endl
<char, std::char_traits<char> >(std::basic_ostream<char,
std::char_traits<char>>&)'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0x16f):gtest.cc:
undefined reference to `std::cout'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0x174):gtest.cc:
undefined reference to `std::basic_ostream<char, std::char_traits<char>
>::operator<<(std::basic_ostream<char, std::char_traits<char> >&
(*)(std::basic_ostream<char, std::char_traits<char> >&))'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0x1c1):gtest.cc:
undefined reference to `std::ios_base::Init::Init[in-charge]()'
/cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccJwpezK.o(.text+0x1dc):gtest.cc:
undefined reference to `std::ios_base::Init::~Init [in-charge]()'
collect2: ld returned 1 exit status
What's wrong (template, path wrong, library missing)?
Can you help me, please?
Many thanks in advance.
Reggies
Rainer Lauer
Senior Software Engineer
TV, Aftersales and Accessories
DEUTSCHE THOMSON-BRANDT GmbH
Hermann-Schwer-Strasse 3
78048 Villingen-Schwenningen - Germany
tel. +49 (0) 77 21 85 23 27
fax +49 (0) 77 21 85 20 32
Rainer.Lauer@thomson.net
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/