This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

libstdc++ include inconsistencies


Hi guys,

I am having problems with three functions in streambuf.

These are the errors I get when I try to link once of the ACE services:
g++ -Wall -pipe -D_POSIX_THREADS -D_POSIX_THREAD_SAFE_FUNCTIONS -D_REENTRANT -O3 -g
-fno-implicit-templates   -fno-exceptions  -I. -I/usr/local/src/ACE_wrappers-4.6  -o direct_logging
.obj/direct_logging.o -L/usr/local/src/ACE_wrappers-4.6/ace -L./  -lACE -ldl -lpthread 
/usr/local/src/ACE_wrappers-4.6/ace/libACE.so: undefined reference to `streambuf::seekpos(long,
int)'
/usr/local/src/ACE_wrappers-4.6/ace/libACE.so: undefined reference to `streambuf::seekoff(long,
ios::seek_dir, int)'
/usr/local/src/ACE_wrappers-4.6/ace/libACE.so: undefined reference to `streambuf::sys_seek(long,
ios::seek_dir)'
collect2: ld returned 1 exit status

When I check libstdc++ (This is the same for egcs-1.1.1 and egcs-1.1.2),
I find a reference to:
0002f5d8 T pubseekpos__9streambufxi

but when I look at the object created, the undefined reference is:
         U seekpos__9streambufli

Notice the type difference in the first parameter.

So, looking at the header file for ``/usr/include/g++.streambuf.h'' I
find:
    virtual streampos seekpos(streampos pos, int mode = ios::in|ios::out);

... and the definition of streampos is:
#if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
typedef _IO_off64_t streamoff;
typedef _IO_fpos64_t streampos;
#else
typedef _IO_off_t streamoff;
typedef _IO_fpos_t streampos;
#endif

in the same file.

Does anyone know what causes these macros to be set, or why libstdc++ was
compiled differently to a standard application (since the default is that
the above macros are _not_ defined - on my machine).

By the way this is a i586-pc-linux-gnu with glibc-2.1.

Adam.

-- 
Hofstadter's Law:
        It always takes longer than you expect, even when you take
Hofstadter's Law into account.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]