Skip to content

How to fix "duplicate symbol" error in tcl compilation #4

@jchavez1992

Description

@jchavez1992

I found two possible solutions to the following error:

duplicate symbol '_fixstrtod' in:
    strtod.o
    fixstrtod.o
ld: 1 duplicate symbol for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [libtcl8.4.dylib] Error 1
make: *** [tcl] Error 1

Option 1:

Add #undef strtod in compat/strtod.c (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=440683)

+++ tcl8.4-8.4.15/compat/strtod.c	2007-09-03 17:23:28.000000000 +0100
@@ -62,6 +62,8 @@
  *----------------------------------------------------------------------
  */
 
+#undef strtod
+
 double
 strtod(string, endPtr)
     CONST char *string;		/* A decimal ASCII floating-point number,

Option 2:

Comment (or remove) the line in the tcl8.4.11/unix/configure file LIBOBJS="$LIBOBJS strtod.o" (seen in the diff attached to this forum https://sourceforge.net/p/tcl/bugs/3129/)

RCS file: /cvsroot/tcl/tcl/unix/configure,v
retrieving revision 1.92.2.45
diff -u -r1.92.2.45 configure
--- configure   27 Nov 2005 02:34:41 -0000      1.92.2.45
+++ configure   1 Dec 2005 00:39:27 -0000
@@ -6443,7 +6443,7 @@

 if test "$tcl_ok" = 0; then
     test -n "$verbose" && echo "       Adding strtod.o."
-    LIBOBJS="$LIBOBJS strtod.o"
+#   LIBOBJS="$LIBOBJS strtod.o"
 fi

I have tried both, and both remove the duplicate symbol error. My question, as a complete outsider to C programming, which method is better?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions