Raised This Month: $51 Target: $400
 12% 

error: ‘nullptr’


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 04-25-2015 , 18:24   error: ‘nullptr’
Reply With Quote #1

How can I fix this?

Code:
In file included from ../sourcemod/public/IShareSys.h:41:0,
                 from ../sourcemod/public/IExtensionSys.h:35,
                 from sdk/smsdk_ext.h:41,
                 from sdk/smsdk_ext.cpp:34:
../sourcemod/sourcepawn/include/sp_vm_api.h:256:3: error: identifier ‘nullptr’ is a keyword in C++11 [-Werror=c++0x-compat]
   virtual bool Invoke(cell_t *rval = nullptr) = 0;

In file included from ../sourcemod/public/IShareSys.h:41:0,
                 from ../sourcemod/public/IExtensionSys.h:35,
                 from sdk/smsdk_ext.h:41,
                 from sdk/smsdk_ext.cpp:34:
../sourcemod/sourcepawn/include/sp_vm_api.h:256:38: error: ‘nullptr’ was not declared in this scope
   virtual bool Invoke(cell_t *rval = nullptr) = 0;
                                      ^
cc1plus: all warnings being treated as errors
__________________
Spirit_12 is online now
Malak101
Member
Join Date: May 2009
Old 04-25-2015 , 19:14   Re: error: ‘nullptr’
Reply With Quote #2

Quote:
Originally Posted by Spirit_12 View Post
How can I fix this?

Code:
In file included from ../sourcemod/public/IShareSys.h:41:0,
                 from ../sourcemod/public/IExtensionSys.h:35,
                 from sdk/smsdk_ext.h:41,
                 from sdk/smsdk_ext.cpp:34:
../sourcemod/sourcepawn/include/sp_vm_api.h:256:3: error: identifier ‘nullptr’ is a keyword in C++11 [-Werror=c++0x-compat]
   virtual bool Invoke(cell_t *rval = nullptr) = 0;

In file included from ../sourcemod/public/IShareSys.h:41:0,
                 from ../sourcemod/public/IExtensionSys.h:35,
                 from sdk/smsdk_ext.h:41,
                 from sdk/smsdk_ext.cpp:34:
../sourcemod/sourcepawn/include/sp_vm_api.h:256:38: error: ‘nullptr’ was not declared in this scope
   virtual bool Invoke(cell_t *rval = nullptr) = 0;
                                      ^
cc1plus: all warnings being treated as errors
You need to use a newer compiler that supports "C++11". I personally use gcc 4.7.2 for cases like this. You can download my ready-to-install bz2 if you want to save yourself hunting down the install prerequisites.

https://dl-web.dropbox.com/get/Sent%...hxec73bhQ&dl=1

Let me know if you need instructions on how to set it up as a separate compiler to use at your whim.

Last edited by Malak101; 04-25-2015 at 19:16.
Malak101 is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 04-25-2015 , 19:32   Re: error: ‘nullptr’
Reply With Quote #3

Don't think my compiler is old at all.

Code:
gcc version 4.9.2 (Ubuntu 4.9.2-10ubuntu13)
__________________
Spirit_12 is online now
Malak101
Member
Join Date: May 2009
Old 04-25-2015 , 19:44   Re: error: ‘nullptr’
Reply With Quote #4

Quote:
Originally Posted by Spirit_12 View Post
Don't think my compiler is old at all.

Code:
gcc version 4.9.2 (Ubuntu 4.9.2-10ubuntu13)
The only other thing I can think of is you need to add "-std=c++11" (no "") to your CPPFLAGS in the Makefile.

Last edited by Malak101; 04-25-2015 at 19:55.
Malak101 is offline
Spirit_12
Veteran Member
Join Date: Dec 2012
Location: Toronto, CA
Old 04-25-2015 , 20:03   Re: error: ‘nullptr’
Reply With Quote #5

Quote:
Originally Posted by Malak101 View Post
The only other thing I can think of is you need to add "-std=c++11" (no "") to your CPPFLAGS in the Makefile.
That did the trick for me.

Thanks a lot.
__________________
Spirit_12 is online now
Reply



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 08:49.


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