text: in microsoft visual c++  , how can i hide private members of a class in a static link library? i wrote a static link library in two files : code.cpp and header.h , header.h includes the interface of a class named class1 , which have private members and public members , and code.cpp includes the implementation of that class , i dont want the programmer who uses the static link library to see the private members decleration of the class (class1) , if i give header.h to the programmer he will know the declaration of the private members , and if i exclude the private members of his copy of header.h , it class (class1) will not work. one way to do it is to make class1 call some other class for all actual implementation. so you make a new class, class1impl, which does all the real work. class1 has a pointer to class1impl, and all of the member functions of class1 call the appropriate member function of class1impl. you don't need to give out the header for class1impl as it can just be predeclared at the top of the class1 declaration.  ex: //class1.h class class1impl;  class class1 { private: class1impl* m_pimpl;  public:   class1();   void dostuff(); };  //class1.cpp #include "class1.h" #include "class1impl.h"  class1::class1() {   m_pimpl = new class1impl; }  void class1::dostuff() {   m_pimpl->dostuff(); }  //class1impl.h //hidden, never give this source out class class1impl { private:   long m_lhiddenval; public:   void dostuff() { printf("woo! %d", m_lhiddenval); } };