Hi Dave,
./configure --with-cc=g++ compiles the entire agent with the C++
compiler, which I definitely want to avoid - the semantics are subtly
different and it would be very easy to introduce bugs without realising
it. As it happens I kicked it off just before I started this reply and
the build failed with a compilation error in mib.c "invalid conversion
from `const char*' to `const u_char*'"
My angle on the linking is that using g++ instead of gcc just means that
a few extra libraries are included as standard. I think they both use ld
under the bonnet don't they (I could be wrong about this)? If the
application code is entirely C then presumably the C++ libraries just
won't get linked in - i.e. same effect as manually adding extra -l flags
which you don't need.
I can understand that you might not be happy with this as standard
though. If you look at the patch I've done, all it requires is a
separate variable for the name of the compiler used during linking (I
called it LINKCC). Could we not make it standard in the Makefiles to use
$(CC) for compiling and $(LINKCC) for linking, so that you could do
./configure --with-linkcc=g++
The default setting could still be gcc that way, but of course it would
then be possible to put some helpful info in the ./configure --help
output, which should make it much easier to use.
I hope this is useful.
Regards
Robert Finking
PS I've added this to bugzilla. It's bug number 1416481. I'll copy this
mail to the bug.
Dave Shield wrote:
On Fri, 2006-01-27 at 14:39 +0000, Raffles wrote:
> OK I've fixed it. All you need to be able to link the agent in to a C++
> application, is a small change to the Makefiles in the agent and apps
> directories. When linking the Makefile needs to give g++ as the first
> "argument" to libtool, rather than gcc.
> The real fix for this needs the code which autogenerates the Makefiles
> to be changed, so that ./configure produces the patched version of the
> Makefiles.
I don't think we'd want to switch to linking with g++ as a matter of
course. Net-SNMP is fundamentally a C-based project, not a C++ one.
It's up to the person wanting to use in a "non-standard" way to make
the necessary adjustments.
But it would certainly be useful if those adjustments could be as
simple as possible.
What happens if you run
./configure --with-cc=g++
?
Dave
--
Visit our website at www.roke.co.uk
Roke Manor Research Ltd, Roke Manor, Romsey, Hampshire SO51 0ZN, UK.
The information contained in this e-mail and any attachments is proprietary to
Roke Manor Research Ltd and must not be passed to any third party without
permission. This communication is for information only and shall not create or
change any contractual relationship.
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
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/listinfo/net-snmp-users