* cygwin gcc 3.0.4 problem
@ 2002-03-10 12:29 Pete Barrie
2002-03-10 12:58 ` Oscar Fuentes
2002-03-10 13:02 ` Kayvan A. Sylvan
0 siblings, 2 replies; 5+ messages in thread
From: Pete Barrie @ 2002-03-10 12:29 UTC (permalink / raw)
To: gcc-help
Win2000 Cygwin 1.3.10-1 binutils 2.11.2
Hi. I've just built 3.0.4 native on Cygwin. Build seemed to
go fine and I can compile/run C prog hello.c
However C++ hello.cpp fails as shown below. Is this something
trivial I am missing?
Thanks for any help
Pete
$ cat hello.cpp
#include <iostream.h>
int main ()
{
cout << "Hello World!";
return 0;
}
$ gcc -v hello.cpp
Reading specs from /usr/local/lib/gcc-lib/i686-pc-cygwin/3.0.4/specs
Configured with: gccSource/gcc-3.0.4/configure --enable-threads=win32
--enable-l
anguages=c,c++
Thread model: win32
gcc version 3.0.4
/usr/local/lib/gcc-lib/i686-pc-cygwin/3.0.4/cc1plus.exe -v -D__GNUC__=3
-D__GNU
C_MINOR__=0 -D__GNUC_PATCHLEVEL__=4 -D_X86_=1 -D_X86_=1 -Asystem=winnt
-D__NO_IN
LINE__ -D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__
-D__tune_i686__ -D__tune_pentiumpro__
-D__stdcall=__attribute__((__stdcall__)) -
D__cdecl=__attribute__((__cdecl__)) -D_stdcall=__attribute__((__stdcall__))
-D_c
decl=__attribute__((__cdecl__)) -D__declspec(x)=__attribute__((x))
-D__i386__ -D
__i386 -D__CYGWIN32__ -D__CYGWIN__ -Dunix -D__unix__ -D__unix -isystem
/usr/loca
l/include -idirafter /usr/local/i686-pc-cygwin/include -idirafter
/usr/include -
idirafter /usr/local/i686-pc-cygwin/include/w32api -idirafter
/usr/include/w32ap
i hello.cpp -D__GNUG__=3 -D__GXX_DEPRECATED -D__EXCEPTIONS
-D__GXX_ABI_VERSION=1
00 -quiet -dumpbase hello.cpp -version -o /tmp/ccEJ7efr.s
ignoring nonexistent directory "/usr/local/i686-pc-cygwin/include"
ignoring nonexistent directory "/usr/local/i686-pc-cygwin/include/w32api"
GNU CPP version 3.0.4 (cpplib) (80386, BSD syntax)
GNU C++ version 3.0.4 (i686-pc-cygwin)
compiled by GNU C version 3.0.4.
ignoring nonexistent directory "NONE/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/local/include/g++-v3
/usr/local/include/g++-v3/i686-pc-cygwin
/usr/local/include/g++-v3/backward
/usr/local/lib/gcc-lib/i686-pc-cygwin/3.0.4/include
/usr/include
/usr/include/w32api
End of search list.
as --traditional-format -o /tmp/ccsfB8Tw.o /tmp/ccEJ7efr.s
/usr/local/lib/gcc-lib/i686-pc-cygwin/3.0.4/collect2.exe
-L/usr/local/i686-pc-c
ygwin/lib/w32api/ -L/usr/lib/w32api/ -Bdynamic --dll-search-prefix=cyg
/usr/lib/
crt0.o -L/usr/local/lib/gcc-lib/i686-pc-cygwin/3.0.4 -L/usr/lib/mingw
/tmp/ccsfB
8Tw.o -lgcc -lcygwin -luser32 -lkernel32 -ladvapi32 -lshell32 -lgcc
/tmp/ccsfB8Tw.o(.text+0x36):hello.cpp: undefined reference to `std::cout'
/tmp/ccsfB8Tw.o(.text+0xce):hello.cpp: undefined reference to
`std::ios_base::In
it::Init()'
/tmp/ccsfB8Tw.o(.text+0x12c):hello.cpp: undefined reference to
`std::ios_base::I
nit::~Init()'
/tmp/ccsfB8Tw.o(.text$_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc+0x
c):hello.cpp: undefined reference to `__gxx_personality_sj0'
/tmp/ccsfB8Tw.o(.text$_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc+0x
157):hello.cpp: undefined reference to `__cxa_begin_catch'
/tmp/ccsfB8Tw.o(.text$_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc+0x
1b3):hello.cpp: undefined reference to `__cxa_rethrow'
/tmp/ccsfB8Tw.o(.text$_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc+0x
1e3):hello.cpp: undefined reference to `__cxa_end_catch'
/tmp/ccsfB8Tw.o(.text$_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc+0x
1f1):hello.cpp: undefined reference to `__cxa_end_catch'
/tmp/ccsfB8Tw.o(.text$_ZNSo6sentryD1Ev+0x3b):hello.cpp: undefined reference
to `
std::uncaught_exception()'
/tmp/ccsfB8Tw.o(.text$_ZNSo5writeEPKci+0xc):hello.cpp: undefined reference
to `_
_gxx_personality_sj0'
/tmp/ccsfB8Tw.o(.text$_ZNSo5flushEv+0xc):hello.cpp: undefined reference to
`__gx
x_personality_sj0'
/tmp/ccsfB8Tw.o(.text$_ZNSt13_Format_cacheIcE6_S_getERSt8ios_base+0xf):hello.cpp
: undefined reference to `__gxx_personality_sj0'
/tmp/ccsfB8Tw.o(.text$_ZNSt13_Format_cacheIcE6_S_getERSt8ios_base+0x45):hello.cp
p: undefined reference to `std::ios_base::xalloc()'
/tmp/ccsfB8Tw.o(.text$_ZNSt13_Format_cacheIcE6_S_getERSt8ios_base+0x88):hello.cp
p: undefined reference to `operator new(unsigned)'
/tmp/ccsfB8Tw.o(.text$_ZNSt13_Format_cacheIcE6_S_getERSt8ios_base+0xa4):hello.cp
p: undefined reference to `std::_Format_cache<char>::_Format_cache()'
/tmp/ccsfB8Tw.o(.text$_ZNSt13_Format_cacheIcE6_S_getERSt8ios_base+0xd3):hello.cp
p: undefined reference to `operator delete(void*)'
/tmp/ccsfB8Tw.o(.text$_ZNSt13_Format_cacheIcE6_S_getERSt8ios_base+0xff):hello.cp
p: undefined reference to `operator delete(void*)'
/tmp/ccsfB8Tw.o(.text$_ZNSt13_Format_cacheIcE6_S_getERSt8ios_base+0x11f):hello.c
pp: undefined reference to `std::ios_base::register_callback(void
(*)(std::ios_b
ase::event, std::ios_base&, int), int)'
/tmp/ccsfB8Tw.o(.text$_ZNSt9basic_iosIcSt11char_traitsIcEE5clearESt12_Ios_Iostat
e+0x6c):hello.cpp: undefined reference to `std::__throw_ios_failure(char
const*)
'
/tmp/ccsfB8Tw.o(.text$_ZNSt8auto_ptrISt13_Format_cacheIcEED1Ev+0x29):hello.cpp:
undefined reference to `operator delete(void*)'
/tmp/ccsfB8Tw.o(.text$_ZNSt13_Format_cacheIcE11_S_callbackENSt8ios_base5eventERS
1_i+0xc):hello.cpp: undefined reference to `__gxx_personality_sj0'
/tmp/ccsfB8Tw.o(.text$_ZNSt13_Format_cacheIcE11_S_callbackENSt8ios_base5eventERS
1_i+0xb3):hello.cpp: undefined reference to `operator delete(void*)'
/tmp/ccsfB8Tw.o(.text$_ZNSt13_Format_cacheIcE11_S_callbackENSt8ios_base5eventERS
1_i+0xdb):hello.cpp: undefined reference to `operator new(unsigned)'
/tmp/ccsfB8Tw.o(.text$_ZNSt13_Format_cacheIcE11_S_callbackENSt8ios_base5eventERS
1_i+0xf7):hello.cpp: undefined reference to
`std::_Format_cache<char>::_Format_c
ache()'
/tmp/ccsfB8Tw.o(.text$_ZNSt13_Format_cacheIcE11_S_callbackENSt8ios_base5eventERS
1_i+0x144):hello.cpp: undefined reference to `operator delete(void*)'
/tmp/ccsfB8Tw.o(.text$_ZNSt13_Format_cacheIcE11_S_callbackENSt8ios_base5eventERS
1_i+0x160):hello.cpp: undefined reference to `operator delete(void*)'
/tmp/ccsfB8Tw.o(.text$_ZNSt13_Format_cacheIcE11_S_callbackENSt8ios_base5eventERS
1_i+0x177):hello.cpp: undefined reference to `__cxa_begin_catch'
/tmp/ccsfB8Tw.o(.text$_ZNSt13_Format_cacheIcE11_S_callbackENSt8ios_base5eventERS
1_i+0x186):hello.cpp: undefined reference to `__cxa_end_catch'
/tmp/ccsfB8Tw.o(.text$_ZNSt13_Format_cacheIcE11_S_callbackENSt8ios_base5eventERS
1_i+0x1c6):hello.cpp: undefined reference to `__cxa_call_unexpected'
/tmp/ccsfB8Tw.o(.text$_ZNSt13_Format_cacheIcE11_M_populateERSt8ios_base+0xf):hel
lo.cpp: undefined reference to `__gxx_personality_sj0'
/tmp/ccsfB8Tw.o(.text$_ZNSt13_Format_cacheIcE11_M_populateERSt8ios_base+0x291):h
ello.cpp: undefined reference to `std::locale::~locale()'
/tmp/ccsfB8Tw.o(.text$_ZNSt13_Format_cacheIcE11_M_populateERSt8ios_base+0x2bb):h
ello.cpp: undefined reference to `std::locale::~locale()'
/tmp/ccsfB8Tw.o(.text$_ZNSt13_Format_cacheIcED1Ev+0xc):hello.cpp: undefined
refe
rence to `__gxx_personality_sj0'
/tmp/ccsfB8Tw.o(.text$_ZNSt13_Format_cacheIcED1Ev+0xa6):hello.cpp:
undefined ref
erence to `__cxa_call_unexpected'
/tmp/ccsfB8Tw.o(.text$_ZSt9use_facetISt8numpunctIcEERKT_RKSt6locale+0x51):hello.
cpp: undefined reference to `std::__throw_bad_cast()'
/tmp/ccsfB8Tw.o(.text$_ZNSsD1Ev+0xc):hello.cpp: undefined reference to
`__gxx_pe
rsonality_sj0'
/tmp/ccsfB8Tw.o(.text$_ZNSs6assignERKSs+0xf):hello.cpp: undefined reference
to `
__gxx_personality_sj0'
/tmp/ccsfB8Tw.o(.text$_ZNSs4_Rep10_M_destroyERKSaIcE+0xc):hello.cpp:
undefined r
eference to `__gxx_personality_sj0'
/tmp/ccsfB8Tw.o(.text$_ZNSs4_Rep10_M_destroyERKSaIcE+0xdf):hello.cpp: undefined
reference to `__cxa_call_unexpected'
/tmp/ccsfB8Tw.o(.text$_ZNSs4_Rep8_M_cloneERKSaIcEj+0xc):hello.cpp:
undefined ref
erence to `__gxx_personality_sj0'
/tmp/ccsfB8Tw.o(.text$_ZNSs4_Rep8_M_cloneERKSaIcEj+0xa7):hello.cpp:
undefined re
ference to `__cxa_begin_catch'
/tmp/ccsfB8Tw.o(.text$_ZNSs4_Rep8_M_cloneERKSaIcEj+0xc7):hello.cpp:
undefined re
ference to `__cxa_rethrow'
/tmp/ccsfB8Tw.o(.text$_ZNSs4_Rep8_M_cloneERKSaIcEj+0xed):hello.cpp:
undefined re
ference to `__cxa_end_catch'
/tmp/ccsfB8Tw.o(.text$_ZNSs4_Rep10_M_refcopyEv+0xc):hello.cpp: undefined
referen
ce to `__gxx_personality_sj0'
/tmp/ccsfB8Tw.o(.text$_ZNSs4_Rep10_M_refcopyEv+0x95):hello.cpp: undefined
refere
nce to `__cxa_call_unexpected'
/tmp/ccsfB8Tw.o(.text$_ZNSs4_Rep9_S_createEjRKSaIcE+0xc):hello.cpp:
undefined re
ference to `__gxx_personality_sj0'
/tmp/ccsfB8Tw.o(.text$_ZNSs4_Rep9_S_createEjRKSaIcE+0x53):hello.cpp:
undefined r
eference to `std::__throw_length_error(char const*)'
/tmp/ccsfB8Tw.o(.text$_ZNSt24__default_alloc_templateILb1ELi0EE8allocateEj+0xc):
hello.cpp: undefined reference to `__gxx_personality_sj0'
/tmp/ccsfB8Tw.o(.text$_ZNSt23__malloc_alloc_templateILi0EE13_S_oom_mallocEj+0x1f
):hello.cpp: undefined reference to `std::__throw_bad_alloc()'
/tmp/ccsfB8Tw.o(.data$_ZTISt9exception+0x0):hello.cpp: undefined reference
to `v
table for __cxxabiv1::__class_type_info'
/tmp/ccsfB8Tw.o(.text$_ZNKSt8ios_base6getlocEv+0x16):hello.cpp: undefined
refere
nce to `std::locale::locale(std::locale const&)'
/tmp/ccsfB8Tw.o(.text$_ZNSt8ios_base5pwordEi+0x3a):hello.cpp: undefined
referenc
e to `std::ios_base::_M_grow_words(int)'
/tmp/ccsfB8Tw.o(.text$_ZNSt15_STL_mutex_lock13_M_initializeEv+0x18):hello.cpp:
u
ndefined reference to `std::_GLIBCPP_mutex_init()'
/tmp/ccsfB8Tw.o(.text$_ZNSt15_STL_mutex_lock13_M_initializeEv+0x1d):hello.cpp:
u
ndefined reference to `std::_GLIBCPP_once'
/tmp/ccsfB8Tw.o(.text$_ZNSt15_STL_mutex_lock13_M_initializeEv+0x44):hello.cpp:
u
ndefined reference to `std::_GLIBCPP_mutex'
/tmp/ccsfB8Tw.o(.text$_ZNSt15_STL_mutex_lock13_M_initializeEv+0x60):hello.cpp:
u
ndefined reference to `std::_GLIBCPP_mutex_address'
/tmp/ccsfB8Tw.o(.text$_ZNSt15_STL_mutex_lock13_M_initializeEv+0x68):hello.cpp:
u
ndefined reference to `std::_GLIBCPP_mutex_address_init()'
/tmp/ccsfB8Tw.o(.text$_ZNSt15_STL_mutex_lock13_M_initializeEv+0x9d):hello.cpp:
u
ndefined reference to `std::_GLIBCPP_mutex'
collect2: ld returned 1 exit status
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: cygwin gcc 3.0.4 problem
2002-03-10 12:29 cygwin gcc 3.0.4 problem Pete Barrie
@ 2002-03-10 12:58 ` Oscar Fuentes
2002-03-10 13:03 ` Oscar Fuentes
2002-03-10 13:02 ` Kayvan A. Sylvan
1 sibling, 1 reply; 5+ messages in thread
From: Oscar Fuentes @ 2002-03-10 12:58 UTC (permalink / raw)
To: Pete Barrie; +Cc: gcc-help
Pete Barrie <peter@cis.strath.ac.uk> writes:
> Win2000 Cygwin 1.3.10-1 binutils 2.11.2
>
> Hi. I've just built 3.0.4 native on Cygwin. Build seemed to
> go fine and I can compile/run C prog hello.c
>
> However C++ hello.cpp fails as shown below. Is this something
> trivial I am missing?
>
> Thanks for any help
>
> Pete
>
> $ cat hello.cpp
> #include <iostream.h>
>
> int main ()
> {
> cout << "Hello World!";
> return 0;
> }
>
>
>
> $ gcc -v hello.cpp
Does it fail with
$ g++ hello.cpp
???
g++ automatically links the libraries needed by the C++ library. GCC
not.
BTW,
#include <iostream.h>
is not standard C++. Use
#include <iostream>
--
Oscar
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: cygwin gcc 3.0.4 problem
2002-03-10 12:29 cygwin gcc 3.0.4 problem Pete Barrie
2002-03-10 12:58 ` Oscar Fuentes
@ 2002-03-10 13:02 ` Kayvan A. Sylvan
2002-03-10 14:08 ` Pete Barrie
1 sibling, 1 reply; 5+ messages in thread
From: Kayvan A. Sylvan @ 2002-03-10 13:02 UTC (permalink / raw)
To: Pete Barrie; +Cc: gcc-help
[-- Attachment #1: Type: text/plain, Size: 1913 bytes --]
On Sun, Mar 10, 2002 at 08:28:48PM +0000, Pete Barrie wrote:
>
> Win2000 Cygwin 1.3.10-1 binutils 2.11.2
>
> Hi. I've just built 3.0.4 native on Cygwin. Build seemed to
> go fine and I can compile/run C prog hello.c
>
> However C++ hello.cpp fails as shown below. Is this something
> trivial I am missing?
>
> Thanks for any help
>
> Pete
>
> $ cat hello.cpp
> #include <iostream.h>
>
> int main ()
> {
> cout << "Hello World!";
> return 0;
> }
Your problem is probably due to needing to give your gcc3 (in /usr/local/bin)
the path to the right libstdc++
Try:
/usr/local/bin/g++ -o foo foo.cpp -L/usr/local/lib
In my case, this works for me:
/usr/local/gcc3/bin/g++ -o foo foo.cpp -L /usr/local/gcc3/lib
Also, interestingly, the latest CVS version of gcc-3 produces the following
message:
/usr/local/gcc3-cvs/bin/g++ -o foo3 foo.cc -L /usr/local/gcc3-cvs/lib
In file included from /usr/local/gcc3-cvs/include/g++-v3/backward/iostream.h:31,
from foo.cc:1:
/usr/local/gcc3-cvs/include/g++-v3/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.
This is fixed by changing foo.cpp to the modern C++ style:
#include <iostream>
using std:: cout; using std::endl;
int main ()
{
cout << "Hello World!" << endl;
return 0;
}
---Kayvan
--
Kayvan A. Sylvan | Proud husband of | Father to my kids:
Sylvan Associates, Inc. | Laura Isabella Sylvan | Katherine Yelena (8/8/89)
http://sylvan.com/~kayvan | "crown of her husband" | Robin Gregory (2/28/92)
[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: cygwin gcc 3.0.4 problem
2002-03-10 12:58 ` Oscar Fuentes
@ 2002-03-10 13:03 ` Oscar Fuentes
0 siblings, 0 replies; 5+ messages in thread
From: Oscar Fuentes @ 2002-03-10 13:03 UTC (permalink / raw)
To: Oscar Fuentes; +Cc: Pete Barrie, gcc-help
Oscar Fuentes <ofv@wanadoo.es> writes:
> Pete Barrie <peter@cis.strath.ac.uk> writes:
>
> > Win2000 Cygwin 1.3.10-1 binutils 2.11.2
> >
> > Hi. I've just built 3.0.4 native on Cygwin. Build seemed to
> > go fine and I can compile/run C prog hello.c
> >
> > However C++ hello.cpp fails as shown below. Is this something
> > trivial I am missing?
> >
> > Thanks for any help
> >
> > Pete
> >
> > $ cat hello.cpp
> > #include <iostream.h>
> >
> > int main ()
> > {
> > cout << "Hello World!";
> > return 0;
> > }
> >
> >
> >
> > $ gcc -v hello.cpp
>
> Does it fail with
>
> $ g++ hello.cpp
>
> ???
>
> g++ automatically links the libraries needed by the C++ library. GCC
> not.
>
> BTW,
>
> #include <iostream.h>
This has
using namespace std;
> is not standard C++. Use
>
> #include <iostream>
while this not. So if you use the second form you need to write
std::cout << "Hello World!";
HTH
--
Oscar
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: cygwin gcc 3.0.4 problem
2002-03-10 13:02 ` Kayvan A. Sylvan
@ 2002-03-10 14:08 ` Pete Barrie
0 siblings, 0 replies; 5+ messages in thread
From: Pete Barrie @ 2002-03-10 14:08 UTC (permalink / raw)
To: Kayvan A. Sylvan; +Cc: gcc-help
At 13:02 10/03/2002 -0800, Kayvan A. Sylvan wrote:
>On Sun, Mar 10, 2002 at 08:28:48PM +0000, Pete Barrie wrote:
> >
> > Win2000 Cygwin 1.3.10-1 binutils 2.11.2
> >
> > Hi. I've just built 3.0.4 native on Cygwin. Build seemed to
> > go fine and I can compile/run C prog hello.c
> >
> > However C++ hello.cpp fails as shown below. Is this something
> > trivial I am missing?
> >
> > Thanks for any help
> >
> > Pete
> >
> > $ cat hello.cpp
> > #include <iostream.h>
> >
> > int main ()
> > {
> > cout << "Hello World!";
> > return 0;
> > }
>
>Your problem is probably due to needing to give your gcc3 (in /usr/local/bin)
>the path to the right libstdc++
>
>Try:
>
>/usr/local/bin/g++ -o foo foo.cpp -L/usr/local/lib
>
>In my case, this works for me:
>
>/usr/local/gcc3/bin/g++ -o foo foo.cpp -L /usr/local/gcc3/lib
Yes, this works.
>Also, interestingly, the latest CVS version of gcc-3 produces the following
>message:
>
>/usr/local/gcc3-cvs/bin/g++ -o foo3 foo.cc -L /usr/local/gcc3-cvs/lib
>
>In file included from
>/usr/local/gcc3-cvs/include/g++-v3/backward/iostream.h:31,
> from foo.cc:1:
>/usr/local/gcc3-cvs/include/g++-v3/backward/backward_warning.h:32:2:
>warning: #warning This file includes at least one deprecated or antiquated
>header. Please consider using one of the 32 headers found in section
>17.4.1.2 of the C++ standard. Examples include substituting the <X> header
>for the <X.h> header for C++ includes, or <sstream> instead of the
>deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.
>
>This is fixed by changing foo.cpp to the modern C++ style:
>
>#include <iostream>
>
>using std:: cout; using std::endl;
>
>int main ()
>{
> cout << "Hello World!" << endl;
> return 0;
>}
Point taken. Thanks very much for your help.
Pete
> ---Kayvan
>--
>Kayvan A. Sylvan | Proud husband of | Father to my kids:
>Sylvan Associates, Inc. | Laura Isabella Sylvan | Katherine Yelena (8/8/89)
>http://sylvan.com/~kayvan | "crown of her husband" | Robin Gregory (2/28/92)
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-03-10 22:08 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-10 12:29 cygwin gcc 3.0.4 problem Pete Barrie
2002-03-10 12:58 ` Oscar Fuentes
2002-03-10 13:03 ` Oscar Fuentes
2002-03-10 13:02 ` Kayvan A. Sylvan
2002-03-10 14:08 ` Pete Barrie
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).