Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: ‘nullptr’ was not declared in this scope #693

Open
nuxy opened this issue Nov 13, 2023 · 1 comment
Open

error: ‘nullptr’ was not declared in this scope #693

nuxy opened this issue Nov 13, 2023 · 1 comment

Comments

@nuxy
Copy link

nuxy commented Nov 13, 2023

Building this package on a Ubuntu 22.04 system results with the compilation error:

radiant/main.cpp: In function ‘int mainRadiant(int, char**)’:
radiant/main.cpp:500:25: error: ‘nullptr’ was not declared in this scope
  if ( xdg_state_home != nullptr ) {
                         ^
radiant/main.cpp:515:24: error: ‘nullptr’ was not declared in this scope
  if ( xdg_data_home != nullptr ) {
                        ^
radiant/main.cpp:403:21: warning: ignoring return value of ‘int seteuid(__uid_t)’, declared with attribute warn_unused_result [-Wunused-result]
  seteuid( getuid() );
                     ^
radiant/main.cpp:405:23: warning: ignoring return value of ‘int setuid(__uid_t)’, declared with attribute warn_unused_result [-Wunused-result]
   setuid( pw->pw_uid );
                       ^
radiant/main.cpp: In function ‘void RunBsp(char*)’:
radiant/main.cpp:1196:25: warning: ignoring return value of ‘int pipe(int*)’, declared with attribute warn_unused_result [-Wunused-result]
   pipe( process->pipes );
                         ^
scons: *** [build/release/radiant/radiant/main.o] Error 1
scons: building terminated because of errors.

This error can be overcome by applying the following config.py patch below:

--- config.py	2023-11-13 00:50:45.273801210 +0000
+++ config.py	2023-11-13 00:51:16.733927700 +0000
@@ -257,7 +257,7 @@
                 env.ParseConfig( 'pkg-config zlib --cflags --libs' )
 
         env.Append( CCFLAGS = baseflags )
-        env.Append( CXXFLAGS = baseflags + [ '-fpermissive', '-fvisibility-inlines-hidden' ] )
+        env.Append( CXXFLAGS = baseflags + [ '-fpermissive', '-fvisibility-inlines-hidden', '-std=c++11' ] )
         env.Append( CPPPATH = [ 'include', 'libs' ] )
         env.Append( CPPDEFINES = [ 'Q_NO_STLPORT' ] )
         if ( config == 'debug' ):

I have only tested my specific case, hence the reason for not submitting this as a PR

Hope this helps.

@MatiasRepetto
Copy link

Yeah, this is the way i resolved the issue too, adding c++11, sould be a rasonable PR i think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants