Fwd: Fwd: about gcc -o snmpdemoapp ... -lsnmp

"Clement Hsu" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Dear Thomas:
Thanks, however it still not work. Ths same error still occur even i give th
right path such las /snmp/net-snmp-5.3.1/net-snmp-config --libs which
following your advice.

Do you have any other suggestion? any help is appreciated. thank you

Best regards,
Clement Hsu



---------- Forwarded message ----------
From: Thomas Anders <[email protected]>
Date: 2006/11/29 下午 7:22
Subject: Re: Fwd: about gcc -o snmpdemoapp ... -lsnmp
To: Clement Hsu <[email protected]>
Cc: net-snmp-users <[email protected]>

Clement Hsu wrote:
> Thank you for your assistant. The output of net-snmp-config --libs is
> followings:
>
> -L/usr/local/lib -lnetsnmp -lcrypto -lm -crypto
>
> and if i call  cc  snmpdemoapp.c -o snmpdemoapp `net-snmp-config --libs`
> the message shows that net-snmp-config --libs not exists.
> and if i execute the following instruction
>
> gcc -c snmpdemoapp.c -o snmpdemoapp -L/usr/local/lib -netsnmp -crypto -lm
>
> the message shows :
>
> gcc : -lnetsnmp: linker input file unused because linking not done
> gcc : -lcrypto: linker input file unused because linking not done
> gcc : -lm: linker input file unused because linking not done
>
> and how to give the full path to net-snmp-config?

gcc `/path/to/net-snmp-config --cflags` -c -o snmpdemoapp.o snmpdemoapp.c

gcc -o snmpdemoapp snmpdemoapp.o `/path/to/net-snmp-config --libs`


(Replace /path/to by your real path, I hasten to add.)


+Thomas

--
Thomas Anders (thomas.anders at blue-cable.de)

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
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.