User forums > Using Code::Blocks
code completion with multiple files
(1/1)
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
--- Code: ---#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;
}
--- End code ---
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
--- Code: ---#include <iostream>
#include "Foo.hpp"
using namespace std;
int main()
{
Foo foo;
//testing code completion here
return 0;
}
--- End code ---
Foo.hpp
--- Code: ---class Foo
{
public:
void MemberFunction(void);
};
--- End code ---
Foo.cpp
--- Code: ---#include "Foo.hpp"
void Foo::MemberFunction(void)
{
}
--- End code ---
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
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
--- End quote ---
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 ?
--- End quote ---
I did save the actual code files but not the project and workspace files.
Navigation
[0] Message Index
Go to full version