468,512 Members | 1,487 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,512 developers. It's quick & easy.

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

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)

Aug 26 '06 #1
1 4169
do************@gmail.com wrote:
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
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Aug 26 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Thomas J. Clancy | last post: by
4 posts views Thread by goberle | last post: by
5 posts views Thread by PengYu.UT | last post: by
14 posts views Thread by Haro Panosyan | last post: by
reply views Thread by Stewart Midwinter | last post: by
41 posts views Thread by Gary Wessle | last post: by
7 posts views Thread by TBass | last post: by
17 posts views Thread by Adem24 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.