- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- gcc: cout problem!
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2002 07:10 PM
08-29-2002 07:10 PM
#cd /tmp
#vi hello.C
=====This is source file=====
#include
using namespace std;
main()
{
cout >> "This is a test.";
}
=====end=====================
#/usr/local/bin/gcc ./hello.C
Now I get an error message:
hello.C: In function `int main()`:
hello.C: 7: no match for `std::ostream& >> std::string&` operator
Would anyone tell me why and how to correct them?
Thank in advance!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2002 07:32 PM
08-29-2002 07:32 PM
Re: gcc: cout problem!
"cout <<" and not "cout >>"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2002 11:40 PM
08-29-2002 11:40 PM
Solutionl1:/tmp 107 > cat xx.C
#include
using namespace std;
main ()
{
cout >> "This is a test.";
}
l1:/tmp 108 > gcc -o xx xx.C
xx.C: In function `int main()':
xx.C:5: no match for `std::ostream& >> const char[16]' operator
Exit 1
l1:/tmp 109 > g++ -o xx xx.C
xx.C: In function `int main()':
xx.C:5: no match for `std::ostream& >> const char[16]' operator
Exit 1
l1:/tmp 110 > perl -pi -e's/>>/<l1:/tmp 111 > gcc -o xx xx.C
/usr/ccs/bin/ld: Unsatisfied symbols:
std::ios_base::Init::~Init [in-charge]()(first referenced in /tmp/ccQ5mf0t.o) (code)
std::ios_base::Init::Init[in-charge]()(first referenced in /tmp/ccQ5mf0t.o) (code)
std::basic_ostream
std::cout (first referenced in /tmp/ccQ5mf0t.o) (data)
collect2: ld returned 1 exit status
Exit 1
l1:/tmp 112 > g++ -o xx xx.C
l1:/tmp 113 >
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2002 11:55 PM
08-29-2002 11:55 PM
Re: gcc: cout problem!
#/usr/local/bin/g++ -o hello hello.C
OK!
But when I type:
#./hello
I get some errors just like this:
================
/usr/lib/dld.sl: Unresolved symbol: pthread_once (code) from /usr/local/lib/gcc
-lib/hppa2.0n-hp-hpux11.00/3.2/../../../libgcc_s.sl
Abort(coredump)
================
Why?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2002 12:02 AM
08-30-2002 12:02 AM
Re: gcc: cout problem!
This is a test.l1:/tmp 127 >
Hmmm, beats me.
FWIW, I never use g++
Where did you get it from?
My port is available on https://www.beepz.com/personal/merijn
If you go for that one (including binutils-2.13 and gdb-5.2.1) please *do* read the instructions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-01-2002 09:05 PM
09-01-2002 09:05 PM
Re: gcc: cout problem!
Regards, M.