Link to home
Start Free TrialLog in
Avatar of IT79637
IT79637Flag for United States of America

asked on

How to fix C++ depreciated isDisabled()

I downloaded source code for project "job-scheduler" from SourceForge.net (http://sourceforge.net/projects/job-scheduler).  When I ran the "configure", a message indicated I had to install ZThread-2.3.2 from SourceForge (http://sourceforge.net/projects/zthread/).  

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
 
 
Guard.h
--------
bool isDisabled() {
  return !_enabled;
}
 
 
 
template <class LockType, class LockingPolicy>
Guard<LockType, LockingPolicy>::~Guard() throw() {
    
  try {
    
    if(!isDisabled())
      LockingPolicy::destroyScope(*this);
    
  } catch (...) { /* ignore */ }  
  
}

Open in new window

Avatar of IT79637
IT79637
Flag of United States of America image

ASKER

Avatar of IT79637

ASKER

More info.  Can anything be done with this:
http://aur.archlinux.org/packages/zthread/zthread/PKGBUILD


# Contributor: Travis Willard <travisw@wmpub.ca>

pkgname=zthread
pkgver=2.3.2
pkgrel=1
pkgdesc="A platform-independent, multi-threading and synchronization library for C++"
url="http://zthread.sourceforge.net"
license="MIT"
depends=(gcc)
makedepends=()
conflicts=()
source=(http://dl.sourceforge.net/zthread/ZThread-$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

}

ASKER CERTIFIED SOLUTION
Avatar of aaronblum
aaronblum
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial