delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/08/17/08:30:28

From: tkwire AT my-deja DOT com
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Bitset declaration problems
Date: Thu, 17 Aug 2000 12:14:13 GMT
Organization: Deja.com - Before you buy.
Lines: 47
Message-ID: <8ngku6$ivf$1@nnrp1.deja.com>
References: <8ng1j7$te5$1 AT nnrp1 DOT deja DOT com>
NNTP-Posting-Host: 212.27.50.16
X-Article-Creation-Date: Thu Aug 17 12:14:13 2000 GMT
X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)
X-Http-Proxy: 1.1 x67.deja.com:80 (Squid/1.1.22) for client 212.27.50.16
X-MyDeja-Info: XMYDJUIDtkwire
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Through help from someone else and reading the mail archives I was able
to get the first problem to work by adding <climits>, but that change
hasn't cleared up the other difficulties with the bitset class like I
thought they would.These are two examples of the problems I'm having.
Any suggestions are appreciated.

When I try to invoke count, the program won't create an exe.

bitset<32>bitvec(0xffff); //turn on first 16 bits
int is_set = bitvec.count();

cout <<  is_set;


The program gives me the message:
Error: test14.o In function '_Base_bitset<1, unsigned long>::_M_do_count
(void) const':
test14.cpp(405) Error: undefined reference
to '_Bit_count<true>::_S_bit_count'
collect2: ld returned 1 exit status


Secondly,

When I try to run through the bitvec with a for loop, it gives me
the following errors.

  for (int index=0;index<=32;index++)
     cout << bitvec[index] << endl;


c:/djgpp/lang/cxx/bitset(752) Error: instantiated from 'bitset<32,long
unsigned int>::operator [] (long unsigned int)'
test14.cpp(18)Error: instantiated from here
c:/djgpp/lang/cxx/bitset(378) Error: 'long unsigned int &
_Base_bitset<1,long unsigned int>::_M_getword(long unsigned int)' is
inaccessible
c:/djgpp/lang/cxx/bitset(582) Error: within this context


I thought these errors might be connected.




Sent via Deja.com http://www.deja.com/
Before you buy.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019