First a reminder - DO NOT SPAM THE LIST - You have posted about this
issue five times, I would estimate that by doing so you lowered the
probability of actually getting help to about 1/5th of the initial
probability. If you want help that focuses on your problems then there
have already been numerous offers of consultancy services.
On tor, 2007-06-28 at 07:43 -0700, Need Help wrote:
> Ok, thanks. Using the --with-cflags="-x c" option now allows the
> "./configure" command to complete, however, when I issue the "make"
> command I now get all of these weird errors. They are produced in
> the hundreds and hundreds. Seems like it is complains about some
> special characters I guess.
*ROTFL*
You could say so yes.
The problem is that the effect of the -x c flag is to tell the compiler
to treat any input as C source code. As long as you are compiling code
that works fine but then you try to link it and now it tries to compile
the object files as C source code.
> Any idea on what is going on where and how I can "fix" these errors?
Fixes (in order of preference):
1. Carefully explain to your management team that there are things in C
that lacks a counterpart in C++. It really is two different
languages so why not treat them so and allow C code to be
compiled with a C compiler. (Just wait til they ask you to
compile BLAS, then you have real trouble)
Additionaly they are losing money waiting for you to port the
applications to C++.
2. Tell the compiler that when linking it should not treat all files as
C. This is done by the following configure line:
configure --with-cc=c++ --with-cflags="-x c" --with-ldflags="-x none"
but if you try to build using this it will fail to compile since
the -x none parameter is applied to late to help. In order to
handle that the attached patch could be applied (Patch against
SVN revision 16564) but I do not know if it is fit for mainline
as we might depend of the current ordering of things in some odd
case.
/MF
> The "make" starts normally by compiling some files no problem, then
> the errors start occuring:
>
> /bin/sh ../libtool --mode=compile mipsel-uclibc-g++ -I../include
> -I/export/home/rosent1/vegasCC/1.97/buildsys/A506/netsnmp/include -I.
> -I../agent
> -I/export/home/rosent1/vegasCC/1.97/buildsys/A506/netsnmp/agent
> -I../agent/mibgroup
> -I/export/home/rosent1/vegasCC/1.97/buildsys/A506/netsnmp/agent/mibgroup
> -I../snmplib
> -I/export/home/rosent1/vegasCC/1.97/buildsys/A506/netsnmp/snmplib -x c
> -Ulocalhost -Dlocalhost=localhost -c -o snmpd.lo snmpd.c
> mipsel-uclibc-g++ -I../include
> -I/export/home/rosent1/vegasCC/1.97/buildsys/A506/netsnmp/include -I.
> -I../agent
> -I/export/home/rosent1/vegasCC/1.97/buildsys/A506/netsnmp/agent
> -I../agent/mibgroup
> -I/export/home/rosent1/vegasCC/1.97/buildsys/A506/netsnmp/agent/mibgroup
> -I../snmplib
> -I/export/home/rosent1/vegasCC/1.97/buildsys/A506/netsnmp/snmplib -x c
> -Ulocalhost -Dlocalhost=localhost -c snmpd.c -o snmpd.o
> snmpd.c: In function `main':
> snmpd.c:948: warning: assignment discards qualifiers from pointer
> target type
> /bin/sh ../libtool --mode=link mipsel-uclibc-g++ -x c -Ulocalhost
> -Dlocalhost=localhost -o snmpd snmpd.lo libnetsnmpmibs.la
> libnetsnmpagent.la
> helpers/libnetsnmphelpers.la ../snmplib/libnetsnmp.la -ldl -lm
> mipsel-uclibc-g++ -x c -Ulocalhost -Dlocalhost=localhost -o snmpd
> snmpd.o ./.libs/libnetsnmpmibs.a ./.libs/libnetsnmpagent.a
> helpers/.libs/libnetsnmphelpers.a ../snmplib/.libs/libnetsnmp.a -ldl
> -lm
> snmpd.o:1: error: stray '\177' in program
Index: apps/snmpnetstat/Makefile.in
===================================================================
--- apps/snmpnetstat/Makefile.in (revision 16564)
+++ apps/snmpnetstat/Makefile.in (working copy)
@@ -29,4 +29,4 @@
all: standardall
snmpnetstat$(EXEEXT): ${LOBJS} ${USELIBS}
- ${LINK} ${CFLAGS} -o $@ ${LOBJS} ${LOCAL_LIBS} ${LDFLAGS} ${LIBS}
+ ${LINK} ${CFLAGS} ${LDFLAGS} -o $@ ${LOBJS} ${LOCAL_LIBS} ${LIBS}
Index: apps/Makefile.in
===================================================================
--- apps/Makefile.in (revision 16564)
+++ apps/Makefile.in (working copy)
@@ -88,59 +88,59 @@
# build rules
#
snmpwalk$(EXEEXT): snmpwalk.$(OSUFFIX) $(USELIBS)
- $(LINK) ${CFLAGS} -o $@ snmpwalk.$(OSUFFIX) $(LOCAL_LIBS) ${LDFLAGS} ${LIBS}
+ $(LINK) ${CFLAGS} ${LDFLAGS} -o $@ snmpwalk.$(OSUFFIX) $(LOCAL_LIBS) ${LIBS}
snmpbulkwalk$(EXEEXT): snmpbulkwalk.$(OSUFFIX) $(USELIBS)
- $(LINK) ${CFLAGS} -o $@ snmpbulkwalk.$(OSUFFIX) $(LOCAL_LIBS) ${LDFLAGS} ${LIBS}
+ $(LINK) ${CFLAGS} ${LDFLAGS} -o $@ snmpbulkwalk.$(OSUFFIX) $(LOCAL_LIBS) ${LIBS}
snmpbulkget$(EXEEXT): snmpbulkget.$(OSUFFIX) $(USELIBS)
- $(LINK) ${CFLAGS} -o $@ snmpbulkget.$(OSUFFIX) $(LOCAL_LIBS) ${LDFLAGS} ${LIBS}
+ $(LINK) ${CFLAGS} ${LDFLAGS} -o $@ snmpbulkget.$(OSUFFIX) $(LOCAL_LIBS) ${LIBS}
snmptranslate$(EXEEXT): snmptranslate.$(OSUFFIX) $(USELIBS)
- $(LINK) ${CFLAGS} -o $@ snmptranslate.$(OSUFFIX) $(LOCAL_LIBS) ${LDFLAGS} ${LIBS}
+ $(LINK) ${CFLAGS} ${LDFLAGS} -o $@ snmptranslate.$(OSUFFIX) $(LOCAL_LIBS) ${LIBS}
snmpstatus$(EXEEXT): snmpstatus.$(OSUFFIX) $(USELIBS)
- $(LINK) ${CFLAGS} -o $@ snmpstatus.$(OSUFFIX) $(LOCAL_LIBS) ${LDFLAGS} ${LIBS}
+ $(LINK) ${CFLAGS} ${LDFLAGS} -o $@ snmpstatus.$(OSUFFIX) $(LOCAL_LIBS) ${LIBS}
snmpget$(EXEEXT): snmpget.$(OSUFFIX) $(USELIBS)
- $(LINK) ${CFLAGS} -o $@ snmpget.$(OSUFFIX) $(LOCAL_LIBS) ${LDFLAGS} ${LIBS}
+ $(LINK) ${CFLAGS} ${LDFLAGS} -o $@ snmpget.$(OSUFFIX) $(LOCAL_LIBS) ${LIBS}
snmpdelta$(EXEEXT): snmpdelta.$(OSUFFIX) $(USELIBS)
- $(LINK) ${CFLAGS} -o $@ snmpdelta.$(OSUFFIX) $(LOCAL_LIBS) ${LDFLAGS} ${LIBS}
+ $(LINK) ${CFLAGS} ${LDFLAGS} -o $@ snmpdelta.$(OSUFFIX) $(LOCAL_LIBS) ${LIBS}
snmptable$(EXEEXT): snmptable.$(OSUFFIX) $(USELIBS)
- $(LINK) ${CFLAGS} -o $@ snmptable.$(OSUFFIX) $(LOCAL_LIBS) ${LDFLAGS} ${LIBS}
+ $(LINK) ${CFLAGS} ${LDFLAGS} -o $@ snmptable.$(OSUFFIX) $(LOCAL_LIBS) ${LIBS}
snmptest$(EXEEXT): snmptest.$(OSUFFIX) $(USELIBS)
- $(LINK) ${CFLAGS} -o $@ snmptest.$(OSUFFIX) $(LOCAL_LIBS) ${LDFLAGS} ${LIBS}
+ $(LINK) ${CFLAGS} ${LDFLAGS} -o $@ snmptest.$(OSUFFIX) $(LOCAL_LIBS) ${LIBS}
snmptrapd$(EXEEXT): $(TRAPD_OBJECTS) $(USETRAPLIBS) $(INSTALLLIBS)
- $(LINK) ${CFLAGS} -o $@ $(TRAPD_OBJECTS) $(INSTALLLIBS) $(LOCAL_LIBS) ${LDFLAGS} ${TRAPLIBS}
+ $(LINK) ${CFLAGS} ${LDFLAGS} -o $@ $(TRAPD_OBJECTS) $(INSTALLLIBS) $(LOCAL_LIBS) ${TRAPLIBS}
snmptrap$(EXEEXT): snmptrap.$(OSUFFIX) $(USELIBS)
- $(LINK) ${CFLAGS} -o $@ snmptrap.$(OSUFFIX) $(LOCAL_LIBS) ${LDFLAGS} ${LIBS}
+ $(LINK) ${CFLAGS} ${LDFLAGS} -o $@ snmptrap.$(OSUFFIX) $(LOCAL_LIBS) ${LIBS}
snmpinform$(EXEEXT): snmptrap$(EXEEXT)
rm -f snmpinform
$(LN_S) snmptrap$(EXEEXT) snmpinform$(EXEEXT)
snmpset$(EXEEXT): snmpset.$(OSUFFIX) $(USELIBS)
- $(LINK) ${CFLAGS} -o $@ snmpset.$(OSUFFIX) $(LOCAL_LIBS) ${LDFLAGS} ${LIBS}
+ $(LINK) ${CFLAGS} ${LDFLAGS} -o $@ snmpset.$(OSUFFIX) $(LOCAL_LIBS) ${LIBS}
snmpusm$(EXEEXT): snmpusm.$(OSUFFIX) $(USELIBS)
- $(LINK) ${CFLAGS} -o $@ snmpusm.$(OSUFFIX) $(LOCAL_LIBS) ${LDFLAGS} ${LIBS}
+ $(LINK) ${CFLAGS} ${LDFLAGS} -o $@ snmpusm.$(OSUFFIX) $(LOCAL_LIBS) ${LIBS}
snmpvacm$(EXEEXT): snmpvacm.$(OSUFFIX) $(USELIBS)
- $(LINK) ${CFLAGS} -o $@ snmpvacm.$(OSUFFIX) $(LOCAL_LIBS) ${LDFLAGS} ${LIBS}
+ $(LINK) ${CFLAGS} ${LDFLAGS} -o $@ snmpvacm.$(OSUFFIX) $(LOCAL_LIBS) ${LIBS}
snmpgetnext$(EXEEXT): snmpgetnext.$(OSUFFIX) $(USELIBS)
- $(LINK) ${CFLAGS} -o $@ snmpgetnext.$(OSUFFIX) $(LOCAL_LIBS) ${LDFLAGS} ${LIBS}
+ $(LINK) ${CFLAGS} ${LDFLAGS} -o $@ snmpgetnext.$(OSUFFIX) $(LOCAL_LIBS) ${LIBS}
encode_keychange$(EXEEXT): encode_keychange.$(OSUFFIX) $(USELIBS)
- $(LINK) ${CFLAGS} -o $@ encode_keychange.$(OSUFFIX) $(LOCAL_LIBS) ${LDFLAGS} ${LIBS}
+ $(LINK) ${CFLAGS} ${LDFLAGS} -o $@ encode_keychange.$(OSUFFIX) $(LOCAL_LIBS) ${LIBS}
snmpdf$(EXEEXT): snmpdf.$(OSUFFIX) $(USELIBS)
- $(LINK) ${CFLAGS} -o $@ snmpdf.$(OSUFFIX) $(LOCAL_LIBS) ${LDFLAGS} ${LIBS}
+ $(LINK) ${CFLAGS} ${LDFLAGS} -o $@ snmpdf.$(OSUFFIX) $(LOCAL_LIBS) ${LIBS}
libnetsnmptrapd.$(LIB_EXTENSION)$(LIB_VERSION): $(LLIBTRAPD_OBJS)
$(LIB_LD_CMD) $@ ${LLIBTRAPD_OBJS} $(MIBLIB) $(USELIBS) $(PERLLDOPTS) $(LIB_LD_LIBS)
Index: agent/Makefile.in
===================================================================
--- agent/Makefile.in (revision 16564)
+++ agent/Makefile.in (working copy)
@@ -139,7 +139,7 @@
$(CC) $(CFLAGS) -o $@ -D_GETMIBSTAT_TEST -DDODEBUG -c $?
snmpd$(EXEEXT): ${LAGENTOBJS} $(USELIBS) $(AGENTLIB) $(HELPERLIB) $(MIBLIB) $(LIBTARG)
- $(LINK) $(CFLAGS) -o $@ ${LAGENTOBJS} $(LOCAL_LIBS) ${LDFLAGS} ${OUR_AGENT_LIBS}
+ $(LINK) $(CFLAGS) ${LDFLAGS} -o $@ ${LAGENTOBJS} $(LOCAL_LIBS) ${OUR_AGENT_LIBS}
libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION): ${LLIBAGENTOBJS} $(USELIBS)
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders