There's not much you can do without a header file, but you probably already have one (or more). For example, the source for your .a library probably contains .h files that the library uses itself. If you check them, you will probably see something like:
class xClass {
public:
xClass(); ~xclass(); bool operator<(const xClass& other) const;
};
So this would be the header for
xClass
objects.
To include the header in a compile you would do something like
g++ myprog.cc myhelper.cc -I /path_to/library_souce -L /path_to/library_archive -lx -o myprog
The
-I
flag tells the compiler to add "/path_to/library_source" the the search path when looking for the headers, the
-L
flag tells the compiler (actually the
linker, but compiler works for the sake of this discussion) where to look for additional libraries and the
-lx
flag tells the compiler (again linker, really) what additional libraries to search to resolve object (i.e. compiled class and function definitions) references.
If this is your own library you've written, and you have not separated out the class or function
declarations into separate header files, now is a good time to refactor. It's might also a good time to review how C++ namespaces work.