[Bug c++/53614] New: g++ undefined symbols static const data members conditional assignment

cam888eron at yahoo dot com gcc-bugzilla@gcc.gnu.org
Fri Jun 8 15:15:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53614

             Bug #: 53614
           Summary: g++ undefined symbols static const data members
                    conditional assignment
    Classification: Unclassified
           Product: gcc
           Version: 4.4.6
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: cam888eron@yahoo.com


Created attachment 27585
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27585
output of -save-temps

I wanted to attach a 2nd file, main.ii.  Also a 3rd file, Foo.cc.
  Looks like this only allows 1 attachment.  I will try to send later.

  main.ii should let you duplicate ld error undefined symbols.
  Foo.cc if you wish to verify correctness using
  -DWORKAROUND, otherwise please ignore it.  Thanks.

% echo ; g++ -v -save-temps -m64 -c Foo.cc ; echo ; g++ -v -save-temps -m64
-odefineMe main.cc Foo.o

Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla
--enable-bootstrap --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk
--disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-multifile --enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib
--with-ppl --with-cloog --with-tune=generic --with-arch_32=i686
--build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.6 20110731 (Red Hat 4.4.6-3) (GCC) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-m64' '-c' '-shared-libgcc'
'-mtune=generic'
 /usr/libexec/gcc/x86_64-redhat-linux/4.4.6/cc1plus -E -quiet -v -D_GNU_SOURCE
Foo.cc -m64 -mtune=generic -fpch-preprocess -o Foo.ii
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include-fixed"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../x86_64-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6

/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/x86_64-redhat-linux
 /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/backward
 /usr/local/include
 /usr/lib/gcc/x86_64-redhat-linux/4.4.6/include
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-m64' '-c' '-shared-libgcc'
'-mtune=generic'
 /usr/libexec/gcc/x86_64-redhat-linux/4.4.6/cc1plus -fpreprocessed Foo.ii
-quiet -dumpbase Foo.cc -m64 -mtune=generic -auxbase Foo -version -o Foo.s
GNU C++ (GCC) version 4.4.6 20110731 (Red Hat 4.4.6-3) (x86_64-redhat-linux)
        compiled by GNU C version 4.4.6 20110731 (Red Hat 4.4.6-3), GMP
version 4.3.1, MPFR version 2.4.1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 42c2a139506c57f2f1525b40cf548e53
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-m64' '-c' '-shared-libgcc'
'-mtune=generic'
 as -V -Qy --64 -o Foo.o Foo.s
GNU assembler version 2.20.51.0.2 (x86_64-redhat-linux) using BFD version
version 2.20.51.0.2-5.28.el6 20091009
COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/4.4.6/:/usr/libexec/gcc/x86_64-redhat-linux/4.4.6/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/4.4.6/:/usr/lib/gcc/x86_64-redhat-linux/:/usr/libexec/gcc/x86_64-redhat-linux/4.4.6/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/4.4.6/:/usr/lib/gcc/x86_64-redhat-linux/
LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/4.4.6/:/usr/lib/gcc/x86_64-redhat-linux/4.4.6/:/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-m64' '-c' '-shared-libgcc'
'-mtune=generic'

Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla
--enable-bootstrap --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk
--disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-multifile --enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib
--with-ppl --with-cloog --with-tune=generic --with-arch_32=i686
--build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.6 20110731 (Red Hat 4.4.6-3) (GCC) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-m64' '-odefineMe' '-shared-libgcc'
'-mtune=generic'
 /usr/libexec/gcc/x86_64-redhat-linux/4.4.6/cc1plus -E -quiet -v -D_GNU_SOURCE
main.cc -m64 -mtune=generic -fpch-preprocess -o main.ii
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include-fixed"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../x86_64-redhat-linux/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6

/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/x86_64-redhat-linux
 /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../include/c++/4.4.6/backward
 /usr/local/include
 /usr/lib/gcc/x86_64-redhat-linux/4.4.6/include
 /usr/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-m64' '-odefineMe' '-shared-libgcc'
'-mtune=generic'
 /usr/libexec/gcc/x86_64-redhat-linux/4.4.6/cc1plus -fpreprocessed main.ii
-quiet -dumpbase main.cc -m64 -mtune=generic -auxbase main -version -o main.s
GNU C++ (GCC) version 4.4.6 20110731 (Red Hat 4.4.6-3) (x86_64-redhat-linux)
        compiled by GNU C version 4.4.6 20110731 (Red Hat 4.4.6-3), GMP
version 4.3.1, MPFR version 2.4.1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 42c2a139506c57f2f1525b40cf548e53
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-m64' '-odefineMe' '-shared-libgcc'
'-mtune=generic'
 as -V -Qy --64 -o main.o main.s
GNU assembler version 2.20.51.0.2 (x86_64-redhat-linux) using BFD version
version 2.20.51.0.2-5.28.el6 20091009
COMPILER_PATH=/usr/libexec/gcc/x86_64-redhat-linux/4.4.6/:/usr/libexec/gcc/x86_64-redhat-linux/4.4.6/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/4.4.6/:/usr/lib/gcc/x86_64-redhat-linux/:/usr/libexec/gcc/x86_64-redhat-linux/4.4.6/:/usr/libexec/gcc/x86_64-redhat-linux/:/usr/lib/gcc/x86_64-redhat-linux/4.4.6/:/usr/lib/gcc/x86_64-redhat-linux/
LIBRARY_PATH=/usr/lib/gcc/x86_64-redhat-linux/4.4.6/:/usr/lib/gcc/x86_64-redhat-linux/4.4.6/:/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-m64' '-odefineMe' '-shared-libgcc'
'-mtune=generic'
 /usr/libexec/gcc/x86_64-redhat-linux/4.4.6/collect2 --eh-frame-hdr --build-id
-m elf_x86_64 --hash-style=gnu -dynamic-linker /lib64/ld-linux-x86-64.so.2
-odefineMe /usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../lib64/crt1.o
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../lib64/crti.o
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/crtbegin.o
-L/usr/lib/gcc/x86_64-redhat-linux/4.4.6
-L/usr/lib/gcc/x86_64-redhat-linux/4.4.6
-L/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../lib64 -L/lib/../lib64
-L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../.. main.o
Foo.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/crtend.o
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/../../../../lib64/crtn.o
Foo.o: In function `Foo::Foo(int)':
Foo.cc:(.text+0x1e): undefined reference to `Foo::thing2'
Foo.cc:(.text+0x26): undefined reference to `Foo::thing3'
collect2: ld returned 1 exit status



More information about the Gcc-bugs mailing list