A
Allen
I use std::bitset in a VxWorks project. The following is demo codes.
#include <bitset>
int main()
{
std::bitset<256> bs;
bs.count();
}
When linking, g++ tells error.
partialImage.o: In function `_Base_bitset<2, unsigned
long>::_M_do_count(void) const':
partialImage.o(.text+0x3e8fa): undefined reference to
`_Bit_count<true>::_S_bit_count'
partialImage.o(.text+0x3e90a): undefined reference to
`_Bit_count<true>::_S_bit_count'
VxWorks gcc version is 2.96. How to correct this error?
Thank you.
Allen
#include <bitset>
int main()
{
std::bitset<256> bs;
bs.count();
}
g++ -o test test.cpp
When linking, g++ tells error.
partialImage.o: In function `_Base_bitset<2, unsigned
long>::_M_do_count(void) const':
partialImage.o(.text+0x3e8fa): undefined reference to
`_Bit_count<true>::_S_bit_count'
partialImage.o(.text+0x3e90a): undefined reference to
`_Bit_count<true>::_S_bit_count'
VxWorks gcc version is 2.96. How to correct this error?
Thank you.
Allen