<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body text="#3333FF" bgcolor="#FFFFFF">
<font size="-1"><font face="Calibri">Hello,<br>
<br>
I'm trying to build an application that uses VICI in C, but I
didn't succeeded in get it running. <br>
<br>
After trying many ways I hope to get some information from you.<br>
<br>
The C client is the example from the API page
(<a class="moz-txt-link-freetext" href="https://www.strongswan.org/apidoc/md_src_libcharon_plugins_vici_README.html">https://www.strongswan.org/apidoc/md_src_libcharon_plugins_vici_README.html</a>).<br>
<br>
I compiled strongswan with the options ./configure --enable-vici
--enable-swanctl --with-dev-headers=/home/user/devheaders<br>
<br>
But everytime I try to build the C code I get errors that some
header files couldn't be found.<br>
<br>
The testvici.c (shown below) lies in the folder
/home/user/devheaders<br>
and I try to build it with: gcc -o testvici testvici.c<br>
<br>
But I always get errors that libraries like config.h or
printf_hook.h could'nt be found. In the case of printf_hook.h
the path to it should be right and the library exists there.<br>
<br>
Please describe me somebody which setting I have to prepare in
order to build a vici application properly. So where do I have
to store my C client (testvici.c) and which header-files have I
to include at which path?<br>
<br>
Thank you very much!<br>
</font></font><br>
<pre class="fragment">#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <libvici.h>
int main(int argc, char *argv[])
{
vici_conn_t *conn;
int ret = 0;
vici_init();
conn = vici_connect(NULL);
if (conn)
{
/* do stuff
vici_disconnect(conn);
}
else
{
ret = errno;
fprintf(stderr, "connecting failed: %s\n", strerror(errno));
}
vici_deinit();
return ret;
}</pre>
<font size="-1"><font face="Calibri"><br>
<br>
</font></font>
</body>
</html>