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:
struct Foo
{
int mNumber;
};
void main()
{
Foo f;
// my cursor is here ...
}
"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
Of course, I added the path and not the file; sorry for my inaccurate statement.
I've build Code::Blocks from source, but the same problem again.
Very interesting: With global variables, "." and "->" work fine (local variables in functions and member variables in classes don't work):
struct Foo
{
int mNumber;
};
Foo f1;
int main()
{
Foo f2;
// cursor is here
return 0;
}
struct Foo
{
int mNumber;
};
Foo f1;
class A
{
private:
Foo f2;
public:
void test();
};
void A::test()
{
// cursor is here
}
So "f1." will show the list, but "f2." won't. Very strange.
Something that I've found to work when creating a new project is to save everything then close codeblocks, and then when the project is reopened in codeblocks the code completion works. I didn't modify anything as suggested above. F1 and F2 still do nothing but after typing 4 characters the code completion kicks in the same way it does when using windows.
Starting it with a command prompt and try to complete code -- I also pushed f1 and f2 which created the following output but upon reopening everything seems to work correctly. When F2 was pressed it crashed.
WHEN IT DIDNT WORK
yourusername@yourmachinename:~$ codeblocks
Initialize EditColourSet .....
Initialize EditColourSet: done.
Loading toolbar...
Exporter: loaded
ToDoList: loaded
HelpPlugin: loaded
ProjectsImporter: loaded
SymTab: loaded
BYOGames: loaded
CodeStat: loaded
AStylePlugin: loaded
wxSmithContribItems: loaded
EnvVars: loaded
OpenFilesList: loaded
CB_Koders: loaded
Profiler: loaded
wxSmith: loaded
wxSmithMime: loaded
ClassWizard: loaded
Autosave: loaded
ThreadSearch: loaded
CodeCompletion: loaded
ScriptedWizard: loaded
cbKeyBinder: loaded
AutoVersioning: loaded
BrowseTracker: loaded
RegExTestbed: loaded
Compiler: loaded
cbDragScroll: loaded
Debugger: loaded
lib_finder: loaded
CodeSnippets: loaded
FilesExtensionHandler: loaded
Source Exporter plugin activated
To-Do List plugin activated
Help plugin plugin activated
Foreign projects importer plugin activated
Symbol Table Plugin plugin activated
BYO Games plugin activated
Code statistics plugin activated
Source code formatter (AStyle) plugin activated
wxSmith - Contrib Items plugin activated
Environment variables plugin activated
Open files list plugin activated
Koders query plugin activated
Code profiler plugin activated
wxSmith plugin activated
wxSmith - MIME plugin plugin activated
Class wizard plugin activated
Autosave plugin activated
ThreadSearch plugin activated
Code completion plugin activated
Project wizard added for 'Empty project'
Project wizard added for 'Console application'
Project wizard added for 'D application'
Project wizard added for 'FLTK project'
Project wizard added for 'GLFW project'
Project wizard added for 'GLUT project'
Project wizard added for 'GTK+ project'
Project wizard added for 'Irrlicht project'
Project wizard added for 'Lightfeather project'
Project wizard added for 'OpenGL project'
Project wizard added for 'Ogre project'
Project wizard added for 'Code::Blocks plugin'
Project wizard added for 'QT4 project'
Project wizard added for 'SDL project'
Project wizard added for 'Static library'
Project wizard added for 'Shared library'
Project wizard added for 'AVR Project'
Project wizard added for 'wxWidgets project'
Build-target wizard added for 'Console'
Build-target wizard added for 'Static library'
Build-target wizard added for 'wxWidgets'
File(s) wizard added for 'Empty file'
File(s) wizard added for 'C/C++ source'
File(s) wizard added for 'C/C++ header'
Scripted wizard plugin activated
Keyboard shortcuts plugin activated
AutoVersioning plugin activated
BrowseTracker plugin activated
Regular expressions testbed plugin activated
Added compiler "GNU GCC Compiler"
Parsing stage done (0 total parsed files, 0 tokens in 0 minute(s), 0.0 seconds).
Updating class browser...
Class browser updated.
Added compiler "Intel C/C++ Compiler"
Added compiler "SDCC Compiler"
Added compiler "Tiny C Compiler"
Added compiler "GDC D Compiler"
Added compiler "Digital Mars D Compiler"
Added compiler "GNU ARM GCC Compiler"
Added compiler "GNU AVR GCC Compiler"
Added compiler "GNU GCC Compiler for PowerPC"
Added compiler "GNU GCC Compiler for TriCore"
Compiler plugin activated
DragScroll plugin activated
Debugger plugin activated
Library finder plugin activated
Code snippets plugin activated
Files extension handler plugin activated
Initializing plugins...
KeyBinder failed UpdateById on[691][CR & LF]
KeyBinder failed UpdateById on[1950][Debugging]
KeyBinder failed UpdateById on[195][Edit file types & categories...]
Add project test in parsing queue
Caching internal gcc dirs for adding to parser...
Caching GCC dir: /usr/include/c++/4.2
Caching GCC dir: /usr/include/c++/4.2/i486-linux-gnu
Caching GCC dir: /usr/include/c++/4.2/backward
Caching GCC dir: /usr/local/include
Caching GCC dir: /usr/lib/gcc/i486-linux-gnu/4.2.3/include
Caching GCC dir: /usr/include
Generated file /home/yourusername/A_CB_TEST/test/testApp.h
Project's base path: /home/yourusername/A_CB_TEST/test/
Project's common toplevel path: /home/yourusername/A_CB_TEST/test/
Generated file /home/yourusername/A_CB_TEST/test/testApp.cpp
Generated file /home/yourusername/A_CB_TEST/test/testMain.h
Generated file /home/yourusername/A_CB_TEST/test/testMain.cpp
Generated file /home/yourusername/A_CB_TEST/test/wxsmith/testdialog.wxs
found /home/yourusername/A_CB_TEST/test/testMain.cpp
Reparsing saved files...
Starting batch parsing
Parsing stage done (6 total parsed files, 22 tokens in 0 minute(s), 0.65 seconds).
Updating class browser...
Class browser updated.
Reparsing saved files...
Starting batch parsing
Parsing stage done (6 total parsed files, 21 tokens in 0 minute(s), 0.7 seconds).
Updating class browser...
Class browser updated.
*** glibc detected *** codeblocks: corrupted double-linked list: 0x09291840 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6[0xb686c0cd]
/lib/tls/i686/cmov/libc.so.6[0xb686dedd]
/lib/tls/i686/cmov/libc.so.6[0xb686f55a]
/lib/tls/i686/cmov/libc.so.6(realloc+0x10b)[0xb687175b]
/usr/lib/libfontconfig.so.1[0xb798d03c]
/usr/lib/libfontconfig.so.1[0xb798d331]
/usr/lib/libfontconfig.so.1[0xb798d375]
/usr/lib/libfontconfig.so.1[0xb798de77]
/usr/lib/libfontconfig.so.1(FcFontSetSort+0x480)[0xb7996280]
/usr/lib/libfontconfig.so.1(FcFontSort+0x58)[0xb7996488]
/usr/lib/libpangoft2-1.0.so.0[0xb67dcf26]
/usr/lib/libpango-1.0.so.0(pango_font_map_load_fontset+0x50)[0xb7aab3f0]
/usr/lib/libpango-1.0.so.0[0xb7aa91f7]
/usr/lib/libpango-1.0.so.0(pango_itemize_with_base_dir+0x8d)[0xb7aa95dd]
/usr/lib/libpango-1.0.so.0[0xb7ab26a0]
/usr/lib/libpango-1.0.so.0[0xb7ab3a6d]
/usr/lib/libgtk-x11-2.0.so.0[0xb7cf718a]
/usr/lib/libwx_gtk2u_core-2.8.so.0(_ZNK12wxStaticText13DoGetBestSizeEv+0x78)[0xb6df4c48]
/usr/lib/libwx_gtk2u_core-2.8.so.0(_ZNK12wxWindowBase19GetEffectiveMinSizeEv+0x92)[0xb6e953a2]
/usr/lib/libwx_gtk2u_core-2.8.so.0(_ZN11wxSizerItem7CalcMinEv+0x62)[0xb6e81bd2]
/usr/lib/libwx_gtk2u_core-2.8.so.0(_ZN10wxBoxSizer7CalcMinEv+0x9d)[0xb6e812dd]
/usr/lib/libwx_gtk2u_core-2.8.so.0(_ZN7wxSizer10GetMinSizeEv+0x1e)[0xb6e8005e]
/usr/lib/libwx_gtk2u_core-2.8.so.0(_ZN7wxSizer16GetMinWindowSizeEP8wxWindow+0x2c)[0xb6e82e6c]
/usr/lib/libwx_gtk2u_core-2.8.so.0(_ZN7wxSizer3FitEP8wxWindow+0x2d)[0xb6e82f1d]
/usr/lib/libwx_gtk2u_xrc-2.8.so.0(_ZN17wxSizerXmlHandler12Handle_sizerEv+0x391)[0xb7196f51]
/usr/lib/libwx_gtk2u_xrc-2.8.so.0(_ZN17wxSizerXmlHandler16DoCreateResourceEv+0x7a)[0xb719701a]
/usr/lib/libwx_gtk2u_xrc-2.8.so.0(_ZN20wxXmlResourceHandler14CreateResourceEP9wxXmlNodeP8wxObjectS3_+0x1b5)[0xb71b1815]
/usr/lib/libwx_gtk2u_xrc-2.8.so.0(_ZN13wxXmlResource17CreateResFromNodeEP9wxXmlNodeP8wxObjectS3_P20wxXmlResourceHandler+0x470)[0xb71b69d0]
/usr/lib/libwx_gtk2u_xrc-2.8.so.0(_ZN20wxXmlResourceHandler14CreateChildrenEP8wxObjectb+0x137)[0xb71b6d47]
/usr/lib/libwx_gtk2u_xrc-2.8.so.0(_ZN18wxDialogXmlHandler16DoCreateResourceEv+0x499)[0xb71751f9]
/usr/lib/libwx_gtk2u_xrc-2.8.so.0(_ZN20wxXmlResourceHandler14CreateResourceEP9wxXmlNodeP8wxObjectS3_+0x1b5)[0xb71b1815]
/usr/lib/libwx_gtk2u_xrc-2.8.so.0(_ZN13wxXmlResource17CreateResFromNodeEP9wxXmlNodeP8wxObjectS3_P20wxXmlResourceHandler+0x470)[0xb71b69d0]
/usr/lib/libwx_gtk2u_xrc-2.8.so.0(_ZN13wxXmlResource10LoadDialogEP8wxDialogP8wxWindowRK8wxString+0x83)[0xb71b80c3]
codeblocks[0x807327a]
codeblocks(_ZN9MainFrame26OnSettingsCompilerDebuggerER14wxCommandEvent+0x32)[0x80864f2]
/usr/lib/libwx_baseu-2.8.so.0(_ZNK12wxAppConsole11HandleEventEP12wxEvtHandlerMS0_FvR7wxEventES3_+0x41)[0xb6ad60e1]
/usr/lib/libwx_baseu-2.8.so.0(_ZN12wxEvtHandler21ProcessEventIfMatchesERK21wxEventTableEntryBasePS_R7wxEvent+0x88)[0xb6b7db88]
/usr/lib/libwx_baseu-2.8.so.0(_ZN16wxEventHashTable11HandleEventER7wxEventP12wxEvtHandler+0x78)[0xb6b7dce8]
/usr/lib/libwx_baseu-2.8.so.0(_ZN12wxEvtHandler12ProcessEventER7wxEvent+0xbf)[0xb6b7de4f]
/usr/lib/libwx_baseu-2.8.so.0(_ZN12wxEvtHandler12ProcessEventER7wxEvent+0x6b)[0xb6b7ddfb]
/usr/lib/libwx_baseu-2.8.so.0(_ZN12wxEvtHandler12ProcessEventER7wxEvent+0x6b)[0xb6b7ddfb]
/usr/lib/libwx_baseu-2.8.so.0(_ZN12wxEvtHandler12ProcessEventER7wxEvent+0x6b)[0xb6b7ddfb]
/usr/lib/libwx_baseu-2.8.so.0(_ZN12wxEvtHandler12ProcessEventER7wxEvent+0x6b)[0xb6b7ddfb]
/usr/lib/libwx_baseu-2.8.so.0(_ZN12wxEvtHandler12ProcessEventER7wxEvent+0x6b)[0xb6b7ddfb]
/usr/lib/libwx_baseu-2.8.so.0(_ZN12wxEvtHandler12ProcessEventER7wxEvent+0x6b)[0xb6b7ddfb]
/usr/lib/libwx_baseu-2.8.so.0(_ZN12wxEvtHandler12ProcessEventER7wxEvent+0x6b)[0xb6b7ddfb]
/usr/lib/libwx_baseu-2.8.so.0(_ZN12wxEvtHandler12ProcessEventER7wxEvent+0x6b)[0xb6b7ddfb]
/usr/lib/libwx_baseu-2.8.so.0(_ZN12wxEvtHandler12ProcessEventER7wxEvent+0x6b)[0xb6b7ddfb]
/usr/lib/libwx_baseu-2.8.so.0(_ZN12wxEvtHandler12ProcessEventER7wxEvent+0x6b)[0xb6b7ddfb]
/usr/lib/libwx_baseu-2.8.so.0(_ZN12wxEvtHandler12ProcessEventER7wxEvent+0x6b)[0xb6b7ddfb]
/usr/lib/libwx_baseu-2.8.so.0(_ZN12wxEvtHandler12ProAborted
WHEN IT DID WORK
yourusername@yourmachinename:~$ codeblocks
Initialize EditColourSet .....
Initialize EditColourSet: done.
Loading toolbar...
Exporter: loaded
ToDoList: loaded
HelpPlugin: loaded
ProjectsImporter: loaded
SymTab: loaded
BYOGames: loaded
CodeStat: loaded
AStylePlugin: loaded
wxSmithContribItems: loaded
EnvVars: loaded
OpenFilesList: loaded
CB_Koders: loaded
Profiler: loaded
wxSmith: loaded
wxSmithMime: loaded
ClassWizard: loaded
Autosave: loaded
ThreadSearch: loaded
CodeCompletion: loaded
ScriptedWizard: loaded
cbKeyBinder: loaded
AutoVersioning: loaded
BrowseTracker: loaded
RegExTestbed: loaded
Compiler: loaded
cbDragScroll: loaded
Debugger: loaded
lib_finder: loaded
CodeSnippets: loaded
FilesExtensionHandler: loaded
Source Exporter plugin activated
To-Do List plugin activated
Help plugin plugin activated
Foreign projects importer plugin activated
Symbol Table Plugin plugin activated
BYO Games plugin activated
Code statistics plugin activated
Source code formatter (AStyle) plugin activated
wxSmith - Contrib Items plugin activated
Environment variables plugin activated
Open files list plugin activated
Koders query plugin activated
Code profiler plugin activated
wxSmith plugin activated
wxSmith - MIME plugin plugin activated
Class wizard plugin activated
Autosave plugin activated
ThreadSearch plugin activated
Code completion plugin activated
Project wizard added for 'Empty project'
Project wizard added for 'Console application'
Project wizard added for 'D application'
Project wizard added for 'FLTK project'
Project wizard added for 'GLFW project'
Project wizard added for 'GLUT project'
Project wizard added for 'GTK+ project'
Project wizard added for 'Irrlicht project'
Project wizard added for 'Lightfeather project'
Project wizard added for 'OpenGL project'
Project wizard added for 'Ogre project'
Project wizard added for 'Code::Blocks plugin'
Project wizard added for 'QT4 project'
Project wizard added for 'SDL project'
Project wizard added for 'Static library'
Project wizard added for 'Shared library'
Project wizard added for 'AVR Project'
Project wizard added for 'wxWidgets project'
Build-target wizard added for 'Console'
Build-target wizard added for 'Static library'
Build-target wizard added for 'wxWidgets'
File(s) wizard added for 'Empty file'
File(s) wizard added for 'C/C++ source'
File(s) wizard added for 'C/C++ header'
Scripted wizard plugin activated
Keyboard shortcuts plugin activated
AutoVersioning plugin activated
BrowseTracker plugin activated
Regular expressions testbed plugin activated
Added compiler "GNU GCC Compiler"
Parsing stage done (0 total parsed files, 0 tokens in 0 minute(s), 0.0 seconds).
Updating class browser...
Class browser updated.
Added compiler "Intel C/C++ Compiler"
Added compiler "SDCC Compiler"
Added compiler "Tiny C Compiler"
Added compiler "GDC D Compiler"
Added compiler "Digital Mars D Compiler"
Added compiler "GNU ARM GCC Compiler"
Added compiler "GNU AVR GCC Compiler"
Added compiler "GNU GCC Compiler for PowerPC"
Added compiler "GNU GCC Compiler for TriCore"
Compiler plugin activated
DragScroll plugin activated
Debugger plugin activated
Library finder plugin activated
Code snippets plugin activated
Files extension handler plugin activated
Initializing plugins...
Loading project file...
Parsing project file...
Loading target Debug
Loading target Release
Loading project files...
5 files loaded
Done loading project in 115ms
Project's base path: /home/yourusername/A_CB_TEST/test1/
Project's common toplevel path: /home/yourusername/A_CB_TEST/test1/
project data set for /home/yourusername/A_CB_TEST/test1/test1Main.cpp
Add project test1 in parsing queue
Caching result of `wx-config --cflags`
Cached
Caching result of `wx-config --libs`
Cached
Caching internal gcc dirs for adding to parser...
Caching GCC dir: /usr/include/c++/4.2
Caching GCC dir: /usr/include/c++/4.2/i486-linux-gnu
Caching GCC dir: /usr/include/c++/4.2/backward
Caching GCC dir: /usr/local/include
Caching GCC dir: /usr/lib/gcc/i486-linux-gnu/4.2.3/include
Caching GCC dir: /usr/include
Passing list of files to parse
Starting batch parsing
Parsing stage done (285 total parsed files, 15347 tokens in 0 minute(s), 4.827 seconds).
Updating class browser...
Class browser updated.