Am Mittwoch, 11. November 2015 00:30:26 UTC+1 schrieb John Dennis: > On 11/10/2015 04:38 PM, Opa114 wrote: > > Hi, > > > > can someone explain me how i use NSS and NSPR in my C++ Project? I'm > > new to C++ and want use in project the NSS libraries, so i thought i > > could include the header files i need, but did not work, so what's > > the right way? > > 2 things: > > When you ask a question and want others to help you it's best to give > details, a statement like "did not work" doesn't tell the reader > anything, only you know how it didn't work (but in this case I can > probably guess) > > You need to declare the headers are C language via extern "C". This is a > very common C++ issue and discussed widely. Some headers will add the > extern "C" declaration as a friendly service, I just checked the NSS > headers and unfortunately only 2 of the headers actually do this so > you'll have to provide the declaration yourself. > > extern "C" { > #include "nss.h" > } > > should do the trick, google mixing C and C++, you should find a ton of > information. > > > > > Must i compile NSS and NSPR first and the use the DLL / Libs? Would > > be very helpful if someone could explain it in detail. > > > > Thanks a lot! > > > > > -- > John
Hi, sorry for the very late answer, but i had no time for it since today :/ So thanks for reply. I want to write a C++ Application which uses NSS. More i can not say sorry. So my first thought was to compile the NSS and NSPR to get the compiled and build dynamic libraries which i can include into my C++ Project ans use there. Then i looked at some Mozilla Code at Modzilla DXR and the little piece of exampe Code from the Mozilla NSS Website. And there they include the source headers and files directly into the code. So what is the best and easiest way to use NSS in my Project? Using compiled dynamic libraries or the header files i have to include and the compile the whole thing? Can i use the dynamic libraries with the full functionality like i include the header files directly? Van you explain a little bit more the thing with: extern "C" { #include "nss.h" } This i have to put in my cpp file on whch i include the "nss.h" right? So have i todo this in the other NSS Header files, too? Let's say for example in the "secutil.h" i want to use. In this file some more ehaders are included. Have i to add the extern "C" declaration, too? thanks again and sorry for the late answer :) -- dev-tech-crypto mailing list dev-tech-crypto@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-tech-crypto