Re: problem about gcc using *.so

Xiang Li <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
On 4/27/2011 8:35 PM, liuying wrote:
>
> Dear:
>
>     I have a problem about using dynamic library.I
>
> generate "snmp.so" successfully.
>
>     But when I use:
>
>    $ gcc main.c -L -lsnmp -I ./include -o main
>

After "-L" you probably should give the directory to search for your library

>  It returns:
>
>
>     snmp.so: undefined reference to `register_mib`
>     snmp.so: undefined reference to `send_v2trap`
>     snmp.so: undefined reference to `debugmsg`
>     snmp.so: undefined reference to `……`
>      ……
>
>   There are some errors.What can I do to solve the
>
> problem?
>
Those symbols should be in one of the following libs so
you  need to link with one or more of them:

-lnetsnmptrapd -lnetsnmpagent -lnetsnmpmibs \
      -lnetsnmphelpers

-- 
Xiang Li
http://www.champnms.com

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.