ISO C++ does not support 'long long'

Kevin D. Clark kevin_d_clark at comcast.net
Fri Feb 29 18:25:33 EST 2008


jesse lazar writes:

> When I run the script to build and install the QCAD application I get 
> the following error:
> 
> 
> make[2]: Entering directory 
> `/usr/share/qcad/qcad-2.0.5.0-1-community.src/qcadlib/src'
> g++ -c -pipe -pedantic -Wall -W -O2  -DRS_NO_COMPLEX_ENTITIES 
> -DQT_NO_DEBUG -DQT_SHARED -I/usr/share/qt3/mkspecs/linux-g++ -I. 
> -I../include -I../../dxflib/include -I../../fparser/include 
> -I../../qcadcmd/include -I../../../../../include/qt3 -Imoc/ -o 
> obj/rs_actioninterface.o actions/rs_actioninterface.cpp
> Assembler messages:
> FATAL: can't create obj/rs_actioninterface.oIn file included from 
> ../../../../../include/qt3/qobjectdefs.h:42,
>                  from ../../../../../include/qt3/qobject.h:42,
>                  from actions/rs_actioninterface.h:31,
>                  from actions/rs_actioninterface.cpp:28:
> ../../../../../include/qt3/qglobal.h:712: error: ISO C++ does not 
> support `long 
>    long'
> ../../../../../include/qt3/qglobal.h:713: error: ISO C++ does not 
> support `long 
>    long'

The problem in this case is that whoever put together "the QCAD
application" was a very careful programmer.  This is generally a
Fantastically Good Thing.

However, in this case the invocation of g++ includes the parameter
"-pedantic", and this causes the compiler to be (arguably) overly
strict.  This is the thing that is causing your build to fail.

You can see this pretty clearly in this example:

   $ cat longlong.cc
   
   int main(int argc, char *argv[])
   {
     long long ll = 0;
     return ll;
   }
   
   $ g++ longlong.cc
   
  [it worked!]
   
   $ g++ -pedantic -Wall -W -O2 longlong.cc
   longlong.cc:4: error: ISO C++ does not support 'long long'
   
  [it died!]
   
   $ g++ -pedantic -Wall -W -O2 -Wno-long-long longlong.cc
   
  [it works!]
   
   $

With this example, I can suggest two solutions:

1:  add "-Wno-long-long" to your compiler invocation
       (rationale:  maybe the rest of the code will compile just fine
                    with this small bit of help)

2:  remove "-pedantic" entirely from your compiler invocation.
       (rationale:   you're already compiling with -W (which is
       -Wextra nowadays) and -Wall.  This means that you're already
       configuring the compiler to be somewhat picky.  Adding
       "-pedantic" probably isn't buying you very much, and is
       obviously not working either.


In general, a package that can compile with many warnings turned on is
a good sign.

Regards,

--kevin
-- 
GnuPG ID: B280F24E             Don't you know there ain't no devil,
alumni.unh.edu!kdc             there's just God when he's drunk?
                                 -- Tom Waits


More information about the gnhlug-discuss mailing list