Error while developing sample provider

Radek Novacek rnovacek at redhat.com
Mon Oct 14 12:31:24 UTC 2013


On Mon 14 of Oct 2013 13:27:47 ganesh kumar wrote:
> Hi,
> 
>  I'm getting error while creating sample provider. I followed "Openlmi CIM
> Provider HowTo" tutorial to create "mof,.c,.h and CMakeList" files, when i
> tried to cmake it asks for "CMake Error: your CXX compiler: "/usr/bin/c++"
> was not found" so i installed gcc-c++ rpm.
> 
> later i followed tutorial instruction i.e.
> 
> mkdir build && cd build
> 
> cmake ..
> 
> when i try to make, its reporting error globals.h, errors.h...etc files not
> found. So i copied globals.h errors.h....etc and their respective .c files
> from openlmi-networking provider to sample folder.
> 
> But now i getting error in globals.h file.
> 
> #openlmi-providers/src/sample/globals.h:131:71: error: unknown type name
> ‘uint’
>  LMIResult g_hash_table_insert_uint(GHashTable *hash, const char *key, uint
> value);

Hi,

you should not use OpenLMI-Networking parts directly in your provider. If you 
want to add association between your provider and some classes from -
Networking, I would suggest to use CBEnumInstanceNames macro from CMPI. The 
macro will return list of all instance names of some given class and you can 
create the association with your class from the result.

That way, your provider won't have build-time dependency on OpenLMI-Networking 
(which is good for inclusion to OpenLMI-Providers - -Networking depends on -
Providers and this would cause circular dependencies). 

Radek Novacek


More information about the openlmi-devel mailing list