Sponsored Content
Special Forums Windows & DOS: Issues & Discussions Problem compiling C++ Code in Cygwin Post 302401687 by pludi on Sunday 7th of March 2010 01:15:00 PM
Old 03-07-2010
Well, here (Cygwin on Win XP SP3) there's no problem. But you've got a glaring error in your code anyways, which probably is the source of your problems:
Code:
#include <iostream>
using namespace std;

int main () {

cout << 'Hello World!';
return 0;

}

On the red marked line you're trying to pass of a string as a character. Replace the single quotes with double quotes.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

cygwin problem

Hi, I have install cygwin in my PC which is having Windows-XP. I am able to run c programm successfully using gcc compiler but when i am running c++ program it is giving the following error: $ gcc abc.cpp /cygdrive/c/DOCUME~1/ADMINI~1/LOCALS~1/Temp/cclwkyqD.o:abc.cpp:(.text+0xd): unde... (0 Replies)
Discussion started by: gauri_agr
0 Replies

2. Solaris

Compiling problem

I'm trying to install the jed text editor on a SunOS 5.10 box. It depends on the s-lang library, which I installed to ~/lib. I'm trying to install jed to ~/jed (it's a box @ my university, so I don't have rights to install globally), but when I run make I get this error: It looks like it... (1 Reply)
Discussion started by: iandunn
1 Replies

3. Solaris

Problem's compiling Glib

Hello, I am trying to install glib on my development box - with little/no luck. Below are some details of the box: SunOS 5.8 Generic_117350-38 sun4u sparc SUNW,Ultra-Enterprise gcc version 2.95.2 19991024 (release) GNU Make version 3.78.1, by Richard Stallman and Roland McGrath. Glib version:... (2 Replies)
Discussion started by: tetley
2 Replies

4. UNIX for Dummies Questions & Answers

problem with cygwin

hi... i'm working on windows xp currently but i have to work on linux. the problem is there is no internet in linux OS so i decided to use cygwin which (i was told) can be used for unix based commands to an extent in windows.i have to write c-programs and i'm using emacs as editor and g++... (0 Replies)
Discussion started by: raya_g
0 Replies

5. UNIX for Dummies Questions & Answers

Cygwin installation problem

hihi, im new here. just start to use cygwin as unix-based in Windows XP. my installation of cygwin is not success, it has procedure entry_impure_ptr problem due with ash.exe, install_info.exe, and In-exe files. do anyone know why is that so? (3 Replies)
Discussion started by: Suraine
3 Replies

6. HP-UX

Problem in HP-UX compiling

Hi When im trying to do make --version and make --help in HP-UX it throws error Make: Unknown flag argument -. Stop. a soft link is present in this directory /usr/bin/make and hard link is in /usr/ccs/bin/make what could be the reason can any1 ..please tell me how to solve this... (1 Reply)
Discussion started by: vasanthan
1 Replies

7. UNIX for Advanced & Expert Users

Problem in cygwin

Hi All, I am using cygwin 2.697. When i was working with LAN its working fine. But when i am trying to working via ( Aventail Smart Tunnel), It close after 20 mins. But Exceed-10 is working fine, but it take more resource and its not freeware. so kindly help me in this regards. I have a... (1 Reply)
Discussion started by: rajamohan
1 Replies

8. UNIX for Advanced & Expert Users

Cygwin permission problem

I can't figure out why cygwin won't let me write a file to this directory. Any ideas? $ id uid=1007(jdbaldwin) gid=513(None) groups=513(None),0(root),544(Administrators),545(Users) $ ls -lad . drwxrwxrwx+ 1 jdbaldwin None 0 2010-09-29 12:47 . $ touch x touch: cannot touch `x': Permission... (3 Replies)
Discussion started by: jdbaldwin
3 Replies

9. Programming

Library problem - not compiling in c

Ok I was trying to test if I installed correctly gsl, I followed the INSTALL file and still I don't know what is wrong. Here is a sample code to test gel,I got it from Random Number Generator Examples - GNU Scientific Library -- Reference Manual (note: made a few changes in the code) #include... (2 Replies)
Discussion started by: joseamck
2 Replies

10. Answers to Frequently Asked Questions

Error when compiling using cygwin

I tried to compile the files in basic_dump_ex using cygwin : /cygdrive/c/WpdPack/Examples-pcap/basic_dump_ex $make but I got this : cc -g -O -mno-cygwin -I ../../include -c -o basic_dump_ex.o basic_dump_ex.c cc: error: unrecognized command line option ‘-mno-cygwin’... (6 Replies)
Discussion started by: steve120
6 Replies
FBB::MultiStreambuf(3bobcat)				     Writing multiple streams				      FBB::MultiStreambuf(3bobcat)

NAME
FBB::MultiStreambuf - Selectively writes multiple streams SYNOPSIS
#include <bobcat/multistreambuf> Linking option: -lbobcat DESCRIPTION
The FBB::MultiStreambuf class is a specialization of std::streambuf. It can be used to write selectvely to multiple std::ostreams. Each std::ostream that is associated with an FBB::MultiStreambuf is given a mode-tag indicating whether the stream should always be used when information is inserted into the FBB::MultiStreambuf, just once, or not at all. Each of the stream's mode-tags may be set to any of the defined tag-values. When the address of a FBB::MultiStreambuf is used to initialize a std::ostream the constructed std::ostream becomes an output-multiplexer: by inserting information into the std::ostream object, all std::ostream objects added to its FBB::MultiStreambuf buffer which have an active mode will receive that information. An FBB::MultiStreambuf object should be outlived by all active streams that are associated with it. No assumptions should be made about the order in which the std::ostream objects that are associated with the FBB::MultiStreambuf objects are visited when information is inserted. NAMESPACE
FBB All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB. INHERITS FROM
std::streambuf ENUMERATION
In the Mode enumeration the following values are defined: o OFF: A std::ostream having this mode will not be used when information is inserted into an FBB::MultiStreambuf o ON: A std::ostream having this mode will be used when information is inserted into an FBB::MultiStreambuf o ONCE: A std::ostream having this mode will be used once, until the next flushing operation, when information is inserted into an FBB::Mul- tiStreambuf o RESET: A std::ostream having this mode will not be used when information is inserted into an FBB::MultiStreambuf. At a flush operation all ONCE modes will be set to RESET TYPES
The following subtypes are defined in the class FBB:MultiStreambuf: o iterator: This is a synonym of std::vector<stream>::iterator o const_iterator: This is a synonym of std::vector<stream>::const_iterator NESTED CLASS
The class FBB::MultiStreambuf::stream is defined as a nested class of FBB::MultiStreambuf. It offers the following constructor and public members: o stream(std::ostream &os, Mode mode = ON): The constructor stores a std::ostream object, and associates a Mode value with it. o void setMode(Mode mode): This member is used to redefine the stream's Mode value. o void mode() const: This member returns the stream's Mode value. o operator std::ostream &(): This member returns the stream's std::ostream. CONSTRUCTORS
o MultiStreambuf(): The default constructor creates a FBB::MultiStreambuf object which contains no associated std::ostream objects. o MultiStreambuf(std::ostream &os, Mode mode = ON): This constructor creates a FBB::MultiStreambuf object which is immediately associated with the std::ostream specified as its first argument. o MultiStreambuf(std::vector<MultiStreambuf::stream> const &osvector): This constructor creates a FBB::MultiStreambuf object which is immediately associated with all std::ostream objects that are stored in the MultiStreambuf::stream elements of the specified vector. The copy constructor is available. MEMBER FUNCTIONS
All members of std::ostringstream and std::exception are available, as FBB::MultiStreambuf inherits from these classes. o iterator begin(): This member returns an iterator to the first stream element that is stored in a FBB::MultiStreambuf object. o const_iterator begin(): This member returns an iterator to the first (unmodifiable) stream element that is stored in a FBB::MultiStreambuf object. o iterator end(): This member returns an iterator pointing beyond the last stream element that is stored in a FBB::MultiStreambuf object. o iterator end(): This member returns an iterator pointing beyond the last (unmodifiable) stream element that is stored in a FBB::MultiStreambuf object. o void insert(std::ostream &os, Mode mode = ON): This member adds the specified std::ostream using the specified Mode to the current set of stream objects. o void insert(std::vector<stream> const &os): This member adds all stream objects stored in the os vector to the current set of stream objects. o void void setOnce(): This member will reset all the RESET Mode values of the stored stream objects to ONCE. PROTECTED MEMBER FUNCTION
The member listed in this section implements the tasks of the comparably named virtual function in the class's private interface. This sep- arates the redefinable interface from the user-interface. The class MultiStreamBuf can, in accordance with Liskov's Substitution Principle, be used as a std:streambuf; but it also offers a facility for classes deriving from MultiStreamBuf. This facility is listed here. o int pSync(): The contents of the MultiStreamBuf's internal buffer is written to each of the std::ostream objects to which the MultiStreamBuf object has access. EXAMPLE
#include <iostream> #include <fstream> #include <bobcat/multistreambuf> using namespace std; using namespace FBB; int main() { MultiStreambuf msb(cout); ostream os(&msb); ofstream out("out"); msb.insert(out, MultiStreambuf::ONCE); os << "This is on cout and out" << endl; os << "This is on cout only" << endl; msb.setOnce(); os << "This is on cout and out" << endl; os << "This is on cout only" << endl; return 0; } FILES
bobcat/multistreambuf - defines the class interface SEE ALSO
bobcat(7) 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::MultiStreambuf(3bobcat)
All times are GMT -4. The time now is 01:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy