[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-gnutls] Re: Compiling and linking problems
From: |
Simon Josefsson |
Subject: |
[Help-gnutls] Re: Compiling and linking problems |
Date: |
Fri, 30 Dec 2005 19:46:40 +0100 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) |
address@hidden writes:
> So I have written my first application with GnuTLS, but when
> I decided to compile it, there appears some errors that I
> can't correct. The application is closely based on the SRP
> client example and is written in C++.
>
> When I use the GnuTLS 1.3.x branch the compiler gives me the
> following error:
>> # g++ -o client client.cxx
>> In file included from common.h:4
>> from client.cxx:32
>> /usr/include/gnutls/extra.h:95: error: expected `,' or
> `...' before "new"
> It doesn't appear when I make my application C compatible
> and compile it with gcc C compiler. Maybe the cause of the
> error is that in C++ there is a operator named "new", but
> in the header file "new" is used as a pointer.
Are you sure your code doesn't contain syntactic bugs?
Hm. Perhaps C++ doesn't like variables called 'new'? It is used in
this prototype:
typedef int (*gnutls_ia_avp_func) (gnutls_session_t session, void *ptr,
const char *last, size_t lastlen,
char **new, size_t * newlen);
Try renaming 'new' to 'next' and see if it builds. If it works, I'll
change it.
> The second error appears while the linking (no matter which
> version I use - 1.2.x or 1.3.x):
>> # gcc -o client client.cxx `libgnutls-config --libs
> --cflags`
>> /tmp/ccWTsMl2.o(.text+0x12f): In function `main':
>> : undefined reference to `gnutls_global_init_extra'
>> collect2: ld return 1 exit status
If you are using libgnutls-extra, you should use
`libgnutls-extra-config --libs --cflags' instead.