"basic_filebuf" link errors with GCC 3.0
[Please CC me, I'm not subscribed to this list.]
Hello,
I'm in the process of converting one of my programs to compile under
GCC 3.0, but I'm experiencing link problems. Since the GCC in testing
is still marked as prerelease (g++-3.0 3.0-0pre010403), I'll ask here
first. :)
A minimal example for my problem is:
#include <iostream>
#include <fstream>
using namespace std;
typedef basic_ifstream<unsigned char> bifstream;
int main() {
bifstream("/dev/zero", ios::binary);
}
When I try to compile this, I get:
> g++-3.0 -Wall x.cc -o x
/tmp/ccd78h35.o: In function `std::basic_ifstream<unsigned char, std::char_traits<unsigned char> >::basic_ifstream(char const*, std::_Ios_Openmode)':
/tmp/ccd78h35.o(.gnu.linkonce.t._ZNSt14basic_ifstreamIhSt11char_traitsIhEEC1EPKcSt13_Ios_Openmode+0x39): undefined reference to `std::basic_filebuf<unsigned char, std::char_traits<unsigned char> >::basic_filebuf()'
/tmp/ccd78h35.o: In function `std::basic_ifstream<unsigned char, std::char_traits<unsigned char> >::open(char const*, std::_Ios_Openmode)':
/tmp/ccd78h35.o(.gnu.linkonce.t._ZNSt14basic_ifstreamIhSt11char_traitsIhEE4openEPKcSt13_Ios_Openmode+0x2a): undefined reference to `std::basic_filebuf<unsigned char, std::char_traits<unsigned char> >::open(char const*, std::_Ios_Openmode)'
collect2: ld returned 1 exit status
What's the problem?
Aside: The typedef above doesn't work with GCC 2.95, so currently my
setup is to do a "typedef ifstream bifstream;" for GCC 2.95, which
works.
Cheers,
Richard
--
__ _
|_) /| Richard Atterer
| \/¯| http://atterer.net
¯ ´` ¯
Reply to: