|
From: Andy S. <was...@co...> - 2005-01-08 12:52:41
|
I am getting a strange error when trying to compile the following code
from the Net-SNMP package:
void
netsnmp_config_parse_table_set(const char *token, char *line)
{
/* Edited for brevity */
char *pos;
/* Line 818 */ if (NULL != (pos = strchr(line,' '))) {
config_pwarn("ignoring extra tokens on line");
snmp_log(LOG_WARNING," ignoring '%s'\n", pos);
*pos = '\0';
}
/* Edited for brevity */
}
When I compile the the above code with mingw I get the following error:
table_dataset.c:818: error: called object is not a function
The line that is causing the error is marked in the above code. For some
reason mingw does not seem to like the strchr call. The code compiles
fine on Linux using gcc and strchr is actually called other places in
the code and seems to compile in those places with mingw. The compile
line I am using is:
/bin/sh ../../libtool --mode=compile i386-mingw32msvc-gcc
-I../../include -I. -I../../agent -I-I../../agent/mibgroup
-I../../snmplib -g -O2 -Dmingw32 -Dmingw32msvc -Wall -Winline
-Wstrict-prototypes -Wwrite-strings -Wcast-qual -Wno-char-subscripts -c
-o table_dataset.lo table_dataset.c
i386-mingw32msvc-gcc -I../../include -I. -I../../agent
-I-I../../agent/mibgroup -I../../snmplib -g -O2 -Dmingw32 -Dmingw32msvc
-Wall -Winline -Wstrict-prototypes -Wwrite-strings -Wcast-qual
-Wno-char-subscripts -c table_dataset.c -o table_dataset.o
I am cross compiling on Linux in the above example, but I have confirmed
that the error also occurs on Windows with the latest version of mingw
and MSyS. Does anyone have an idea what is causing the error?
Regards,
Andy
|