Accessing C++ code from SNMP agent's C source file - SNMP

This is a discussion on Accessing C++ code from SNMP agent's C source file - SNMP ; Hi all, I have a requirement of accessing C++ datamodule in C source files(generated using mib2c) of SNMP agent. To fecilitate this special access in C++ datamodule files we use C wrappers as below #ifdef __cplusplus extern "C" { #endif ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Accessing C++ code from SNMP agent's C source file

  1. Accessing C++ code from SNMP agent's C source file

    Hi all,

    I have a requirement of accessing C++ datamodule in C source
    files(generated using mib2c) of SNMP agent. To fecilitate this
    special access in C++ datamodule files we use C wrappers as below

    #ifdef __cplusplus

    extern "C" {
    #endif

    int CdsprVariableInRangeIntegerValue(u_int16 ui16_ModuleID, u_int16
    ui16_VariableID, int iValue);

    int CdsprVariableInRangeRealValue(u_int16 ui16_ModuleID, u_int16
    ui16_VariableID, double fValue);

    int CdsprVariableInRangeSelectionValue(u_int16 ui16_ModuleID, u_int16
    ui16_VariableID, const char );

    XXXXXXXXXXX

    etc;

    #ifdef __cplusplus

    }
    #endif

    When I try to access say function
    "CdsprVariableInRangeIntegerValue(XXX)" , it throws a the following
    compilation error


    ../.libs/libnetsnmpmibs.so: undefined reference to
    'CdsprVariableInRangeIntegerValue'


    Has anyone of faced similar situation? please help - I am going mad
    over this for the last 2 days.

    With regards,

    Raghavendra

    -------------------------------------------------------------------------
    This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
    Build the coolest Linux based applications with Moblin SDK & win great prizes
    Grand prize is a trip for two to an Open Source event anywhere in the world
    http://moblin-contest.org/redirect.p...r_id=100&url=/
    _______________________________________________
    Net-snmp-users mailing list
    Net-snmp-users@lists.sourceforge.net
    Please see the following page to unsubscribe or change other options:
    https://lists.sourceforge.net/lists/...net-snmp-users


  2. Re: Accessing C++ code from SNMP agent's C source file

    On Jul 16, 9:21*pm, raghavendr...@gmail.com ("Raghavendra Prasad")
    wrote:
    > Hi all,
    >
    > * I have a requirement of accessing C++ *datamodule in C source
    > files(generated using mib2c) of SNMP agent. To fecilitate *this
    > special access in C++ datamodule files we use C wrappers as below
    >
    > #ifdef __cplusplus
    >
    > *extern "C" {
    > *#endif
    >
    > *int CdsprVariableInRangeIntegerValue(u_int16 ui16_ModuleID, u_int16
    > ui16_VariableID, int iValue);
    >
    > int CdsprVariableInRangeRealValue(u_int16 ui16_ModuleID, u_int16
    > ui16_VariableID, double fValue);
    >
    > int CdsprVariableInRangeSelectionValue(u_int16 ui16_ModuleID, u_int16
    > ui16_VariableID, const char );
    >
    > XXXXXXXXXXX
    >
    > etc;
    >
    > #ifdef __cplusplus
    >
    > * * * * }
    > *#endif
    >
    > When I try to access say function
    > "CdsprVariableInRangeIntegerValue(XXX)" , it throws a the following
    > compilation error
    >
    > ./.libs/libnetsnmpmibs.so: undefined reference to
    > 'CdsprVariableInRangeIntegerValue'
    >
    > Has anyone of faced similar situation? please help - I am going mad
    > over this for the last 2 days.
    >
    > With regards,
    >
    > Raghavendra
    >
    > -------------------------------------------------------------------------
    > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
    > Build the coolest Linux based applications with Moblin SDK & win great prizes
    > Grand prize is a trip for two to an Open Source event anywhere in the worldhttp://moblin-contest.org/redirect.php?banner_id=100&url=/
    > _______________________________________________
    > Net-snmp-users mailing list
    > Net-snmp-us...@lists.sourceforge.net
    > Please see the following page to unsubscribe or change other options:https://lists.sourceforge.net/lists/...net-snmp-users


    hi mr.prasad
    i am also doing research in snmp using c programs, do u have any
    sample programs for snmp in c lanugauage?

+ Reply to Thread