Karl Mauer wrote: > > Hi NG, > > I'm making my first steps with mozilla programming. My program should only > call a function, but I got parse errors. Please, help me. > > My program: > > #include <iostream> > #include <certdb.h> > #include <cdbhdl.h> > #include <cert.h> > #include <certt.h>
Here's a bunch of advice about including NSS header files. These #includes should use quotes, e.g. #include "cert.h". On some platforms, the form you used will fail to find the NSS headers. cdbhdl.h is a private header. Your source should not need to include private headers. Content of private header files is not needed to use the functions in the public NSS API. Content of private headers may change without notice from time to time, and is not considered part of the binary interface; that is, binary compatiblity is not assured from release to release for products that use private header contents. Be sure you're only using public functions. certdb.h declares numerous non-public functions. Unfortunately, It's not always easy to tell in the header files which functions are public and which are private. But look in the file nss/lib/nss/nss.def. It contains the official list of public functions. Only the functions listed there are accessible from outside of the NSS shared library. If you attempt to call functions that are not listed there, your program will fail to link properly. If a function you want is not public, it is likely that there is another public function that does what you want. You simply need to find it and use it instead. The compile errors you encountered are because certdb.h doesn't #include the other header files whose types it requires. That's a bug, but it's easy to work around. Just include cert.h before certdb.h. Also, cert.h includes certt.h, so you don't need to include certt.h separately. -- Nelson Bolyard Disclaimer: I speak for myself, not for Netscape
