News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

code completion with multiple files

Started by joof, July 31, 2009, 01:55:34 PM

Previous topic - Next topic

joof

Hi,

The code completion doesn't work when using multiple files i.e. declaration and implementation are in the different files. I tried to look the answer from settings and from web but didn't found. More datailed description is below. I'm using Code::Blocks 8.02 Build:Fed 27 2008, 20:59:09 on Windows XP.


The code completion works fine when I have only on file. When I write inside the main function 'foo.' (without quotes) the completion list appears saying 'MemberFunction'.

main.cpp

#include <iostream>

using namespace std;

class Foo
{
public:
    void MemberFunction(void)
};

void Foo::MemberFunction(void)
{
   
}

int main()
{
    Foo foo;
   
    //testing code completion here
   
   
    return 0;
}



But when I split the code into three files (and add them to the project) the completion doesn't work anymore. When I now write inside the main function 'foo.' nothing happens. Also the symbols list is not showing anymore the Foo class.

main.cpp

#include <iostream>
#include "Foo.hpp"

using namespace std;

int main()
{
    Foo foo;
   
    //testing code completion here
   
   
    return 0;
}


Foo.hpp

class Foo
{
public:
    void MemberFunction(void);
};


Foo.cpp

#include "Foo.hpp"

void Foo::MemberFunction(void)
{
   
}



How can I make this to work? Thanks.

oBFusCATed

There is a separate branch in svn with vastly improved code completion, there is your only hope :)
You could try a nightly build if you don't want to build one yourself
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Jenna

Quote from: oBFusCATed on July 31, 2009, 02:21:41 PM
There is a separate branch in svn with vastly improved code completion, there is your only hope :)
You could try a nightly build if you don't want to build one yourself

The nightly builds do not use the cc-branch.

Nevertheless it works here with actual trunk.

Did you save your files, before trying code-completion ?

joof

Sorry this was a false alarm, now it is working. I knew this should be a trivial case. When I made the above example project and re-opened my real project symbol browser showed all the classes from all project files and the code completion worked as assumed.  :D I guess the workspace and/or the project files must be saved before symbols from new files are included.


Many thanks to the developers this is a great program!

joof

Quote from: jens on July 31, 2009, 02:30:47 PM
Did you save your files, before trying code-completion ?

I did save the actual code files but not the project and workspace files.