Bug Tracker item #2770990, was opened at 2009-04-17 18:24
Message generated for change (Comment added) made by sbajic
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=1126467&aid=2770990&group_id=250683
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
>Status: Closed
>Resolution: Accepted
Priority: 5
Private: No
Submitted By: chris (interplanetaryc)
Assigned to: Stevan Bajic (sbajic)
Summary: Duplicate symbol _agent_config when compiling on Mac OS X
Initial Comment:
The following error prevents compilation on Mac OS X 10.5 using gcc 4.0.1
ld: duplicate symbol _agent_config in .libs/read_config.o and .libs/pref.o
A fix is possible by declaring agent_config as a static type in read_config.h
Diff attached.
----------------------------------------------------------------------
>Comment By: Stevan Bajic (sbajic)
Date: 2009-06-27 02:12
Message:
Hallo Chris
Your patch has been accepted and added to GIT commit
df5a8d83ce1ab6ad5e1393ffb19ebbde31b813b0
Kind Regards
Stevan Bajic
----------------------------------------------------------------------
Comment By: chris (interplanetaryc)
Date: 2009-06-26 17:10
Message:
Tried the conditional include of read_config.h with the same result:
gcc -dynamiclib ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o
.libs/libdspam.7.0.0.dylib .libs/libdspam.o .libs/heap.o .libs/diction.o
.libs/base64.o .libs/buffer.o .libs/util.o .libs/nodetree.o .libs/error.o
.libs/decode.o .libs/pref.o .libs/read_config.o .libs/config_shared.o
.libs/bnr.o .libs/hash.o .libs/list.o .libs/external_lookup.o
.libs/tokenizer.o .libs/hash_drv.o -lm -install_name
/usr/local/lib/libdspam.7.dylib -compatibility_version 8 -current_version
8.0 -Wl,-single_module
ld: duplicate symbol _agent_config in .libs/read_config.o and
.libs/pref.o
collect2: ld returned 1 exit status
make[3]: *** [libdspam.la] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all] Error 2
make: *** [all-recursive] Error 1
Hard-commenting out the include results in the following:
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H
-DLOGDIR=\"/usr/local/var/dspam/log\" -DCONFDIR=\"/usr/local/etc\"
-DCONFIG_DEFAULT=\"/usr/local/etc/dspam.conf\" -D_THREAD_SAFE -D_REENTRANT
-D_POSIX_PTHREAD_SEMANTICS -D_GNU_SOURCE -I. -g -O2 -Wall
-Wmissing-prototypes -Wmissing-declarations -MT pref.lo -MD -MP -MF
.deps/pref.Tpo -c -o pref.lo pref.c
gcc -DHAVE_CONFIG_H -DLOGDIR=\"/usr/local/var/dspam/log\"
-DCONFDIR=\"/usr/local/etc\" -DCONFIG_DEFAULT=\"/usr/local/etc/dspam.conf\"
-D_THREAD_SAFE -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -D_GNU_SOURCE -I. -g
-O2 -Wall -Wmissing-prototypes -Wmissing-declarations -MT pref.lo -MD -MP
-MF .deps/pref.Tpo -c pref.c -fno-common -DPIC -o .libs/pref.o
pref.c: In function '_ds_pref_aggregate':
pref.c:76: error: 'agent_config' undeclared (first use in this function)
pref.c:76: error: (Each undeclared identifier is reported only once
pref.c:76: error: for each function it appears in.)
pref.c: In function '_ds_ff_pref_commit':
pref.c:291: error: 'EFAILURE' undeclared (first use in this function)
pref.c: In function '_ds_ff_pref_set':
pref.c:323: error: 'EFAILURE' undeclared (first use in this function)
pref.c: In function '_ds_ff_pref_del':
pref.c:350: error: 'EFAILURE' undeclared (first use in this function)
make[2]: *** [pref.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
----------------------------------------------------------------------
Comment By: Stevan Bajic (sbajic)
Date: 2009-06-25 21:47
Message:
Hallo Chris
Thanks for the patch. Maybe better would be to not include read_config.h
in prefs.c if the header file is already included? Could you check if the
patch below fixes the issue on Mac OS X?
diff --git a/src/pref.c b/src/pref.c
index 9da6139..1a24e83 100644
--- a/src/pref.c
+++ b/src/pref.c
@@ -43,7 +43,10 @@
#include "config.h"
#include "util.h"
#include "language.h"
+
+#ifndef _READ_CONFIG_H
#include "read_config.h"
+#endif
/*
* _ds_pref_aggregate: aggregate system preferences and user
preferences
Kind Regards
Stevan Bajic
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=1126467&aid=2770990&group_id=250683
------------------------------------------------------------------------------
_______________________________________________
Dspam-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspam-devel