0

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)?

3 Answers3

3

CXXFLAGS += -fpermissive

Gayan
  • 1,697
  • 7
  • 26
  • 35
  • I get the same error from g++ with that. In fact with that line I don't even see -fpermissive when make is displaying the opts g++ is using. –  Apr 07 '09 at 05:59
  • 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 – Gayan Apr 07 '09 at 07:23
2

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

Eric Melski
  • 16,432
  • 3
  • 38
  • 52
1

I got rid of all these errors changing the code: for each line with that mistake, add this-> to the function that provokes the error. In the line you quote:

ownerAcquired must be changed by this->ownerAcquired

I hope this helps

eargones
  • 11
  • 1