* failed complie for the 1st C++ program
@ 2003-02-05 6:47 etc waju
2003-02-05 13:16 ` John Love-Jensen
0 siblings, 1 reply; 3+ messages in thread
From: etc waju @ 2003-02-05 6:47 UTC (permalink / raw)
To: gcc-help
Hi
I am new to GCC, and I installed it on a Sun Workstation which was successful.
But when I tried to compile my very first C++ program, I got some not-understood errors.
Any help is much appreciated.
My program is really simple:
#include <iostream>
using namespace std;
int main()
{ cout << "Good morning.";
return 0;
}
while I got quite some errors:
Undefined first referenced
symbol in file
std::ios_base::Init::~Init [in-charge]()/var/tmp//ccK4GUO5.o
std::ios_base::Init::Init[in-charge]()/var/tmp//ccK4GUO5.o
std::cout /var/tmp//ccK4GUO5.o
std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char>
>(std::basic_ostream<char, std::char_traits<char> >&, char const*)/var/tmp//ccK4GUO5.o
__gxx_personality_v0 /var/tmp//ccK4GUO5.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: failed complie for the 1st C++ program
2003-02-05 6:47 failed complie for the 1st C++ program etc waju
@ 2003-02-05 13:16 ` John Love-Jensen
0 siblings, 0 replies; 3+ messages in thread
From: John Love-Jensen @ 2003-02-05 13:16 UTC (permalink / raw)
To: etc waju, gcc-help
Hi Etc Waju,
Did your compile line look something like this...
g++ -o myapp foo.cpp
...then something is awry, because that should work. Unless your libraries
are not located where the compiler thinks they're located.
If it looked like this...
gcc -o myapp foo.cpp
...then that should fail, because you are using "gcc" instead of "g++".
--Eljay
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: failed complie for the 1st C++ program
@ 2003-02-05 7:44 Ajay Bansal
0 siblings, 0 replies; 3+ messages in thread
From: Ajay Bansal @ 2003-02-05 7:44 UTC (permalink / raw)
To: etc waju, gcc-help
Try compiling with g++.
-----Original Message-----
From: etc waju [mailto:etcwaju@yahoo.com]
Sent: Wednesday, February 05, 2003 12:17 PM
To: gcc-help@gcc.gnu.org
Subject: failed complie for the 1st C++ program
Hi
I am new to GCC, and I installed it on a Sun Workstation which was
successful. But when I tried to compile my very first C++ program, I got
some not-understood errors.
Any help is much appreciated.
My program is really simple:
#include <iostream>
using namespace std;
int main()
{ cout << "Good morning.";
return 0;
}
while I got quite some errors:
Undefined first referenced
symbol in file
std::ios_base::Init::~Init [in-charge]()/var/tmp//ccK4GUO5.o
std::ios_base::Init::Init[in-charge]()/var/tmp//ccK4GUO5.o
std::cout /var/tmp//ccK4GUO5.o
std::basic_ostream<char, std::char_traits<char> >& std::operator<<
<std::char_traits<char>
>(std::basic_ostream<char, std::char_traits<char> >&, char
>const*)/var/tmp//ccK4GUO5.o
__gxx_personality_v0 /var/tmp//ccK4GUO5.o
ld: fatal: Symbol referencing errors. No output written to a.out
collect2: ld returned 1 exit status
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-02-05 13:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-05 6:47 failed complie for the 1st C++ program etc waju
2003-02-05 13:16 ` John Love-Jensen
2003-02-05 7:44 Ajay Bansal
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).