www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - New to GDC on ARM 32-bit Ubuntu

reply Cecil Ward <d cecilward.com> writes:
I am getting an error when I try and compile anything with the 
GDC compiler which is coming up associated with source code 
within a D include file which is not one of mine

I am using a Raspberry Pi with Ubuntu 16.04 and have just done an 
"apt-get install gdc". Using ldc works fine.

The error is :

/usr/include/d/core/stdc/config.d:58:3: error: static if 
conditional cannot be at global scope
    static if( (void*).sizeof > int.sizeof )
    ^


This file has
==
version(Windows)
     ...
else version( Posix )
{
   static if( (void*).sizeof > int.sizeof )
   {
     etc etc
==

It shows version
gdc --version
gdc (Ubuntu/Linaro 5.3.1-14ubuntu2) 5.3.1 20160413
Copyright (C) 2015 Free Software Foundation, Inc.

So that is unfortunately really old and I would love to get a new 
package
Jul 16 2018
parent Johannes Pfau <nospam example.com> writes:
Am Tue, 17 Jul 2018 04:51:04 +0000 schrieb Cecil Ward:

 I am getting an error when I try and compile anything with the GDC
 compiler which is coming up associated with source code within a D
 include file which is not one of mine
 
 I am using a Raspberry Pi with Ubuntu 16.04 and have just done an
 "apt-get install gdc". Using ldc works fine.
 
 The error is :

 /usr/include/d/core/stdc/config.d:58:3: error: static if conditional
 cannot be at global scope
     static if( (void*).sizeof > int.sizeof )
     ^
These files in /usr/include/d probably belong to the ldc package and therefore are not compatible with gdc. gdc automatically picks up files in /usr/include/d so this folder should not contain compiler-specific files. I think this has been fixed in more recent ubuntu releases. For now you could uninstall ldc to see if this is really the problem. -- Johannes
Jul 18 2018