-------- Original Message -------- Subject: libsemanage API Date: Fri, 06 Jul 2007 10:59:23 -0400 From: Joe Rocklin To: dwalsh@redhat.com Hi Dan, I'm trying to use the API to libsemanage from C++, and I'm running into some difficulties finding relevant documentation on the subject. If you could point me in the right direction, I'd really appreciate it! The issue I'm having is with trying to work with the return results from semanage_user_list. The struct defines for semanage_user_t (as well as semanage_user_base_t and semanage_user_extra_t) are in the .c files, not the header files, which causes a compile to fail with the following error: setest.cpp:19: error: request for member ‘name’ in ‘*(((semanage_user_t**)(((unsigned int)i) * 4u)) + list)’, which is of non-class type ‘semanage_user_t*’ I've attached the small program used to test this. If I run this in ddd and display the variable list[0].name it correctly displays the contents. I believe the issue is that the compiler isn't aware of the struct definition, which isn't presented until the link phase. Is there another way of accessing this data? Or is the correct answer to move the struct definitions into the header files? --Joe