User forums > Using Code::Blocks
Code Completion only works for "::" ? (CB 8.02, Ubuntu 8.04)
chca:
Hello,
I want to use Code::Blocks 8.02 on Ubuntu 8.04 (64-bit) and installed the official .deb-file (http://www.codeblocks.org/downloads/5). When I create an "empty project", add a file "test.cpp" and type this code:
--- Code: ---struct Foo
{
int mNumber;
};
void main()
{
Foo f;
// my cursor is here ...
}
--- End code ---
"Foo::" will show a popup with "mNumber", but "f." won't. With "Foo* f" and "f->" it's just the same. When I use include files, classes, etc. code completion also only works with "::".
My code completion settings:
* "Disable code-completion" unchecked
* "Disable SmartSense" unchecked
* "Case sensitive matches" checked
* "Display info when hovering ..." checked
* "Auto-select, if only one match" unchecked
* "Automatically launch when ..." checked, number is "4"
* "Maximum allowed code-completion matches" 16384
* "Fillup characters" (empty)
* "Keyword sets to additionally include" 1+2 checked, 3-9 unchecked
* "Delay for auto-kick-in when typing [. :: ->]" 500 ms
I tested the example on a different PC using Ubuntu 7.10 (32-bit) with the same result.
Thanks for any advice.
chca
Ganbito:
I had the same problem a few days ago with autocompletion of the wxWidget clases. Searching throw this forum I have found the solution.
Code::Blocks has a Search path for autocompletion, so you have to add the path of your "test.cpp" to that Search path.
Where is it?
Go to menu Settings->Compiler and debugger... and in the opened window: Global compiler settings->Search directories->Linker.
Click the "Add" button to add the path of your "test.cpp" and it should work.
I have tried this before posting here on Code::Blocks 8.02 on Ubuntu 8.04 64 bits (the same as yours) and it works fine for me.
Barking_Mad:
also helps to hit ctrl-s for save, seems to update the auto-completion thingy.
chca:
@Ganbito: I can't imagine that Code::Blocks doesn't know where to find the files in the current project for parsing. And I doubt that it is useful to add a source path to the linker path list (do you mean "Project Properties -> C/C++ parser options -> Additional search paths"?). Nevertheless, I added "test.cpp" to both paths, but nothing changes.
@Barking_Mad: Saving does not work for me. Even not saving and restarting Code::Blocks.
The problem certainly is not that Code::Blocks doesn't find my symbols (due to bad path setup); the "::" operator shows a complete list of all members, so basically everything is parsed (even in wxwidgets projects, etc.). Just "." and "->" do not show the member list.
Ganbito:
@chca: Like you, I can't image that, but I have tested that it works in that way.
Well, that you write "Project Properties -> C/C++ parser options -> Additional search paths" seems more apropiated for files within a project, but when I wrote I only remember global properties.
I meant path where "test.cpp" is found, not "test.cpp" itself, but when I wish to try that (during the writing of this post) it get working in the right way even without adding the related path to the Search path (even global or project settings) so I have no idea, but now it works as it was thinked to work. I deleted the previous global search path, started a new project and changed the struct name (struct Glass...) but it continued to work, so I don't know. :?
Sorry, but I can't try to help you anymore.
Navigation
[0] Message Index
[#] Next page
Go to full version