[strongSwan] building a VICI application in C failes

Thomas Irmscher irmscher.thomas at gmail.com
Sat Feb 6 14:54:27 CET 2016


Hello,

I'm trying to build an application that uses VICI in C, but I didn't
succeeded in get it running.

After trying many ways I hope to get some information from you.

The C client is the example from the API page
(https://www.strongswan.org/apidoc/md_src_libcharon_plugins_vici_README.html).

I compiled strongswan with the options ./configure --enable-vici
--enable-swanctl --with-dev-headers=/home/user/devheaders

But everytime I try to build the C code I get errors that some header
files couldn't be found.

The testvici.c (shown below) lies in the folder /home/user/devheaders
and I try to build it with: gcc -o testvici testvici.c

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.

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?

Thank you very much!

#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;
}



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.strongswan.org/pipermail/users/attachments/20160206/80b328d0/attachment.html>


More information about the Users mailing list