Cygwin g++ Mulitiple Definitions of std::min()

G

Guest

I've googled this problem and can't seem to find an answer.

I get the error below when linking an executable which I am trying to
port from Linux to Cygwin/XP. I'm not sure how to attack this...any
thoughts? Do I possibly need to use some different g++ options when
linking/compiling on cygwin

-------------------- link error ---------------------
g++ -lpthread -g stilverify.o libstil.so -o stilverify
libstil.so: In function `_ZSt3minIjERKT_S2_S2_':
/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/stl_algobase.h:151:
multiple definition of `unsigned int const& std::min<unsigned
int>(unsigned int const&, unsigned int const&)'
stilverify.o:/usr/lib/gcc/i686-pc-cygwin/3.4.4/include/c++/bits/locale_facets.tcc:2497:
first defined here
collect2: ld returned 1 exit status
make: *** [stilverify] Error 1

------------------------------- g++ version -----------------------

$ g++ -v
Reading specs from /usr/lib/gcc/i686-pc-cygwin/3.4.4/specs
Configured with: /gcc/gcc-3.4.4/gcc-3.4.4-1/configure --verbose
--prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib
--libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info
--enable-languages=c,ada,c++,d,f77,java,objc --enable-nls
--without-included-gettext --enable-version-specific-runtime-libs
--without-x --enable-libgcj --disable-java-awt --with-system-zlib
--enable-interpreter --disable-libgcj-debug --enable-threads=posix
--enable-java-gc=boehm --disable-win32-registry
--enable-sjlj-exceptions --enable-hash-synchronization
--enable-libstdcxx-debug : (reconfigured)
Thread model: posix
gcc version 3.4.4 (cygming special) (gdc 0.12, using dmd 0.125)
 
V

Victor Bazarov

I've googled this problem and can't seem to find an answer.

I get the error below when linking an executable which I am trying to
port from Linux to Cygwin/XP.

You might consider posting to 'gnu.g++.help' or to the Windows newsgroup.
I'm not sure how to attack this...any
thoughts? Do I possibly need to use some different g++ options when
linking/compiling on cygwin

We can't help you with options. We don't discuss how to use tools,
how to do things in the langauge.

Link errors are implementation-specific and solutions for them are
implemenation specific as well. If you have too many definitions of
your function (more than one), the linker tells you. To correct that
you usually remove extraneous definitions.

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top