Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XCode 4 Autocomplete with C++ library?

I am using Cocos2D Box2D template for my project.

When I type , "b2**" the autocomplete doesnt show any Box2D classes. (pressing ESC also doesnt show any ) I have included Box2D.h and Cocos2d.h in "Prefix.pch" file.

Is there any feature like "rebuild index" in "Eclipse CDT" ?

Any tips?

like image 851
Ashika Umanga Umagiliya Avatar asked Dec 10 '22 06:12

Ashika Umanga Umagiliya


2 Answers

You can force Xcode to rebuild index by deleting it's service folder (DerivedData for Xcode 4.x):

  1. Close Xcode
  2. Remove service folder
  3. Open your project and Xcode will rebuild index again

In my case this always works and I can call b2... autosuggest.

The DerivedData folder can be found in ~/Library/Developer/Xcode/DerivedData

like image 113
Serhii Mamontov Avatar answered Jan 01 '23 20:01

Serhii Mamontov


This may be an obvious suggestion, but have you tried to type out a class that you know exists with what you have included, and see if it recognizes it(With both colorization and/or quick help)? Also, do you have the necessary frameworks included, etc? As far as reloading goes, the only thing that you can do in XCode that I know of is clean(shift+cmd+k) and re-build. Are you getting any sort of warnings, errors, etc? Another potentially obvious issue, is XCode set to c++ as the language? Anyways hopefully you haven't already tried all of this and it helps you get somewhere.

like image 33
Karoly S Avatar answered Jan 01 '23 21:01

Karoly S