[GPGME] gpgme data buffer not showing any data

Ricardo Oliveira n3g4s at hotmail.com
Tue Jan 9 15:45:49 CET 2007


P.S.: I used C instead of C++, but the code is basically the same.


>
>Hi,
>
>I have the exact same problem. Worst even: my code worked before and it's
>not working anymore. I believe this is a linking/library problem. Somehow I
>changed my compile options in KDevelop and now this happens. I tried your
>code with the same result. I compiled it like so:
>
>gcc -o gpgme-test gpgme-test.c /usr/lib/libgpgme.so.11
>
>and
>
>gcc -o gpgme-test gpgme-test.c `gpgme-config --libs --cflags`
>
>but the result was the same.
>
>Any ideas?
>
>Regards.
>
> >I'm trying to push some data into a gogme_data_t buffer from an object 
>and
> >I'm not having any luck.  The following code should return 8, but insted
> >I'm getting -1.  Please advise as to what I am missing.
> >
> >
> >-     Garrett
> >
> >#define D_FILE_OFFSET_BITS 64
> >
> >#include <gpgme.h>
> >#include <string>
> >#include <iostream>
> >
> >int main(){
> >        gpgme_error_t err;
> >        std::string msg("Message");
> >
> >        gpgme_data_t In;
> >
> >        err = gpgme_data_new_from_mem(&In, msg.c_str(), msg.length(), 1);
> >
> >        if(err){
> >                std::cout << "An error occured copying data" << 
>std::endl;
> >        }
> >
> >        off_t len;
> >        len = gpgme_data_seek(In, 0, SEEK_END);
> >        std::cout << "Size of data: " << len << std::endl;
> >
> >        return 0;
> >}
>
>_________________________________________________________________
>Express yourself instantly with MSN Messenger! Download today it's FREE!
>http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
>
>
>_______________________________________________
>Gnupg-devel mailing list
>Gnupg-devel at gnupg.org
>http://lists.gnupg.org/mailman/listinfo/gnupg-devel

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/




More information about the Gnupg-devel mailing list