The library file needs to have that information since the header file you distribute for clients to use that class would also have the private variables and functions.
I would guess the libraries you've seen that do not include that information are using the pimpl-idiom (aka Opaque Pointer) to hide the underlying implementation details for their exported classes.
See: Effective C++ (3rd ed) Item 29
See Also:
GoTW #28 The Fast Pimpl Idiom[
^]
-PaulH