bug compiling in gnu g++ in c++0x std

Leandro Santiago <[email protected]> Thu, 10 May 2012 12:58:40 -0300
Newsgroups gmane.comp.video.graphicsmagick.bugs
Message-ID <CAHd-4wCUhSyC5-oYNYfGr2LBA3AGpmgu56Dh=5hTECE+eC_kLw@mail.gmail.com>
Hello to all. I'm new in graphicsmagick.

I'm going to use Magick++ in a server site application written in
C++2011 and I found a problem when I try to link GraphicsMagick in my
app. But the problem also happens with small programs (i created a
simple main.cpp which just creates an image from disk) like the
demo.cpp in Magick++/demo dir.

Trying to compile without C++0x:

$ g++ -o demo demo.cpp `GraphicsMagick++-config --cppflags --cxxflags
--ldflags --libs`

Everything OK.

But with C++0x enabled (-std=c++0x);

g++ -o demo demo.cpp `GraphicsMagick++-config --cppflags --cxxflags
--ldflags --libs` -std=c++0x
/usr/include/c++/4.5/i686-linux-gnu/bits/gthr-default.h:127:1:
warning: ‘int __gthrw_pthread_cancel(pthread_t)’ used but never
defined
/tmp/ccsy3HfX.o:(.rodata+0x8e8): undefined reference to
`__gthrw_pthread_cancel(unsigned long)'
collect2: ld returned 1 exit status

I'm using Ubuntu 11.04 32-bit and gcc (Ubuntu/Linaro 4.5.2-8ubuntu4)
4.5.2, but I also tested in a gcc-4.7 in the same machine and the
problem was the same.

The version of GraphicsMagick I'm using in the 1.3.15 one.

When I try to use the native package from ubuntu repository
(1.3.12-1), the error is longer:

/usr/include/c++/4.5/i686-linux-gnu/bits/gthr-default.h:118:1:
warning: ‘int __gthrw_pthread_once(pthread_once_t*, void (*)())’
declared ‘static’ but never defined
/usr/include/c++/4.5/i686-linux-gnu/bits/gthr-default.h:119:1:
warning: ‘void* __gthrw_pthread_getspecific(pthread_key_t) throw ()’
declared ‘static’ but never defined
/usr/include/c++/4.5/i686-linux-gnu/bits/gthr-default.h:120:1:
warning: ‘int __gthrw_pthread_setspecific(pthread_key_t, const void*)
throw ()’ declared ‘static’ but never defined
/usr/include/c++/4.5/i686-linux-gnu/bits/gthr-default.h:122:1:
warning: ‘int __gthrw_pthread_create(pthread_t*, const
pthread_attr_t*, void* (*)(void*), void*) throw ()’ declared ‘static’
but never defined
/usr/include/c++/4.5/i686-linux-gnu/bits/gthr-default.h:123:1:
warning: ‘int __gthrw_pthread_join(pthread_t, void**)’ declared
‘static’ but never defined
/usr/include/c++/4.5/i686-linux-gnu/bits/gthr-default.h:124:1:
warning: ‘int __gthrw_pthread_equal(pthread_t, pthread_t) throw ()’
declared ‘static’ but never defined
/usr/include/c++/4.5/i686-linux-gnu/bits/gthr-default.h:125:1:
warning: ‘pthread_t __gthrw_pthread_self() throw ()’ declared ‘static’
but never defined
/usr/include/c++/4.5/i686-linux-gnu/bits/gthr-default.h:126:1:
warning: ‘int __gthrw_pthread_detach(pthread_t) throw ()’ declared
‘static’ but never defined
/usr/include/c++/4.5/i686-linux-gnu/bits/gthr-default.h:127:1:
warning: ‘int __gthrw_pthread_cancel(pthread_t)’ declared ‘static’ but
never defined
/usr/include/c++/4.5/i686-linux-gnu/bits/gthr-default.h:128:1:
warning: ‘int __gthrw_sched_yield() throw ()’ declared ‘static’ but
never defined
/usr/include/c++/4.5/i686-linux-gnu/bits/gthr-default.h:130:1:
warning: ‘int __gthrw_pthread_mutex_lock(pthread_mutex_t*) throw ()’
declared ‘static’ but never defined
/usr/include/c++/4.5/i686-linux-gnu/bits/gthr-default.h:131:1:
warning: ‘int __gthrw_pthread_mutex_trylock(pthread_mutex_t*) throw
()’ declared ‘static’ but never defined
/usr/include/c++/4.5/i686-linux-gnu/bits/gthr-default.h:134:1:
warning: ‘int __gthrw_pthread_mutex_timedlock(pthread_mutex_t*, const
timespec*) throw ()’ declared ‘static’ but never defined
/usr/include/c++/4.5/i686-linux-gnu/bits/gthr-default.h:137:1:
warning: ‘int __gthrw_pthread_mutex_unlock(pthread_mutex_t*) throw ()’
declared ‘static’ but never defined
/usr/include/c++/4.5/i686-linux-gnu/bits/gthr-default.h:138:1:
warning: ‘int __gthrw_pthread_mutex_init(pthread_mutex_t*, const
pthread_mutexattr_t*) throw ()’ declared ‘static’ but never defined
/usr/include/c++/4.5/i686-linux-gnu/bits/gthr-default.h:139:1:
warning: ‘int __gthrw_pthread_mutex_destroy(pthread_mutex_t*) throw
()’ declared ‘static’ but never defined
/usr/include/c++/4.5/i686-linux-gnu/bits/gthr-default.h:141:1:
warning: ‘int __gthrw_pthread_cond_broadcast(pthread_cond_t*) throw
()’ declared ‘static’ but never defined
/usr/include/c++/4.5/i686-linux-gnu/bits/gthr-default.h:142:1:
warning: ‘int __gthrw_pthread_cond_signal(pthread_cond_t*) throw ()’
declared ‘static’ but never defined
/usr/include/c++/4.5/i686-linux-gnu/bits/gthr-default.h:143:1:
warning: ‘int __gthrw_pthread_cond_wait(pthread_cond_t*,
pthread_mutex_t*)’ declared ‘static’ but never defined
/usr/include/c++/4.5/i686-linux-gnu/bits/gthr-default.h:144:1:
warning: ‘int __gthrw_pthread_cond_timedwait(pthread_cond_t*,
pthread_mutex_t*, const timespec*)’ declared ‘static’ but never
defined
/usr/include/c++/4.5/i686-linux-gnu/bits/gthr-default.h:145:1:
warning: ‘int __gthrw_pthread_cond_destroy(pthread_cond_t*) throw ()’
declared ‘static’ but never defined
/usr/include/c++/4.5/i686-linux-gnu/bits/gthr-default.h:148:1:
warning: ‘int __gthrw_pthread_key_create(pthread_key_t*, void
(*)(void*)) throw ()’ declared ‘static’ but never defined
/usr/include/c++/4.5/i686-linux-gnu/bits/gthr-default.h:149:1:
warning: ‘int __gthrw_pthread_key_delete(pthread_key_t) throw ()’
declared ‘static’ but never defined
/usr/include/c++/4.5/i686-linux-gnu/bits/gthr-default.h:150:1:
warning: ‘int __gthrw_pthread_mutexattr_init(pthread_mutexattr_t*)
throw ()’ declared ‘static’ but never defined
/usr/include/c++/4.5/i686-linux-gnu/bits/gthr-default.h:151:1:
warning: ‘int __gthrw_pthread_mutexattr_settype(pthread_mutexattr_t*,
int) throw ()’ declared ‘static’ but never defined
/usr/include/c++/4.5/i686-linux-gnu/bits/gthr-default.h:152:1:
warning: ‘int __gthrw_pthread_mutexattr_destroy(pthread_mutexattr_t*)
throw ()’ declared ‘static’ but never defined

Thanks in advance!

-- 
-----
Sent from my Atari

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Graphicsmagick-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/graphicsmagick-bugs