0

I just installed a fresh installation of Eclipse Mars.2 on OSx 10.8.5, and I'm having trouble using smart pointers (share_ptr, unique_ptr, etc). The IDE shows a red underline, and when I try to compile it I get error: use of undeclared identifier 'shared_ptr'.

I have

  • included <memory> (which gets removed by Eclipse's "Organize includes" btw)

  • added the symbol __GXX_EXPERIMENTAL_CXX0X__

  • added the symbol __cplusplus with the value 201103L

  • changed Cross G++ Compiler / Dialect / Language Standard to -std=c++0x

  • added -std=c++11 to Cross G++ Compiler / Miscellaneous / Other flags

  • selected CDT User Setting Entries and CDT Cross Built-in compiler settings in Providers

  • enabled the indexer

  • tried fiddling around with just about any setting imaginable

And it still doesn't work.

I can use shared_ptr without any problems in both XCode and when compiling with g++ in the terminal. Also, I can use auto in Eclipse without any problems. So what's the problem with those smart pointers?

g++ --version reports g++ (MacPorts gcc48 4.8.4_0+universal) 4.8.4, in case that could have anything to do with anything?

I'm all out of ideas on this one, anyone have any suggestions?

Magnus
  • 17,157
  • 19
  • 104
  • 189
  • Why are you using this old legacy bunch of you-know-what? Eclipse is sooooo 2008... – SergeyA Mar 18 '16 at 20:33
  • 1
    Sounds like you prolly tried this but: https://stackoverflow.com/questions/17131744/eclipse-cdt-indexer-does-not-know-c11-containers/24628885#24628885 – Galik Mar 18 '16 at 20:37
  • @SergeyA What do you suggest I use then? I've been using XCode the past couple of years for C++, and it's just as much a "bunch of you-know-what" s Eclipse, if not more. I have used Eclipse for 4+ years for Java and I actually enjoy it way more than XCode. So what would you recommend? – Magnus Mar 18 '16 at 20:51
  • @Galik Thanks, but I've already been there and done that (literally). Have tried stuff from like 10 different SO-questions, some blogs, and other random sources. Nothing works. – Magnus Mar 18 '16 at 20:53
  • @BadCash, I would suggest CLion. – SergeyA Mar 18 '16 at 21:10
  • 1
    Choosing the Cross Compiler toolchain is probably the wrong setting to begin with. Try to change the toolchain to the native Mac OS X. – Silvano Brugnoni Mar 28 '16 at 09:46

0 Answers0