[Devel] Using libvzctl-0.0.2.so on C++ code

Mateus Baur da Silva mateus.baur at gmail.com
Thu Feb 22 19:18:34 PST 2007


Hi All,

I'm Mateus Baur from Brazil and I'm trying to use OpenVZ for an
academic work. I intend to create a WBEM/CIM provider to manage OpenVZ
VPSes based on preliminary DMTF System Virtualization Model (Xen is
already working on that via a project called Xen-CIM project).

I'm also planning to provide this work to OpenVZ community if the
community is interested depending on the results.

I've downloaded and installed OpenVZ binary RPMs. I also installed
vzctl sources RPM. I'm able to use OpenVZ without any problem.

However, I'm trying to use libvzctl-0.0.2.so in my C++ code and I'm
facing some problems. Whenever I try to build, I get the following
error:

./include/list.h:51: error expected ',' or '...' before 'new'

Looking at the the the list.h file on line 51, we have this function:

static inline void list_add(list_elem_t *new, list_head_t *list)
{
...
}

I include 'config.h' file which in turn includes 'list.h' and some
other files. However, I don't think this error should be happening
because I've included the 'config.h' file inside an 'external "C"
{...}" block. Am I missing something?

I'm using Fedora 5 and the following build command line:
'g++ -L/usr/bin -lvzctl-0.0.2 <source list> -o <executable_name>

If I try to create a C source file and build that using gcc instead of
g++ (or If I edit the openvz include files in order to modify all
references to 'new' and 'private'), then I'm facing the following
problem during the linkage:

/usr/lib/gcc/i386-redhat-linux/4.1.0/../../../libvzctl-0.0.2.so:
undefined reference to 'g_log'
collect2: ld returned 1 exit status

Using nm it seems that the library actually contains this 'g_log'
symbol as undefined. Using ldd on the library, it seems that the only
dependencies are libc and ld-linux and both of them also don't contain
this symbol.

Does anybody have some clue? How could I get it working?


BTW, is there some documentation for OpenVZ developers? If so, where
could I find it?

Sorry for the long message and have a good one!

Thanks in advance,
Mateus




More information about the Devel mailing list