Code sense not parsing std?

Discussion in 'Mac Programming' started by framebuffer, Nov 30, 2008.

  1. framebuffer macrumors newbie

    Joined:
    Nov 22, 2008
    #1
    Hi!

    I was testing Code sense to see how it compares with Visual Assist and I have run into a problem.

    In XCode 3.1, when I type std:: and then hit F5 it says no completing.

    But I created a little class to test and its working fine.

    How to make code sense parse external libraries?

    Even after creating a vector, like vector<int> coll;

    code sense is unable to show coll. F5

    It does not show any methods of a vector like push_back;


    What am I missing?
    Thanks.
     
  2. MacRumors Guy macrumors member

    Joined:
    Sep 17, 2008
  3. framebuffer thread starter macrumors newbie

    Joined:
    Nov 22, 2008
    #3
    Do you mean #include <vector>? Already did that.

    BTW Its working now!!! I dont know how. Just exited xcode and went to sleep. Got up, read your post and tried again and it worked!

    #include <iostream>
    #include <vector>

    using namespace std;

    class Test
    {
    public:
    void bar(int, int){ };

    int foo;
    };

    int main ()
    {
    // insert code here...
    std::cout << "Hello, World!\n"; //STD:: F5 NOT WORKING!

    Test foo;
    foo.foo = 5;
    foo.bar(6, 6);

    Test bar;
    bar.foo = 9;
    bar.bar(3, 7);

    vector<int> collection;
    collection.push_back(3);
    collection.push_back(5); //F5 WORKING!!!!

    return 0;
    }

    OR Do you mean including it in the include directories? How do u do that?

    Also std:: is not working.

    thanks,
    fb.
     
  4. MacRumors Guy macrumors member

    Joined:
    Sep 17, 2008
    #4
    That was exactly what I meant. :)

    Your are rigth std:: doesn't complete but "c + F5" has the cout completion.
     
  5. framebuffer thread starter macrumors newbie

    Joined:
    Nov 22, 2008
    #5
    Hi Macrumor guy!

    Thank you so much for the reply.

    Consider this:

    namespace mySpace
    {
    int foo;
    }

    int main ()
    {

    mySpace::



    return 0;
    }

    Can code sense complete namespaces? Neither std:: nor mySpace:: is getting completed.

    I tried restarting xcode too. I tried rebuilding the code sense database too.

    Also, I dont understand c+F5. I tried pressing C and then the f5 but it keeps printing ccccccc

    Thanks,
    fb.

    PS: simple pressing c without F5 is printing cout though.
     

Share This Page