How to fix C++ depreciated isDisabled()

Posted on 2008-11-03
Last Modified: 2012-05-05
I downloaded source code for project "job-scheduler" from (  When I ran the "configure", a message indicated I had to install ZThread-2.3.2 from SourceForge (  

I am attempting to compile ZThread-2.3.2. When I do a "make install" on my ubuntu box, I get an error message that  C++ function isDisabled() is depreciated in header Guard.h.  The "make install"  messages said: "if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated".  I assume I can also fix the problem in Guard.h.  But I do not know how do do either!

Can someone please help with either solution?

Part of the "make install" messages is in the code snippet section.  Also below that are the two references to isDisabled() in Guard.h

g++ -DHAVE_CONFIG_H -I. -I. -I. -I../include -g -O2 -Wall -DNDEBUG -g -O2 -Wall -DNDEBUG -MT AtomicCount.lo -MD -MP -MF .deps/AtomicCount.Tpo -c AtomicCount.cxx  -fPIC -DPIC -o .libs/AtomicCount.o

In file included from vanilla/SimpleAtomicCount.cxx:26,

                 from AtomicCount.cxx:55:

../include/zthread/Guard.h: In destructor 'ZThread::Guard<LockType, LockingPolicy>::~Guard()':

../include/zthread/Guard.h:494: error: there are no arguments to 'isDisabled' that depend on a template parameter, so a declaration of 'isDisabled' must be available

../include/zthread/Guard.h:494: error: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)

make[2]: *** [AtomicCount.lo] Error 1

make[2]: Leaving directory `/home/marv/ZThread-2.3.2/src'

make[1]: *** [install-recursive] Error 1

make[1]: Leaving directory `/home/marv/ZThread-2.3.2/src'

make: *** [install-recursive] Error 1



bool isDisabled() {

  return !_enabled;


template <class LockType, class LockingPolicy>

Guard<LockType, LockingPolicy>::~Guard() throw() {


  try {





  } catch (...) { /* ignore */ }  



Open in new window

Question by:IT79637
    LVL 1

    Author Comment

    LVL 1

    Author Comment

    More info.  Can anything be done with this:

    # Contributor: Travis Willard <>

    pkgdesc="A platform-independent, multi-threading and synchronization library for C++"
    source=($pkgver.tar.gz zthread-gcc4.patch)  <<-- I tried to download this but got an http 404 error.

    build() {
        cd $startdir/src/ZThread-$pkgver/

        ./configure --prefix=/usr || return 1

        patch -Np1 < $startdir/src/zthread-gcc4.patch || return 1

        make || return 1
        make prefix=$startdir/pkg/usr install || return 1

        # Libtool slay
        find $startdir/pkg -name "*.la" -exec rm {} \;

        # Install license (required for MIT licenses)
        install -d $startdir/pkg/usr/share/licenses/$pkgname
        install -m0644 LICENSE $startdir/pkg/usr/share/licenses/$pkgname/license.txt


    LVL 2

    Accepted Solution

    job-scheduler is still in an Alpha release if I am not mistaken so my immediate question is are you sure you want to use job-scheduler?  What are you trying to do?

    As for fixing it, I would say make modifications as necessary in the job-scheduler code (as it looks kind of abandoned - last release Dec 2004) rather than Zthread which is in a more stable 2005 release.  If you still want to proceed with code modifications let me know and I'll do my best to point you in the right direction.

    Otherwise, for job scheduling, in a unix-like environment, I strongly recommend the use of cron.  There is a good page on cron usage here:
    LVL 86

    Assisted Solution

    It seems that this line should be

    template <class LockType, class LockingPolicy>
    Guard<LockType, LockingPolicy>::~Guard() throw() {
      try {
      } catch (...) { /* ignore */ }  

    Open in new window


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
    Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
    The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
    The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now