Thursday, April 28, 2011

compiling zthreads

I downloaded zthreads (found here: http://zthread.sourceforge.net/) and tried to compile but I get this error from make:

MutexImpl.h:156: error: there are no arguments to 'ownerAcquired' that depend on a      template parameter, so a declaration of 'ownerAcquired' must be available

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

and then after that for every function in that source file I get this kind of error:

MutexImpl.h:167: error: there are no arguments to 'function' that depend on a template parameter, so a declaration of 'function' must be available

So I'm guessing it's a makefile error but I'm not for sure how to tell make to tell g++ to compile the files with -fpermissive. Does anyone know how to put that into the makefile (if that is the problem)?

From stackoverflow
  • CXXFLAGS += -fpermissive

    Gayan : Checked it out with our heavily customized build system. CXXFLAGS = -fpermissive $(CCFLAGS) $(INCLUDE_PATH) -D_PERF_TEST_ yielded g++ -m64 -fpermissive -ggdb -Wall -Wshadow -Wpointer-arith -Wcast-qual -m64 -D SUNOS -D INTEL -D _M64BIT_ -D _REENTRANT... CXXFLAGS += -fpermissive also worked
  • Standard gmake convention is to use the CXXFLAGS variable to pass options to the C++ compiler. You can take advantage of that fact as well as a feature called "command-line overrides" to get your extra flag tacked onto the flags passed to g++ by invoking gmake this way:

    make CXXFLAGS+=-fpermissive
    

    I downloaded the source myself to verify that this works and found that it does, although there are still a bunch of other warnings emitted. You may wish to log a bug for these issues if you intend to continue using the library.

    Hope this helps,

    Eric Melski

0 comments:

Post a Comment