public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* g++ won't compile 'hello world'
@ 2002-08-21  7:25 Gerrit P. Haase
  0 siblings, 0 replies; 3+ messages in thread
From: Gerrit P. Haase @ 2002-08-21  7:25 UTC (permalink / raw)
  To: cygwin

Hallo cygwin,

$ g++ --version
g++ (GCC) 3.1.1 20020718 (prerelease)

$ g++ -c g++_test.C

$ g++ -o g++_test g++_test.o
g++_test.o(.text+0x39):g++_test.C: undefined reference to `std::cout'
g++_test.o(.text+0x46):g++_test.C: 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*)'
g++_test.o(.text+0x6f):g++_test.C: undefined reference to `std::ios_base::Init::Init[in-charge]()'
g++_test.o(.text+0x8a):g++_test.C: undefined reference to `std::ios_base::Init::~Init [in-charge]()'
g++_test.o(.eh_frame+0x11):g++_test.C: undefined reference to `___gxx_personality_v0'
collect2: ld returned 1 exit status
  
g++_test.C:
===========
#include<iostream>
using namespace std;
int
main ()
{
  cout << "what am I doing wrong?";
  return 0;
}


Gerrit
-- 
=^..^=


--
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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: g++ won't compile 'hello world'
  2002-08-21  8:28 Keen Wayne A Contr AFRL/MNGG
@ 2002-08-21  8:34 ` Gerrit P. Haase
  0 siblings, 0 replies; 3+ messages in thread
From: Gerrit P. Haase @ 2002-08-21  8:34 UTC (permalink / raw)
  To: cygwin

Hallo Keen,

Am Mittwoch, 21. August 2002 um 16:35 schriebst du:

> (home built) of gcc and in the link process, its was looking for things like
> libraries in the wrong

[hello world doesn't compile]

Pilot error, sorry.  Had a testversion of libstdc++ lying around
at the wrong place...


Gerrit
-- 
=^..^=

-- 
=^..^=


--
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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: g++ won't compile 'hello world'
@ 2002-08-21  8:28 Keen Wayne A Contr AFRL/MNGG
  2002-08-21  8:34 ` Gerrit P. Haase
  0 siblings, 1 reply; 3+ messages in thread
From: Keen Wayne A Contr AFRL/MNGG @ 2002-08-21  8:28 UTC (permalink / raw)
  To: 'cygwin@cygwin.com'

I have had what may be similar problems in the past, when I was compiling
with a new release
(home built) of gcc and in the link process, its was looking for things like
libraries in the wrong
place.  In that case, I forced it to grab the right stuff by my compile
command, i.e.

ng++ -o hello hello.cpp -L/mygcc/lib

Now, I just checked my current version  of Cygwin, which has for gcc:

gcc -v
Reading specs from /bin/../lib/gcc-lib/i686-pc-cygwin/3.1.1/specs
Configured with: /netrel/src/gcc-3.1.1-4/configure
--enable-languages=c,c++,f77,java --enable-libgcj --enable-threads=posix
--with-system-zlib --enable-nls --without-included-gettext
--enable-interpreter --disable-sjlj-exceptions
--disable-version-specific-runtime-libs --enable-shared
--build=i686-pc-linux --host=i686-pc-cygwin --target=i686-pc-cygwin
--enable-haifa --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc
--libdir=/usr/lib --includedir=/nonexistent/include --libexecdir=/usr/sbin
Thread model: posix
gcc version 3.1.1 20020718 (prerelease)

And it compiled fine.  Have you done anything to override where gcc should
look for its libraries.  Have you perhaps had setup
overwrite some of the 3.1.1 stuff with 2.95 stuff.....I am guessing
here...I'll just shutup now.

Wayne Keen

--
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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-08-21 15:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-21  7:25 g++ won't compile 'hello world' Gerrit P. Haase
2002-08-21  8:28 Keen Wayne A Contr AFRL/MNGG
2002-08-21  8:34 ` Gerrit P. Haase

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).