3

I am new to development on Mac platforms and have recently started using Xcode for development in C++.

Now, whenever I want to look for definition of some class or struct, I click on Jump to definition in the secondary click menu, but Xcode shows up: Symbol not found. The indexing had been completed when I tried to look for definitions. Can anyone provide some solution to the problem?

The version of Xcode that I am using is 4.6 and MAC OS is 10.8.5. This is also happening on Xcode version 4.2 in OS X 10.7.5. Also, the file where I am trying to look for definition is in Objective-C.

bmike
  • 917
  • 2
  • 22
  • 41
Sankalp
  • 2,796
  • 3
  • 30
  • 43
  • I think code sense only works for Objective-C and Cand not C++, or at least not very well. – mmmmmm Sep 20 '13 at 11:09
  • Yes. The file in the project where I was trying to look for the definition is in `Objective-C` – Sankalp Sep 20 '13 at 13:02
  • 1
    Your question says Xcode for C++ - but your comment implies Objective C. If the latter we need to see more of thecode and what exactly failed – mmmmmm Sep 20 '13 at 14:58
  • Going to migrate this over to SO, the Q seems predominantly X-code based and isn't on topic for AD. Far more chance of an answer with the correct audience. –  Sep 24 '13 at 14:28
  • Also, refunding your Bounty, you can always re-add it if no-one answers over on SO. –  Sep 24 '13 at 14:29

2 Answers2

1

I am not sure if this was the root cause of your issue, but this write up helped me:

http://hiltmon.com/blog/2013/07/07/xcode-4-code-completion-for-external-build-projects/

The issues was with the external build project and you can fix it by "including" an additional target.

Tim Overly
  • 425
  • 4
  • 10
0

The answer to your problem is that Xcode isn't very good at this kind of thing yet. Sometimes it seems to work, sometimes it doesn't. It often doesn't work if there is an error in the same file, or if templates are involved (C++). Make sure the build process has completed (e.g. by running or trying to run the application.) And don't disable code sense in the preferences. ;)

digory doo
  • 1,978
  • 2
  • 23
  • 37