Sponsored Content
Top Forums Programming Incompatiblity of the code due to CC compiler version mismatch. Post 302770364 by DGPickett on Friday 15th of February 2013 11:10:09 AM
Old 02-15-2013
Well, begin at the beginning. cerr is really std::cerr cerr - C++ Reference

Someone has to say use std somewhere. C++ Basic Input/Output
Code:
The standard error stream (cerr):
 
The predefined object cerr is an instance of ostream class. The cerr object is said to be attached to the standard error device, 
which is also a display screen but the object cerr is un-buffered and each stream insertion to cerr causes its output to appear immediately.
 
The cerr is also used in conjunction with the stream insertion operator as shown in the following example.
 
#include <iostream> 
using namespace std; 
int main( ){
    char str[] = "Unable to read....";
    cerr << "Error message : " << str << endl;
}
 
When the above code is compiled and executed, it produces following result:
 
Error message : Unable to read....


My cerr declaration lookup:
Code:
CScope WWW 201211
 
Find this C symbol: 'cerr'
  /opt/aCC/include/iostream/iostream.h  <global>            626  extern ostream_withassign cerr ;
  /opt/aCC/include/iostream/iostream.h  <global>            780  #define cerr ((ostream_withassign&)__tcerr)

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

gcc compiler version?

How do you determine which version of the GNU gcc compiler is on your system? (1 Reply)
Discussion started by: Ben070371
1 Replies

2. Solaris

X Keyboard Extension version mismatch

I want to use calls from the X Keyboard Extension, but get "library version mismatch" error. First one is XkbLibraryVersion(..). This one already returns false. Then I call XkbOpenDisplay(...) which does not return a valid display; return value is XkbOD_NonXkbServer. If I open the display with... (0 Replies)
Discussion started by: hiker04
0 Replies

3. UNIX for Dummies Questions & Answers

What version is the compiler?

Hi ! we have a intel fortran compiler on our computer. How do i find out what version it is ? Thank you, dsmv. (1 Reply)
Discussion started by: dsmv
1 Replies

4. AIX

how to find out the compiler version and OS from binary file

Command to get the Compiler version(xlc/gcc) from the binary on AIX platform. I m searching for the Command, to get the Compiler(xlc/gcc) used to build the binary on AIX. I got two commands used on Linux Platform: - readelf -a <lib> | grep comment - hexdump -C -s 0x49e7b -n 1812 <lib> ... (1 Reply)
Discussion started by: Prajakta
1 Replies

5. AIX

install two different compiler version

Hi all. I have a simple question. There's a way to install under AIX system (5.3) two different compiler version, i.e. ibm xlf fortran 11 and 12? Seems that smitty doesn't allows user to change the default installation path; it only allows you to save the replaced files of the superseded... (1 Reply)
Discussion started by: poldo000
1 Replies

6. Solaris

java version mismatch for normal user and root user

:confused: I installed latest version of java ( jre 1.6) on Solaris Machine ......when I run java -version as root, shows the latest version but when I run java -version as normal user, shows the old / previous version What should I do to fix this ...should show the latest version... (3 Replies)
Discussion started by: frintocf
3 Replies

7. Programming

Choose compiler version

Hi, I'm new, here, and I'm searching for a simple solution for a simple problem. I'm working on RedHat 4.4.6-4 through a CentOS Virtual Machine and due to some reasons I must compile my C++ codes with these two different g++ versions: 4.4.6 and 4.2.2. The fact is that I should be able to... (4 Replies)
Discussion started by: Marcuss
4 Replies

8. AIX

Checking xlc compiler version

Hi, Below is output of lslpp command. bash-3.00# lslpp -L | grep xlC xlC.aix50.rte 11.1.0.1 C F XL C/C++ Runtime for AIX 5.3 xlC.cpp 9.0.0.0 C F C for AIX Preprocessor xlC.msg.en_US.cpp 9.0.0.0 C F C for AIX... (2 Replies)
Discussion started by: manoj.solaris
2 Replies

9. Linux

Linking issue due to so version number

Hi all, currently I'm facing a issue in linking a .so file. In my build machine, I've libcrypto.so.6 and there is a softlink as libcrypto.so. In my make file I'm trying to link to the lib using -L -lcrypto and it is success and created my test.exe. When I copy this test.exe to other... (4 Replies)
Discussion started by: vijkrr
4 Replies

10. Shell Programming and Scripting

Need fix for rsync Error due to version mismatch

rsync --delay-updates -F --compress --archive --rsh='/usr/bin/ssh -t -a -x' /web/admin/Transfer/data/ user1@destserver1:/tmp/testf rsync version on sender server is:3.0.9 rsync version on sender server is:3.0.6 Linux sourceserver1 3.10.0-693.17.1.el7.x86_64 #1 SMP Sun Jan 14 10:36:03 EST... (1 Reply)
Discussion started by: mohtashims
1 Replies
FBB::ServerSocket(3bobcat)					   Server Socket					FBB::ServerSocket(3bobcat)

NAME
FBB::ServerSocket - Server socket accepting Internet connection requests SYNOPSIS
#include <bobcat/serversocket> Linking option: -lbobcat DESCRIPTION
An FBB::ServerSocket may be constructed to listen for connection requests from the Internet or from the local host. Connection requests may be accepted in either blocking or non-blocking modes. When a connection is accepted a socket is returned which may be used to read informa- tion from or write information to the client that requested the connection. The socket that is made available is a file descriptor which may be used to initialize a std::istream and/or std::ostream. The std::istream is used to read information from the client process; the std::ostream is used to send information to the client process. Since a socket may be considered a file descriptor the avaiable FBB::IFd- Stream, FBB::IFdStreamBuf, FBB::OFdStream, and FBB::OFdStreamBuf classes may be used profitably here. Note that having available a socket does not mean that this defines the communication protocol. It is (still) the responsibility of the programmer to comply with an existing protocol or to implement a tailor-made protocol. The latter situation implies that the sequence of input- and output operations is defined by the programmer. NAMESPACE
FBB All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB. INHERITS FROM
FBB::SocketBase CONSTRUCTOR
o ServerSocket(size_t port): This constructor initializes an FBB::ServerSocket object, which will listen for connections at the specified port. The construction of the socket does not mean that the FBB::ServerSocket object is actually listening for connections. To start listening, the member listen() should be used. The copy constructor is not available. MEMBER FUNCTIONS
All members of FBB::SocketBase (and thus of FBB::InetAddress) are available, as FBB::ServerSocket inherits from FBB::SocketBase. o void listen(size_t backlog = 5, bool blocking = true): The listen() member defines the way the FBB::ServerSocket will listen for clients requesting a connection. It can be used only once with a FBB::ServerSocket. An FBB::Errno object is thrown if listening fails, if the constructor could not create a socket, or if the SocketBase base class could not properly be constructed. The listen() member's backlog parameter defines the size of the FBB::ServerSocket's internal queue in which connection requests may be stored waiting for their turn to be serviced. When backlog requests are waiting and another request arrives, then that request is lost. The member's second parameter, blocking, is used to control the blocking mode. By default, blocking is used, and listen() will wait until a connection is established. This is ok in situations where clients connect infrquently and for relatively short time inter- vals. Otherwise, in more complex programs, an FBB::Selector object can be used to sense input on the server socket and/or on various client sockets. o SocketBase accept(): The accept() member returns an FBB::SocketBase object containing information about the client whose connection request was accepted. The FBB::SocketBase object's socket value may be used to initialize streams that can be used to communicate with the client. In more complex programs the FBB::SocketBase could be passed to a class derived from FBB::Fork, handling the communication with the child as a separate (child) process. EXAMPLE
See also the clientsocket(3bobcat) example. #include <iostream> #include <bobcat/serversocket> #include <bobcat/ifdstream> #include <bobcat/ofdstream> #include <bobcat/a2x> using namespace std; using namespace FBB; int main(int argc, char **argv) try { if (argc == 1) { cerr << "Provide server port number "; return 1; } size_t portnr = A2x(argv[1]); ServerSocket server(portnr); cerr << "server listens on port " << argv[1] << endl; cerr << "serversocket returns: " << "address = " << server.dottedDecimalAddress() << " " "port = " << server.port() << endl; int fd = server.socket(); // open the socket's descriptor cout << "File descriptor of the socket is " << fd << " " "The server terminates when it receives a " "single `q' on a line " "A connection is terminated when no input " "is received anymore. " "Then another connection is possible" << endl; server.listen(); // listen in blocking mode while (true) { SocketBase fdb = server.accept(); int fd = fdb.socket(); cerr << "Client FD = " << fd << ", " << endl << "address = " << fdb.dottedDecimalAddress() << ", " << endl << "communication through port " << fdb.port() << endl; IFdStream in(fd); // stream to read from client OFdStream out(fd); // stream to write to client string cmd; while (getline(in, cmd)) { cout << "Got: " << cmd << endl; out << "Got: " << cmd << " " << endl; if (cmd[0] == 'q') return 0; } cout << "Ready for another connection "; } } catch (Errno const &err) { cerr << err.what() << endl << "Server socket on port " << argv[1] << " can't be opened" << endl; return -1; } FILES
bobcat/serversocket - defines the class interface SEE ALSO
bobcat(7), clientsocket(3bobcat), fork(3bobcat), ifdstream(3bobcat), ifdstreambuf(3bobcat), inetaddress(3bobcat), localserversocket(3bob- cat), ofdstream(3bobcat), ofdstream(3bobcat), select(2), selector(3bobcat), socketbase(3bobcat) BUGS
None Reported. DISTRIBUTION FILES
o bobcat_3.01.00-x.dsc: detached signature; o bobcat_3.01.00-x.tar.gz: source archive; o bobcat_3.01.00-x_i386.changes: change log; o libbobcat1_3.01.00-x_*.deb: debian package holding the libraries; o libbobcat1-dev_3.01.00-x_*.deb: debian package holding the libraries, headers and manual pages; o http://sourceforge.net/projects/bobcat: public archive location; BOBCAT
Bobcat is an acronym of `Brokken's Own Base Classes And Templates'. COPYRIGHT
This is free software, distributed under the terms of the GNU General Public License (GPL). AUTHOR
Frank B. Brokken (f.b.brokken@rug.nl). libbobcat1-dev_3.01.00-x.tar.gz 2005-2012 FBB::ServerSocket(3bobcat)
All times are GMT -4. The time now is 06:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy