Raised This Month: $32 Target: $400
 8% 

static_assert errors when compiling stub_mm


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
shortguy
Member
Join Date: Jul 2009
Old 08-02-2015 , 02:56   static_assert errors when compiling stub_mm
Reply With Quote #1

Hi there,

I've been trying to compile the stub_mm included with the metamod source files but I can't seem to get around errors relating to static_assert

Code:
In file included from ../core/sourcehook/sourcehook.h:118:0,
                 from ../core/ISmmPlugin.h:37,
                 from stub_mm.h:18,
                 from stub_mm.cpp:16:
../core/sourcehook/FastDelegate.h:181:2: error: identifier ‘static_assert’ is a keyword in C++11 [-Werror=c++0x-compat]
  static_assert(sizeof(InputClass)==sizeof(u) && sizeof(InputClass)==sizeof(Outp
  ^
In file included from ../core/sourcehook/sourcehook.h:118:0,
                 from ../core/ISmmPlugin.h:37,
                 from stub_mm.h:18,
                 from stub_mm.cpp:16:
../core/sourcehook/FastDelegate.h: In function ‘OutputClass fastdelegate::detail::horrible_cast(InputClass)’:
../core/sourcehook/FastDelegate.h:182:29: error: there are no arguments to ‘static_assert’ that depend on a template parameter, so a declaration of ‘static_assert’ must be available [-fpermissive]
    "Can't use horrible cast");
                             ^
../core/sourcehook/FastDelegate.h:182:29: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
../core/sourcehook/FastDelegate.h: In static member function ‘static fastdelegate::detail::GenericClass* fastdelegate::detail::SimplifyMemFunc<N>::Convert(X*, XFuncType, GenericMemFuncType&)’:
../core/sourcehook/FastDelegate.h:297:82: error: there are no arguments to ‘static_assert’ that depend on a template parameter, so a declaration of ‘static_assert’ must be available [-fpermissive]
 atic_assert(N >= 100, "Unsupported memeber function pointer on this compiler")
Code:
../core/sourcehook/FastDelegate.h:799:16: error: ‘static_assert’ was not declared in this scope
   static_assert(sizeof(UnvoidStaticFuncPtr)==sizeof(this), "Can't use evil meth
Anyone have any ideas why this would happen? I thought static_assert is a part of c++1X, why would it give me errors that its not declared in the scope.

I have tried using GCC4.1, GCC4.8 and GCC5.2.

Any ideas?
shortguy is offline
asherkin
SourceMod Developer
Join Date: Aug 2009
Location: OnGameFrame()
Old 08-02-2015 , 05:16   Re: static_assert errors when compiling stub_mm
Reply With Quote #2

The Makefile you are using to compile it is not up to date and does not include the required --std=c++11 flag.
__________________
asherkin is offline
shortguy
Member
Join Date: Jul 2009
Old 08-02-2015 , 06:32   Re: static_assert errors when compiling stub_mm
Reply With Quote #3

Wow that makes me feel dumb. I should have checked that it actually used c++11 before wondering that.

Should I submit a PR to get this flag merged into the sample projects in the metamod repo?
shortguy is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:10.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode