robotology / yarp

YARP - Yet Another Robot Platform
http://www.yarp.it
Other
525 stars 195 forks source link

Compiling error with YARP_USE_GTK2 on OsX #598

Closed iron76 closed 9 years ago

iron76 commented 9 years ago

I am getting the following error.

In file included from /Users/iron/Code/yarp/src/yarpscope-gtk/src/Debug.cpp:9:
In file included from /Users/iron/Code/yarp/src/yarpscope-gtk/src/Debug.h:15:
/usr/local/include/glibmm-2.4/glibmm/ustring.h:267:13: error: expected ';' at end of declaration list
  ~ustring() noexcept;

The error can be removed by setting YARP_USE_GTK2, YARP_USE_GTKDATABOX and YARP_USE_GTKDATABOXMM to OFF.

drdanz commented 9 years ago

Recent gtkmm versions require c++11 enabled. Can you try recompiling using cmake -DCMAKE_CXX_FLAGS=-std=c++11?

iron76 commented 9 years ago

Then I get another error :laughing:

[omissis]/yarp/src/libYARP_OS/src/BottleImpl.cpp:645:28: error: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wreserved-user-defined-literal]
    ACE_OS::sprintf(buf,"%"YARP_INT64_FMT,x);
drdanz commented 9 years ago

Can you update and try again? I just fixed this and a few other issues with c++11 enabled... Also instead of changing CMAKE_CXX_FLAGS you can try enabling the YARP_EXPERIMENTAL_CXX1 option

iron76 commented 9 years ago

New error:

[omissis]/yarp/src/libYARP_sig/src/IplImage.cpp:258:14: error: case value
      evaluates to 2147483656, which cannot be narrowed to type 'int'
      [-Wc++11-narrowing]
        case IPL_DEPTH_8S:
drdanz commented 9 years ago

Ok, this one should also be fixed now... what's next? :stuck_out_tongue_closed_eyes: Perhaps it would be faster if we do it together...

iron76 commented 9 years ago

No need to do it together because it finally works :+1: Thanks!

drdanz commented 9 years ago

Cool :sunglasses:

I'm not closing this yet, because we should have a check on the gtk/sigc++ version and eventually enable c++11 only when required and only for the guis that actually require it.

traversaro commented 9 years ago

New remainder : revert robotology/codyco-superbuild@66ffa56 when this bug is fixed .

DanielePucci commented 9 years ago

Hi guys, I've just joined the group of OsX friends, and it seems to me that I have I similar problem, probably the same. The output of the compilation is the following:

screenshot 2015-10-29 11 23 22
DanielePucci commented 9 years ago

Sorry guys, I did not enable the flag YARP_EXPERIMENTAL_CXX1. It works now!

drdanz commented 9 years ago

@DanielePucci @traversaro @iron76 @francesco-romano enabling YARP_EXPERIMENTAL_CXX11 and/or c++11 should no longer be required, please reopen if for some reason it is still broken.