<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.codeblocks.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Frithjofh</id>
	<title>Code::Blocks - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.codeblocks.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Frithjofh"/>
	<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php/Special:Contributions/Frithjofh"/>
	<updated>2026-04-21T22:56:49Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.0</generator>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Code_Completion_Design&amp;diff=6408</id>
		<title>Code Completion Design</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Code_Completion_Design&amp;diff=6408"/>
		<updated>2010-08-06T08:07:13Z</updated>

		<summary type="html">&lt;p&gt;Frithjofh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Developer Documentation]]&lt;br /&gt;
==How to build==&lt;br /&gt;
===Get the source code===&lt;br /&gt;
When you download the  svn source code of code::blocks,(see here [[Installing_Code::Blocks_from_source_on_Windows#Code::Blocks_sources]] the source code of CodeCompletion plugin was already included. &lt;br /&gt;
&lt;br /&gt;
Here is the screen shot when I opened the codecompletion source code in C::B's source navigator view.&lt;br /&gt;
&lt;br /&gt;
[[Image:Devcc1.png|300x300px| Code completion source tree opened in code::blocks]]&lt;br /&gt;
&lt;br /&gt;
===Build the code completion plug-in===&lt;br /&gt;
If you only want to build the Code Completion plug-in, you can select it in the &amp;quot;build target list&amp;quot; (Note: by default, the Build target option was &amp;quot;ALL&amp;quot;, which means all the targets in the current workspace will be build), see the screen shot below:&lt;br /&gt;
&lt;br /&gt;
[[Image:Buildcc.PNG|frame|none| Code completion build target option in code::blocks]]&lt;br /&gt;
&lt;br /&gt;
Don't forget to run the batch script file &amp;quot;update.bat&amp;quot; after you build the target, this procedure will update your output folder package and strip the debug information. See the wiki page [[Installing_Code::Blocks_from_source_on_Windows]] for more information.&lt;br /&gt;
&lt;br /&gt;
===A brief description of every project files===&lt;br /&gt;
From now on, we use '''CC''' as an abbreviation for '''code completion plug-in'''.&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;font-size: 100%; border: gray solid 1px; border-collapse: collapse; text-align: left; width: 100% table-layout: unfixed;&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
| ccdebuginfo.cpp || a dialog for debugging CC, can be opened by double click on the code browser tree entry with shift and ctrl key pressed &lt;br /&gt;
|- &lt;br /&gt;
| ccoptionsdlg.cpp|| code completion options dialog, can be opened by menu-&amp;gt;setting-&amp;gt;editor-&amp;gt;code completion and symbols browser&lt;br /&gt;
|-&lt;br /&gt;
| ccoptionsprjdlg.cpp|| setting the additional parser search path&lt;br /&gt;
|-&lt;br /&gt;
| classbrowser.cpp||viewing the symbols tree ctrl(token tree).&lt;br /&gt;
|-&lt;br /&gt;
| classbrowserbuilderthread.cpp|| a thread to build the class browser tree above&lt;br /&gt;
|-&lt;br /&gt;
| codecompletion.cpp ||The Main file need by code completion plug-in, maintain all the CC's GUI and native parser&lt;br /&gt;
|-&lt;br /&gt;
| insertclassmethoddlg.cpp|| a dialog to insert class method, can be open by context menu in editor&lt;br /&gt;
|-&lt;br /&gt;
| nativeparser.cpp||a class derived from wxEvtHandler, NativeParser class has a member variable &amp;quot;Parser m_Parser&amp;quot;;&lt;br /&gt;
|-&lt;br /&gt;
| selectincludefile.cpp|| select multiply matched token names before any jump to declaration or jump to implementation.&lt;br /&gt;
|-&lt;br /&gt;
|parser/parser.cpp|| Parser class was also derived from wxEvtHandler, can start batch parse... this class has member variables like :cbThreadPool m_Pool(which will create a thread from thread pool for each file need passed);TokensTree* m_pTokens(contains all the Token database);&lt;br /&gt;
|-&lt;br /&gt;
|parser/parserthread.cpp||will do the syntax analysis for every file in a project, it has a Tokenizer as member variable&lt;br /&gt;
|-&lt;br /&gt;
|parser/token.cpp|| definition of the &amp;quot;Token&amp;quot; class, and TokensTree(which means the Token dababase)&lt;br /&gt;
|-&lt;br /&gt;
|parser/tokenizer.cpp|| tokenizer will return every wxString it regard as a symbol by GetToken(), also do a replacement before return&lt;br /&gt;
|-&lt;br /&gt;
|parser/searchtree.cpp|| implement the patricia search tree using by TokensTree&lt;br /&gt;
|-&lt;br /&gt;
|Header files|| no description needed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Low level parser(Lexical analysis, Tokenize)==&lt;br /&gt;
For someone haven't heard what does &amp;quot;Token&amp;quot; and &amp;quot;Tokenize&amp;quot; mean, you should read the wikibooks article [http://en.wikibooks.org/wiki/C%2B%2B_Programming/Compiler#Compilation A brief explain of what does a parser do] and [http://en.wikipedia.org/wiki/Lexical_analysis Tokenize on wikipedia]. Shortly, a Tokenizer regards your C++ or C source code as a large array of characters (sometimes, we call it a string), then this big string can be divided to small atomic strings----a '''token''' (Each token has a unique meanings and can't be divided into sub-strings. A token can be a symbol, an identifier, a keyword, a digital number, etc), meanwhile &amp;quot;white spaces&amp;quot; and &amp;quot;comments&amp;quot; were ignored by the Tokenizer.&lt;br /&gt;
&lt;br /&gt;
for a simple c++ program like below&lt;br /&gt;
&amp;lt;source lang = &amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; &amp;quot;hello world&amp;quot; &amp;lt;&amp;lt; std::endl;&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
After tokenizing, it should give these 15 tokens&lt;br /&gt;
&amp;lt;source lang = &amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
1 = string &amp;quot;int&amp;quot;&lt;br /&gt;
2 = string &amp;quot;main&amp;quot;&lt;br /&gt;
3 = opening parenthesis&lt;br /&gt;
4 = closing parenthesis&lt;br /&gt;
5 = opening brace&lt;br /&gt;
6 = string &amp;quot;std&amp;quot;&lt;br /&gt;
7 = namespace operator&lt;br /&gt;
8 = string &amp;quot;cout&amp;quot;&lt;br /&gt;
9 = &amp;lt;&amp;lt; operator&lt;br /&gt;
10 = string &amp;quot;&amp;quot;hello world&amp;quot;&amp;quot;&lt;br /&gt;
11 = string &amp;quot;endl&amp;quot;&lt;br /&gt;
12 = semicolon&lt;br /&gt;
13 = string &amp;quot;return&amp;quot;&lt;br /&gt;
14 = number 0&lt;br /&gt;
15 = closing brace&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Tokenizer class===&lt;br /&gt;
A class named '''Tokenizer''' was implemented in &amp;quot;tokenizer.h&amp;quot; and &amp;quot;tokenizer.cpp&amp;quot;. Seen from the Tokenizer's level, a token is just a [http://docs.wxwidgets.org/stable/wx_unicode.html unicode] wxString. There are several steps to run an instance of Tokenizer. &lt;br /&gt;
===preparing the big string===&lt;br /&gt;
From the previous section, you know the Tokenizer is just a string cutter. So, the first step is preparing the big string. The string can either be loaded from a source file or a memory buffer. Currently, the Unicode wxString is used.(since we are all using Unicode build of code::blocks, and ANSI mode is outdated and deprecated).&lt;br /&gt;
===Get or Peek a token===&lt;br /&gt;
'''Tokenizer''' contains a '''file position indicator'''----m_TokenIndex(see [http://en.wikipedia.org/wiki/Fopen File Open In C language]) pointing to the current position of string. So, you can '''Get''' a token or '''Peek''' a token. Here is the function prototype&lt;br /&gt;
&amp;lt;source lang = &amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    //Get the current token string started from m_TokenIndex, &lt;br /&gt;
    //After that, increase the m_Tokenindex&lt;br /&gt;
    wxString GetToken();&lt;br /&gt;
&lt;br /&gt;
    //Peak the current token string and but do *NOT* increase the m_TokenIndex&lt;br /&gt;
    wxString PeekToken();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, if the Tokenizer parses the example code above, you can see how these two methods work.&lt;br /&gt;
&lt;br /&gt;
*After initializing the Tokenizer(preparing the big string), You firstly call the GetToken() function, which will return the first token &amp;quot;int&amp;quot; and increase the m_TokenIndex one step to &amp;quot;int&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
*Then, if you call the PeekToken(), which will return a token &amp;quot;main&amp;quot;, but the tokenindex was still remaining point to &amp;quot;int&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
*If you call the GetToken() again, it will return a &amp;quot;main&amp;quot; immediately and increase the file pointer to &amp;quot;main&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Note: Internally, the Tokenizer class use a '''undo and peek cache''' to do the trick. Once a token is peeked, it is saved in '''m_Peek''' member, so, next time you call GetToken(), it just immediately return the cached value without calling the &amp;quot;DoGetToken()&amp;quot; procedure again. &lt;br /&gt;
&lt;br /&gt;
[[Image:Cb token cache.png]]&lt;br /&gt;
&lt;br /&gt;
===Nested Value of braces===&lt;br /&gt;
As you know, braces are exist in pairs, such as &amp;quot;{&amp;quot; and &amp;quot;}&amp;quot;, or &amp;quot;[&amp;quot; and &amp;quot;]&amp;quot;, Also, these braces can be embeded. So the Tokenizer keep a value '''m_NestLevel''' to indicate how deep you stays. If the Tokenizer meets a '''{''', it will increase the nestValue, and if it meets a '''}''', it will decrease the m_NestLevel. See the pseudo code in Tokenizer.cpp below:&lt;br /&gt;
&amp;lt;source lang = &amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
        if (CurrentChar() == '{')&lt;br /&gt;
            ++m_NestLevel;&lt;br /&gt;
        else if (CurrentChar() == '}')&lt;br /&gt;
            --m_NestLevel;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===SkipUnwanted tokens===&lt;br /&gt;
A '''bool''' member variable '''m_SkipUnwantedTokens''' determines whether a regular assignments statement will be omitted or not. For example, a piece of code below:&lt;br /&gt;
&amp;lt;source lang = &amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
a = b + c;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If m_SkipUnwantedTokens == true, then once SkipUnwanted() meets the &amp;quot;=&amp;quot; symbol, it will go on skipping every characters until it meets ''',''' or ''';''' or '''}''', so this statement will be omitted by the Tokenizer. &lt;br /&gt;
&lt;br /&gt;
Sometimes, this behavior becomes a nightmare when parsing the statement like default argument in template. Or the default arguments in function.&lt;br /&gt;
&amp;lt;source lang = &amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
// assignment statement in template arguments&lt;br /&gt;
template&amp;lt;class T = int&amp;gt; &lt;br /&gt;
class abc {&lt;br /&gt;
 T m_a;&lt;br /&gt;
 ......&lt;br /&gt;
 ......&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// assignment statement in function arguments&lt;br /&gt;
&lt;br /&gt;
void foo( int arg1 = 60 )&lt;br /&gt;
{&lt;br /&gt;
    bla bla;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If the Tokenizer finds that an equation sign '''=''', it will skip any character until it meets a '''}''', so, the class declaration or function body will be totally skipped in the unexpected way. In this case, we should manually '''disable''' this functionality by setting m_SkipUnwantedTokens = false to let the Tokenizer parse these statements correctly.&lt;br /&gt;
&lt;br /&gt;
That's why you will see many situations when you enter a function, you should save the m_SkipUnwantedTokens statues and disabled it, when you leave a function, you should manually restore it.(See function implementation in ParseThread.cpp)&lt;br /&gt;
&lt;br /&gt;
===Return a correct token, Macro replacement===&lt;br /&gt;
Special token should be replaced for parsing correctly. For example, in the standard c++ header (mingw), there are a string named &amp;quot;_GLIBCXX_STD&amp;quot;, this should be replaced to &amp;quot;std&amp;quot;. See the dialog below.&lt;br /&gt;
&lt;br /&gt;
[[Image:Cc std replacement.png|400x400px|]]&lt;br /&gt;
&lt;br /&gt;
The inline function in the Tokenizer class will check whether a token should be replaced before return. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang = &amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
wxString Tokenizer::MacroReplace(const wxString str)&lt;br /&gt;
{&lt;br /&gt;
    wxStringHashMap::const_iterator it = s_Replacements.find(str);&lt;br /&gt;
&lt;br /&gt;
    if (it != s_Replacements.end())&lt;br /&gt;
    {&lt;br /&gt;
        // match one!&lt;br /&gt;
        wxString key   = it-&amp;gt;first;&lt;br /&gt;
        wxString value = it-&amp;gt;second;&lt;br /&gt;
        TRACE(_T(&amp;quot;MacroReplace() : Replacing '%s' with '%s' (file='%s').&amp;quot;), key.wx_str(), value.wx_str(), m_Filename.wx_str());&lt;br /&gt;
        if (value[0]=='+' &amp;amp;&amp;amp; CurrentChar()=='(')&lt;br /&gt;
        {&lt;br /&gt;
            unsigned int start = m_TokenIndex;&lt;br /&gt;
            m_Buffer[start] = ' ';&lt;br /&gt;
            bool fillSpace = false;&lt;br /&gt;
            while (m_Buffer[start]!=')')&lt;br /&gt;
            {&lt;br /&gt;
                if (m_Buffer[start]==',')&lt;br /&gt;
                    fillSpace = true;&lt;br /&gt;
&lt;br /&gt;
                if (fillSpace==true)&lt;br /&gt;
                    m_Buffer[start]=' ';&lt;br /&gt;
&lt;br /&gt;
                start++;&lt;br /&gt;
            }&lt;br /&gt;
            m_Buffer[start] = '{';&lt;br /&gt;
            return value.Remove(0,1);&lt;br /&gt;
        }&lt;br /&gt;
        else if (value[0] == '-')&lt;br /&gt;
        {&lt;br /&gt;
            unsigned int lenKey = key.Len();&lt;br /&gt;
            value = value.Remove(0,1);&lt;br /&gt;
            unsigned int lenValue = value.Len();&lt;br /&gt;
&lt;br /&gt;
            for (unsigned int i=1; i&amp;lt;=lenKey; i++)&lt;br /&gt;
            {&lt;br /&gt;
                if (i &amp;lt; lenValue)&lt;br /&gt;
                    m_Buffer[m_TokenIndex-i] = value[lenValue-i];&lt;br /&gt;
                else&lt;br /&gt;
                    m_Buffer[m_TokenIndex-i] = ' ';&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            int firstSpace = value.First(' ');&lt;br /&gt;
            // adjust m_TokenIndex&lt;br /&gt;
            m_TokenIndex = m_TokenIndex - lenValue + firstSpace;&lt;br /&gt;
&lt;br /&gt;
            return value.Mid(0,firstSpace);&lt;br /&gt;
        }&lt;br /&gt;
        else&lt;br /&gt;
            return value;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    return str;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Cc replace dialog.png|400x400px|none| Code completion build target option in code::blocks]]&lt;br /&gt;
&lt;br /&gt;
Setting the replacement mapping. Note that before return a token, a replacement map was searched to check if it matches any entry in the map, so, the bigger this map goes, the slower it will do parsing.&lt;br /&gt;
&lt;br /&gt;
Note: Code Completion plug-in is not a preprocessor, so it is difficult to deal with the source mixed with many macro, or some strange macros. This is something like Ctags' replacement options &amp;quot;?I identifier?list&amp;quot; in [http://ctags.sourceforge.net/ctags.html#OPERATIONAL%20DETAILS ctags option detial] or [http://codelite.org/LiteEditor/FAQ Code Completion macro FAQ]&lt;br /&gt;
&lt;br /&gt;
For discussion of Ctags, the related thread is [/index.php/topic,10564.msg72424.html#msg72424 Re: namespaces and code completion] and [/index.php/topic,11187.msg77135.html#msg77135 Re: New code completion remarks/issues]&lt;br /&gt;
&lt;br /&gt;
===replacement rules===&lt;br /&gt;
====directly replacement AAAAA -&amp;gt; BBBBB====&lt;br /&gt;
You can define a rule:&lt;br /&gt;
AAAAA -&amp;gt; BBBBB&lt;br /&gt;
&lt;br /&gt;
Which means, if the tokenizer meet a string &amp;quot;AAAAA&amp;quot;, then it will returned a string &amp;quot;BBBBB&amp;quot;&lt;br /&gt;
==== AAAAA -&amp;gt; +BBBBB====&lt;br /&gt;
For example, when &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang = &amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)&lt;br /&gt;
&lt;br /&gt;
  /// See bits/stl_deque.h's _Deque_base for an explanation.&lt;br /&gt;
  template&amp;lt;typename _Tp, typename _Alloc&amp;gt;&lt;br /&gt;
    struct _Vector_base&lt;br /&gt;
    {&lt;br /&gt;
      typedef typename _Alloc::template rebind&amp;lt;_Tp&amp;gt;::other _Tp_alloc_type;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ......&lt;br /&gt;
&lt;br /&gt;
_GLIBCXX_END_NESTED_NAMESPACE&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We should replace the string &amp;quot;_GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)&amp;quot; &lt;br /&gt;
to &amp;quot;namespace std {&amp;quot;, here, we introduce two replacement rules:&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;font-size: 100%; border: gray solid 1px; border-collapse: collapse; text-align: left; width: 100% table-layout: unfixed;&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
| _GLIBCXX_BEGIN_NESTED_NAMESPACE || +namespace&lt;br /&gt;
|-&lt;br /&gt;
| _GLIBCXX_END_NESTED_NAMESPACE  || }&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In this rule, we firstly replace the &amp;quot;_GLIBCXX_BEGIN_NESTED_NAMESPACE&amp;quot; with the &amp;quot;namespace&amp;quot;, then, we reserve the &amp;quot;std&amp;quot;, and change the closing parenthesis to an opening brace. (See the image above), also, every token string &amp;quot;_GLIBCXX_END_NESTED_NAMESPACE&amp;quot; will be replaced by &amp;quot;}&amp;quot;. &lt;br /&gt;
[[File:CCreplacement_rule.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So, the code becomes to like below:&lt;br /&gt;
&amp;lt;source lang = &amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
namespace     std   {&lt;br /&gt;
&lt;br /&gt;
  /// See bits/stl_deque.h's _Deque_base for an explanation.&lt;br /&gt;
  template&amp;lt;typename _Tp, typename _Alloc&amp;gt;&lt;br /&gt;
    struct _Vector_base&lt;br /&gt;
    {&lt;br /&gt;
      typedef typename _Alloc::template rebind&amp;lt;_Tp&amp;gt;::other _Tp_alloc_type;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    ......&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
==== AAAAA -&amp;gt; -BBBBB====&lt;br /&gt;
&lt;br /&gt;
For example, when &lt;br /&gt;
&amp;lt;source lang = &amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
_GLIBCXX_BEGIN_NAMESPACE_TR1&lt;br /&gt;
...&lt;br /&gt;
...&lt;br /&gt;
_GLIBCXX_END_NAMESPACE_TR1&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We should replace the string &amp;quot;_GLIBCXX_BEGIN_NAMESPACE_TR1&amp;quot; &lt;br /&gt;
to &amp;quot;namespace tr1 {&amp;quot;, here, we introduce two replacement rules:&lt;br /&gt;
{|border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; style=&amp;quot;font-size: 100%; border: gray solid 1px; border-collapse: collapse; text-align: left; width: 100% table-layout: unfixed;&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
| _GLIBCXX_BEGIN_NAMESPACE_TR1 || -namespace tr1 {&lt;br /&gt;
|-&lt;br /&gt;
| _GLIBCXX_END_NAMESPACE_TR1  || }&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In this rule, we firstly replace the &amp;quot;_GLIBCXX_BEGIN_NAMESPACE_TR1&amp;quot; with the &amp;quot;namespace&amp;quot;, then, add aditional string &amp;quot;tr1 {&amp;quot;&lt;br /&gt;
&lt;br /&gt;
So, the code becomes:&lt;br /&gt;
&amp;lt;source lang = &amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
namespace tr1 {&lt;br /&gt;
...&lt;br /&gt;
...&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== AAAAA -&amp;gt; *====&lt;br /&gt;
In this case, we call it a &amp;quot;strip the next &amp;quot;(&amp;quot; and &amp;quot;)&amp;quot; rule. for example:&lt;br /&gt;
&lt;br /&gt;
The rule syntax is:&lt;br /&gt;
&lt;br /&gt;
XXXXXX  -&amp;gt; *&lt;br /&gt;
&lt;br /&gt;
For example, In the source code below:&lt;br /&gt;
&amp;lt;source lang = &amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
CVAPI(void) cvFxxxx();&lt;br /&gt;
CVAPI(cvMat *) cvFyyy();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will become to (if I add a replacement rule  CVAPI -&amp;gt; *)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang = &amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
void cvFxxxx();&lt;br /&gt;
cvMat * cvFyyy();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==High level parser(Syntax Analysis)==&lt;br /&gt;
This is the main flow of a parser.&lt;br /&gt;
&lt;br /&gt;
[[Image:Parser_Flow.gif]]&lt;br /&gt;
===parser thread===&lt;br /&gt;
Basically, we can say, the low level parser(Tokenizer) moves its pointer character by character, and return a wxString(token) to feed the high level parser(Syntax analyzer).All the syntax analysis was done in ParserThread. A thread must be created to parse a source file. see parserthread.cpp and parserthread.h, a thread will be allocated from thread pool. For example, a file contains these statement:&lt;br /&gt;
&amp;lt;source lang = &amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    void  f1();&lt;br /&gt;
    int   f2(char c);&lt;br /&gt;
    float f3(void * p);&lt;br /&gt;
    int   f1;&lt;br /&gt;
    double f2;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
After the ParserThread finished its parsing, it will recognize five tokens, which has the keyword &amp;quot;f1&amp;quot;,&amp;quot;f2&amp;quot; and &amp;quot;f3&amp;quot;, note, tokens can have the same names, but they differ from different types( variables, functions...).&lt;br /&gt;
&lt;br /&gt;
===Token class===&lt;br /&gt;
How can a large number of tokens be recorded? A '''Token'''(note: it as a capital means it's class type) class was introduced to recorded every token. For boosting the speed of allocating Tokens, the &amp;quot;new&amp;quot; and &amp;quot;delete&amp;quot; operator were overloaded in its base class BlockAllocated. See the [http://en.wikipedia.org/wiki/Memory_pool memory pool] page on wikipedia as a reference.&lt;br /&gt;
&amp;lt;source lang = &amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class Token  : public BlockAllocated&amp;lt;Token, 10000&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
        ......&lt;br /&gt;
        wxString m_Type; // this is the return value (if any): e.g. const wxString&amp;amp;&lt;br /&gt;
        wxString m_ActualType; // this is what the parser believes is the actual return value: e.g. wxString&lt;br /&gt;
        wxString m_Name;&lt;br /&gt;
        wxString m_Args;&lt;br /&gt;
        wxString m_AncestorsString; // all ancestors comma-separated list&lt;br /&gt;
        unsigned int m_File;&lt;br /&gt;
        unsigned int m_Line;&lt;br /&gt;
        unsigned int m_ImplFile;&lt;br /&gt;
        unsigned int m_ImplLine; // where the token was met&lt;br /&gt;
        unsigned int m_ImplLineStart; // if token is impl, opening brace line&lt;br /&gt;
        unsigned int m_ImplLineEnd; // if token is impl, closing brace line&lt;br /&gt;
        TokenScope m_Scope;&lt;br /&gt;
        TokenKind m_TokenKind;&lt;br /&gt;
        bool m_IsOperator;&lt;br /&gt;
        bool m_IsLocal; // found in a local file?&lt;br /&gt;
        bool m_IsTemp; // if true, the tree deletes it in FreeTemporaries()&lt;br /&gt;
        bool m_IsConst;    // the member method is const (yes/no)&lt;br /&gt;
&lt;br /&gt;
        int m_ParentIndex;&lt;br /&gt;
        TokenIdxSet m_Children;&lt;br /&gt;
        TokenIdxSet m_Ancestors;&lt;br /&gt;
        TokenIdxSet m_DirectAncestors;&lt;br /&gt;
        TokenIdxSet m_Descendants;&lt;br /&gt;
        ......&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
You can see the Token class contains all the information needed for recording its locating, its type or class derived hierarchy... &lt;br /&gt;
&lt;br /&gt;
For example, in the source code in[Low level parser(Lexical analysis)]. A Token for &amp;quot;main&amp;quot; should contains it's name (obviously , m_Name=&amp;quot;main&amp;quot; ), then m_File will record which file dose this Token exist. m_Line will give the line number of &amp;quot;main&amp;quot; in this source file, and so on.&lt;br /&gt;
&lt;br /&gt;
===Memory Pool--BlockAllocated class===&lt;br /&gt;
In BlockAllocated class, there is only a static member say &amp;quot;static BlockAllocator&amp;lt;T, pool_size, debug&amp;gt; allocator;&amp;quot; to keep all the pre-allocated memory for all derived class.&lt;br /&gt;
&lt;br /&gt;
'''10000''' means a pool of 10000 Tokens were allocated in the memory pool, so, dynamically allocate a Token object will be fast and efficient. &lt;br /&gt;
&lt;br /&gt;
[[Image:Cb blockalloc.png|frame|none|  Operator new overloading for fast allocate in the heap]]&lt;br /&gt;
&lt;br /&gt;
===ParserThread===&lt;br /&gt;
The function Parse() will do the most job of syntax analysis. See the pseudo code below.&lt;br /&gt;
&amp;lt;source lang = &amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
ParserThread::Parse()&lt;br /&gt;
{&lt;br /&gt;
   ......&lt;br /&gt;
   do&lt;br /&gt;
    {&lt;br /&gt;
        ......&lt;br /&gt;
        DoParse();&lt;br /&gt;
        ......&lt;br /&gt;
 &lt;br /&gt;
        &lt;br /&gt;
    }while(false);&lt;br /&gt;
&lt;br /&gt;
    return result;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the DoParse(), it checks the token from Tokenizer. For example, if the token words = &amp;quot;enum&amp;quot;, then, the ParserThread::HandleEnum() will do the job to parse this enum block.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===A simple look ahead parser===&lt;br /&gt;
We can explain a little about it parser, the member variable '''m_Str''' of class ParserThread will be considered as a '''type stack''', for example, we want to parse the statement below:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang = &amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
symbolA symbolB symbolC symbolD;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Only symbolD can be recognized as a variable, and it has a type of &amp;quot;symbolA symbolB symbolC&amp;quot;. When the parser meets each symbol, it will look ahead to see the next token is whether &amp;quot;;&amp;quot;, if not, the current token will '''pushed''' to m_Str. These iteration will be ended when the parser look ahead one step from symbolD and find the next token is a &amp;quot;;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===DoParse Examples===&lt;br /&gt;
====Handling class declaration====&lt;br /&gt;
The main routing of handling class was in &lt;br /&gt;
ParserThread::HandleClass function&lt;br /&gt;
If the parserThread meet these statement&lt;br /&gt;
&amp;lt;source lang = &amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class AAA{&lt;br /&gt;
    int m_a;&lt;br /&gt;
    int m_b;&lt;br /&gt;
} ;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
It will surely add a Token of &amp;quot;AAA&amp;quot;, it's type is &amp;quot;class&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
What about these statements&lt;br /&gt;
&amp;lt;source lang = &amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
class AAA{&lt;br /&gt;
    int m_a;&lt;br /&gt;
    int m_b;&lt;br /&gt;
} x,y,z;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The parserThread should firstly add a Token &amp;quot;AAA&amp;quot;, then it should regard &amp;quot;x&amp;quot;, &amp;quot;y&amp;quot;, &amp;quot;z&amp;quot; are three variables of type &amp;quot;AAA&amp;quot;. This was done by &amp;quot;ReadVarNames()&amp;quot; function, it will read every comma separated variables after a class declaration.&lt;br /&gt;
&lt;br /&gt;
====Handling typedef statement====&lt;br /&gt;
Sometimes, you can see these code blocks:&lt;br /&gt;
&amp;lt;source lang = &amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
typedef class AAA{&lt;br /&gt;
    int m_a;&lt;br /&gt;
    int m_b;&lt;br /&gt;
} BBB,CCC;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If the parser meets the keyword &amp;quot;typedef&amp;quot;, firstly it set the &amp;quot;m_ParsingTypedef = ture&amp;quot; to indicate that we are parsing a typedef statement.&lt;br /&gt;
&lt;br /&gt;
Next, it meets a keyword &amp;quot;class&amp;quot;, which also indicate it is a class declaration. So, the HandleClass function will do the task. A Token of &amp;quot;class AAA&amp;quot; will be added to the TokensTree. Wait a minute, how can we deal with &amp;quot;BBB&amp;quot; and &amp;quot;CCC&amp;quot;, this is not the same case as previous code, we can't regard &amp;quot;BBB&amp;quot;,&amp;quot;CCC&amp;quot; as variables. In this case, another function &amp;quot;ReadClsName()&amp;quot; will be called. For simplicity of TokensTree, we just regard &amp;quot;BBB&amp;quot; and &amp;quot;CCC&amp;quot; as derived class of &amp;quot;AAA&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
How does the parserThread know between these two cases. Here is the code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang = &amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
                if (m_ParsingTypedef)&lt;br /&gt;
                {&lt;br /&gt;
                    m_Str.Clear();&lt;br /&gt;
                    ReadClsNames(newToken-&amp;gt;m_Name);&lt;br /&gt;
                    // m_ParsingTypedef = false;&lt;br /&gt;
                    break;&lt;br /&gt;
&lt;br /&gt;
                }&lt;br /&gt;
                else&lt;br /&gt;
                {&lt;br /&gt;
                    m_Str = newToken-&amp;gt;m_Name;&lt;br /&gt;
                    ReadVarNames();&lt;br /&gt;
                    m_Str.Clear();&lt;br /&gt;
                    break;&lt;br /&gt;
                }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That's the whole thing I would like to write about handling class and handling typedef.&lt;br /&gt;
&lt;br /&gt;
==TokensTree&amp;amp;SearchTree==&lt;br /&gt;
Maybe, you would ask a question: where do these Tokens store? The answer is that all the Tokens will be recorded in &amp;quot;TokensTree class&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When a certain Token is identified(whether it's a global variable, a class declaration, a class member function, and so on), it will be inserted to a database(TokensTree). &lt;br /&gt;
&lt;br /&gt;
Furthermore, for fast Token query, Tokens should be sorted by it's wxString m_Name member; &lt;br /&gt;
&lt;br /&gt;
A '''compact Patricia tree'''(see the wikipedia [http://en.wikipedia.org/wiki/Radix_tree Patricia tree on wikipedia]) is built to hold all their names. &lt;br /&gt;
&lt;br /&gt;
For example, If you add three item to the TokensTree.&lt;br /&gt;
&amp;lt;source lang = &amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
    mytree-&amp;gt;AddItem(_T(&amp;quot;physics&amp;quot;),_T(&amp;quot;1 - uno&amp;quot;));&lt;br /&gt;
    mytree-&amp;gt;AddItem(_T(&amp;quot;physiology&amp;quot;),_T(&amp;quot;2 - dos&amp;quot;));&lt;br /&gt;
    mytree-&amp;gt;AddItem(_T(&amp;quot;psychic&amp;quot;),_T(&amp;quot;3 - tres&amp;quot;));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The Patricia tree structure will show as below, the edge of a tree contains a &amp;quot;label string&amp;quot; and the number in parentheses refers to a node Id.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang = &amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
- &amp;quot;&amp;quot; (0)&lt;br /&gt;
      \- &amp;quot;p&amp;quot; (4)&lt;br /&gt;
              +- &amp;quot;hysi&amp;quot; (2)&lt;br /&gt;
              |          +- &amp;quot;cs&amp;quot; (1)&lt;br /&gt;
              |          \- &amp;quot;ology&amp;quot; (3)&lt;br /&gt;
              \- &amp;quot;sychic&amp;quot; (5)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
===Animation of Patricia tree===&lt;br /&gt;
A web page gives an animation of building a Patricia tree, you can see how the tree node added. See here [http://bootstrapping.wordpress.com/2008/01/24/prefix-searching-with-radix-tree/ Prefix searching with Radix Tree] &lt;br /&gt;
 &lt;br /&gt;
===SearchTree Node===&lt;br /&gt;
A Node should contains at least several essential element. They are:&lt;br /&gt;
# An edge: in the image below, the gray filled area shows a Node, since each edge belong to the next node, for example, the Node has an edge &amp;quot;abcd&amp;quot;.&lt;br /&gt;
# SearchTreeItemMap: because our searchTree is a compact Patricia tree which means an edge contains many items. Such as, &amp;quot;ab&amp;quot; , &amp;quot;abc&amp;quot;, &amp;quot;abcd&amp;quot; all the suffix string belong to the edge &amp;quot;abcd&amp;quot; &lt;br /&gt;
# SearchTreeLinkMap: This is an associated container map&amp;lt;wxChar,NodeId&amp;gt;, which store all &amp;quot;pointers&amp;quot; to its child Node. In the example below, &amp;quot;e&amp;quot; points to a Node of &amp;quot;efg&amp;quot;, while &amp;quot;x&amp;quot; points to &amp;quot;xyz&amp;quot;.&lt;br /&gt;
# Node depth: depth of Search Tree Node is defined by the string length from the &amp;quot;root node&amp;quot;. See a depth of each node on the search tree above. For example, the Node of &amp;quot;hysi&amp;quot; has a m_Depth = 5 (&amp;quot;&amp;quot; + &amp;quot;p&amp;quot; + &amp;quot;hysi&amp;quot; = 5).&lt;br /&gt;
&lt;br /&gt;
===Node Lable===&lt;br /&gt;
For example, the node &amp;quot;hysi&amp;quot; (2) has two children, they are &amp;quot;cs&amp;quot; (1) and &amp;quot;ology&amp;quot; (3), show below.&lt;br /&gt;
&lt;br /&gt;
[[Image:Cb tree node lable.png]]&lt;br /&gt;
&lt;br /&gt;
For more information, see the forum discussion here. [/index.php/topic,1696.0.html rickg22's SearchTree development] as a reference.&lt;br /&gt;
&lt;br /&gt;
===How to query a Token by a keyword===&lt;br /&gt;
The parser collect all the Token information, and stored them in the TokensTree, the GUI function can query keywords from the database to show function tips or to build a Class Browser tree.&lt;br /&gt;
&lt;br /&gt;
For example, if you want to find all the Tokens named &amp;quot;ab&amp;quot;. In the picture above from TokenDatabase(TokensTree). we can search on the Patricia tree containing all the Tokens names, finaly, we find a tree node with a edge &amp;quot;abcd&amp;quot;. So, &amp;quot;ab&amp;quot; is in it's Node's items list. Then, we can find a TokenIdxSet in a vector&amp;lt;TokenIdxSet&amp;gt;, this TokenIdxSet has all the index named by &amp;quot;ab&amp;quot;, so, we can get the result like: There are many Tokens named &amp;quot;ab&amp;quot;.Token &amp;quot;ab&amp;quot; may be a member varialbe name in a class, or a global function name...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang = &amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
ClassA::ab&lt;br /&gt;
ClassB::ab&lt;br /&gt;
void ab()&lt;br /&gt;
....&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:CCTokenTree1.png]]&lt;br /&gt;
&lt;br /&gt;
==Flexible Parser structure==&lt;br /&gt;
The Parser class( in Parser.cpp and Parser.h ) has re-factored to support every project associate with a Parser object (svn revision &amp;gt; 6268 ). Which means: One Parser object per project, so, every project (xxx.cbp) will hold its own Token macro defines and Token trees. &lt;br /&gt;
&lt;br /&gt;
Due to the new introduced conditional preprocessor handling mechanism, the same source file may give different Tokens due to the different macro defines in different project. Also, CC support parsing on the files which does not belong to any project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#You open a project in CB, then all the files belong to the project( related to the project) will be parsed in CC.&lt;br /&gt;
#Now, you open another file( we call it a &amp;quot;separate file&amp;quot; later) which is not belong to the current project nor any other opened project.&lt;br /&gt;
#Then the CC will create a &amp;quot;temporary parser&amp;quot; named &amp;quot;NONE“ parser, and add this separate file to the &amp;quot;NONE&amp;quot; parser.&lt;br /&gt;
#So, you can still see the class tree when viewing the separate file.&lt;br /&gt;
#Once you close this separate file,  the &amp;quot;NONE&amp;quot; parser will automatically be removed.&lt;br /&gt;
&lt;br /&gt;
The main idea is: Now, We can let the CC do parse on some separate files&lt;br /&gt;
and support class browsing in Symbol browser.&lt;br /&gt;
&lt;br /&gt;
==Automatic Code Completion==&lt;br /&gt;
===Find the search scope===&lt;br /&gt;
&lt;br /&gt;
[[Image:CC SearchScope.png]]&lt;br /&gt;
&lt;br /&gt;
For example, when you are editing, and the caret position was located at &amp;quot;E&amp;quot; as shown in the above image, the first thing doing an automatic code completion is find the '''search scope'''.&lt;br /&gt;
&lt;br /&gt;
Here are some steps to get the initial(first) search scope:&lt;br /&gt;
&lt;br /&gt;
*First, you need to correct all the &amp;quot;using namespace XXXX&amp;quot; directives at the beginning the the current source file.(labeled with &amp;quot;A&amp;quot;), this means all the child tokens of &amp;quot;namespace Scintilla&amp;quot; should be searched.&lt;br /&gt;
*Secondly, find the function body where the current caret position locates. eg, the above code, the caret is in the &amp;quot;RunStyles::RunFromPosition()&amp;quot; function, so the function parameter variable &amp;quot;position&amp;quot;(labeled with &amp;quot;C&amp;quot; and the local variable &amp;quot;run&amp;quot; (labeled as &amp;quot;D&amp;quot;) is also a matching Tokens.&lt;br /&gt;
*Thirdly, look at the &amp;quot;B&amp;quot;, this means we are in the class named &amp;quot;RunStyles&amp;quot;, so, &amp;quot;RunStyles&amp;quot; is also a search scope.&lt;br /&gt;
*Finally, don't forget the global namespace scope, because the tokens of this scope are exposed to everywhere of the source.&lt;br /&gt;
&lt;br /&gt;
===Break up the current statement===&lt;br /&gt;
&amp;lt;source lang = &amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
 VariableA.m_VariableB.Functi&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
If you are entering the above statement, the caret is behind the &amp;quot;Functi&amp;quot;. Then the whole line will be break up to several &amp;quot;parsing component&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
There are three components: &amp;quot;'''VariableA'''&amp;quot; , &amp;quot;'''m_VariableB'''&amp;quot; and &amp;quot;'''Functi'''&amp;quot;. In the next section, I will introduce that the AI matching routing will start from matching the first component with the initial(first) search scope.&lt;br /&gt;
&lt;br /&gt;
===Do an AI match===&lt;br /&gt;
Doing an AI match is just like a walking on a tree, and find the final matching result.See the image below:&lt;br /&gt;
&lt;br /&gt;
[[image:CC AI Match.png]]&lt;br /&gt;
&lt;br /&gt;
'''Here is the matching algorithm''':&lt;br /&gt;
&lt;br /&gt;
Now, suppose we have an initial &amp;quot;search scope&amp;quot;, and a &amp;quot;component&amp;quot; array. &lt;br /&gt;
&lt;br /&gt;
The AI match algorithm starts from matching the &amp;quot;sub search scopes&amp;quot; with the first &amp;quot;component&amp;quot;, then, the matched &amp;quot;sub search scope&amp;quot;(red rectangle) will be the initial &amp;quot;search scope&amp;quot; again matching with the second &amp;quot;component&amp;quot;, this matching routing is running continuously until we matches with the final component. Then we get the whole matching result, that will be show as a auto code completion list.&lt;br /&gt;
&lt;br /&gt;
==Code completion debugging support==&lt;br /&gt;
===Debug Log output===&lt;br /&gt;
If you want to debug your plug-in, you may need to Logout the debug message to the &amp;quot;Code::Blocks Debug&amp;quot; panel. Here is the sample code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang = &amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
Manager::Get()-&amp;gt;GetLogManager()-&amp;gt;DebugLog(_(&amp;quot;XXXXX &amp;quot;));&lt;br /&gt;
&lt;br /&gt;
wxString name;&lt;br /&gt;
wxString args;&lt;br /&gt;
wxString m_Str;&lt;br /&gt;
//.....&lt;br /&gt;
Manager::Get()-&amp;gt;GetLogManager()-&amp;gt;DebugLog(F(_T(&amp;quot;Add token name='&amp;quot;)+name+_T(&amp;quot;', args='&amp;quot;)+args+_T(&amp;quot;', return type='&amp;quot;) + m_Str+ _T(&amp;quot;'&amp;quot;)));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Also, you need start the Code::Blocks with the command line argument. For example in windows.&lt;br /&gt;
&lt;br /&gt;
'''codeblocks.exe --debug-log'''&lt;br /&gt;
&lt;br /&gt;
then a Code::blocks debug panel will be shown to display the log.&lt;br /&gt;
[[Image:CbDebugLog.png|frame|none|  Debug Log output panel]]&lt;br /&gt;
&lt;br /&gt;
===Code-Completion debug tool dialog===&lt;br /&gt;
When you press '''shift''' and '''ctrl''' key and double click on any entry of the navigator tree entry, a debug tool dialog will pop up to give a more detail about the selected token. You can query its information such as its member variables, its Ancestors and so on.&lt;br /&gt;
&lt;br /&gt;
[[Image:CcDebugToolDialog.png]]&lt;br /&gt;
&lt;br /&gt;
===Debug Smart Sense log output ===&lt;br /&gt;
When you hold the'''shift''' and '''ctrl''' key and right click on any entry of the navigator tree entry, the context menu will have a &amp;quot;Debug SmartSense&amp;quot; menu entry shown. You can click it to enable it. See the image blow. Then, all the debug log information when doing an Auto-completion will be shown in the &amp;quot;Debug Log&amp;quot; panel.&lt;br /&gt;
&lt;br /&gt;
[[File:Cc debug smartsense.png]]&lt;br /&gt;
&lt;br /&gt;
==Usefull Links==&lt;br /&gt;
&lt;br /&gt;
*A discussion on search tree in the forum [/index.php/topic,1696.0.html] and [/index.php/topic,1581.0.html].&lt;br /&gt;
&lt;br /&gt;
*Another opensource IDE [http://vcfbuilder.org/?q=node/139 VCF builder]or[https://sourceforge.net/projects/vcfbuilder/ vcfbuilder on sf], By the way , VCF use a CodeStore based on [http://www.antlr.org/ antlr parser] to deal with parsing, the whole source code can be check out from &lt;br /&gt;
&amp;lt;source lang = &amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
svn co https://vcfbuilder.svn.sourceforge.net/svnroot/vcfbuilder vcfbuilder&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*online book[http://www.macs.hw.ac.uk/~alison/alg/details.html Data Structures and Algorithms II Course ] and [http://www.macs.hw.ac.uk/~alison/alg/lectures.html pdf lectures]&lt;br /&gt;
&lt;br /&gt;
*A forum discussion on why a standard perprocessor and parser works slowly. [/index.php/topic,2494.msg19801.html#msg19801 parsing iostream header takes 5 seconds]&lt;br /&gt;
&lt;br /&gt;
*[http://www.codelite.org CodeLite] is another open source IDE using wxWidgets, use Ctags as a indexing service, and do context expression syntactic analysis generated from Lex and Yacc tools.See the explanation in forum message by it's author eranif [/index.php/topic,10087.msg70875.html#msg70875 How does Codelite's CC work with CTags and Yacc&amp;amp;Lex]&lt;br /&gt;
&lt;br /&gt;
*Hopefully, we can use the patricia tree from the standard library, see here:[http://gcc.gnu.org/onlinedocs/libstdc++/ext/pb_ds/trie_based_containers.html trie]&lt;br /&gt;
&lt;br /&gt;
* a blog from KDE4's developer, it explain the code completion in KDE4, see here:[http://zwabel.wordpress.com/ zwabel' blog]&lt;br /&gt;
&lt;br /&gt;
* QT creator source code from [http://qt.gitorious.org/qt-creator/qt-creator/trees/master QT-creator source]&lt;br /&gt;
&lt;br /&gt;
* [http://websvn.kde.org/trunk/KDE/kdevelop/ Kdevelop source code] and it's [http://websvn.kde.org/trunk/KDE/kdevelop/languages/cpp/parser/ parser]&lt;br /&gt;
&lt;br /&gt;
* [http://stackoverflow.com/questions/1220099/how-does-code-completion-work How does code completion work? - Stack Overflow]&lt;br /&gt;
&lt;br /&gt;
* [/index.php/topic,11724.0.html Just a reminder Codelite IDE now have improved it's parser]&lt;br /&gt;
&lt;br /&gt;
*[http://padator.org/software-yacfe.php Yacfe, a parser with proprocessor enabled]&lt;br /&gt;
&lt;br /&gt;
*[/index.php/topic,1581.msg11701.html#msg11701 A Mini C++ interpreter] from the book &amp;quot;The Art of C++ by Herbert Schildt&amp;quot;, source code can be download [http://books.mcgraw-hill.com/downloads/products/0072255129/0072255129_code.zip here]&lt;br /&gt;
&lt;br /&gt;
*[http://www.macs.hw.ac.uk/~alison/alg/lectures/l7.pdf Lecture 7: Parsing (intro) (pdf)] and [http://www.macs.hw.ac.uk/~alison/alg/lectures/l8.pdf Lecture 8: Recursive Descent Parsing (pdf)] from [http://www.macs.hw.ac.uk/~alison/alg/lectures.html Data Structures and Algorithms II]&lt;br /&gt;
&lt;br /&gt;
*There are some online &amp;quot;Compiler design&amp;quot; books listed in [http://www.freetechbooks.com/compiler-design-and-construction-f14.html Free Online Compiler Design and Construction Books :: FreeTechBooks.com], and the best one I think is : [http://www.diku.dk/hjemmesider/ansatte/torbenm/Basics/index.html Basics of Compiler Design], and you can get a basic understanding.&lt;/div&gt;</summary>
		<author><name>Frithjofh</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=5868</id>
		<title>Installing Code::Blocks from source on Windows</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows&amp;diff=5868"/>
		<updated>2009-03-05T18:44:52Z</updated>

		<summary type="html">&lt;p&gt;Frithjofh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installing Code::Blocks]]&lt;br /&gt;
[[Category:Installing Code::Blocks from source]]&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
'''Note for RC2 users'''&lt;br /&gt;
&lt;br /&gt;
The older Code::Blocks RC2 does not support global compiler variables which were added after RC2 was released and is unable to read project files generated with post-RC2 versions.&lt;br /&gt;
To build Code::Blocks, you need a post-RC2 build, such as ''8.02'' or any of the ''nightly builds'' obtainable by [/index.php?board=20.0 searching the forum].&lt;br /&gt;
&lt;br /&gt;
=== MinGW compiler ===&lt;br /&gt;
&lt;br /&gt;
At the present time, Code::Blocks only compiles successfully with the MinGW compiler (or any other gcc for that matter). You will need a complete, working [[MinGW installation]].&lt;br /&gt;
&lt;br /&gt;
Since November 2007 MinGW-GCC 4.2.1&lt;br /&gt;
&lt;br /&gt;
=== wxWidgets ===&lt;br /&gt;
&lt;br /&gt;
[http://wxwidgets.org/ wxWidgets.org]&lt;br /&gt;
&lt;br /&gt;
Code::Blocks uses&lt;br /&gt;
* since 19 July 2008 wxWidgets 2.8.8 &amp;lt;br/&amp;gt;Download: [http://prdownloads.sourceforge.net/wxwindows/wxMSW-2.8.8.zip wxMSW-2.8.8.zip]&lt;br /&gt;
&lt;br /&gt;
* since 28 November 2007 wxWidgets 2.8.7 &amp;lt;br/&amp;gt;Download: [http://prdownloads.sourceforge.net/wxwindows/wxMSW-2.8.7.zip wxMSW-2.8.7.zip]&lt;br /&gt;
&lt;br /&gt;
* since November 2007 wxWidgets 2.8.6 &amp;lt;br/&amp;gt;Download: [http://prdownloads.sourceforge.net/wxwindows/wxMSW-2.8.6.zip wxMSW-2.8.6.zip]&lt;br /&gt;
&lt;br /&gt;
* since May 2007 wxWidgets 2.8.4&amp;lt;br/&amp;gt;Download: [http://prdownloads.sourceforge.net/wxwindows/wxMSW-2.8.4.zip wxMSW-2.8.4.zip]&lt;br /&gt;
&lt;br /&gt;
For latest infos check forum: [/index.php?topic=3299.0 Important changes to the nightly builds]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You do ''not'' need MSYS (''in fact, if you have MSYS, make sure it is not in your PATH when building wxWidgets'').&lt;br /&gt;
&lt;br /&gt;
=== SVN client ===&lt;br /&gt;
&lt;br /&gt;
In order to check out the Code::Blocks sources you will need a SVN client.&lt;br /&gt;
For convenience, it is recommended that you install [http://tortoisesvn.net/downloads TortoiseSVN] on your machine, as this is a lot more comfortable. However, if you get a bad feeling when some program is messing with your Explorer menu, then you can use the [http://subversion.tigris.org/project_packages.html svn command-line client] equally well.&lt;br /&gt;
&lt;br /&gt;
It is generally a good idea to install the command-line client (and adding it to PATH) even if you use TortoiseSVN for convenience. The &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; tool which is used during the build of Code::Blocks makes use of the &amp;lt;tt&amp;gt;svn&amp;lt;/tt&amp;gt; binary if it is available. This is preferable to the manual parsing of the entries file that is used as fall-back.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Please do note that working copies checked out with the 1.4 version of Subversion are no longer compatible with earlier versions (Subversion will transparently update existing repositories).&lt;br /&gt;
&lt;br /&gt;
The built-in fall-back mechanism in &amp;lt;tt&amp;gt;autorevision&amp;lt;/tt&amp;gt; has been updated to the new 1.4 format and will no longer work with the old format.&amp;lt;br&amp;gt;&lt;br /&gt;
Therefore, if you use a Subversion client from the 1.0-1.3 line, you ''must'' put the command line tool into &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; for a successful build.&amp;lt;br&amp;gt;&lt;br /&gt;
If you use Subversion 1.4, then it is good practice nevertheless, but you can do without, too.&lt;br /&gt;
&lt;br /&gt;
=== zip.exe ===&lt;br /&gt;
&lt;br /&gt;
You'll also need a working 'zip' program.&lt;br /&gt;
If you have the version listed on our [https://wiki.codeblocks.org/index.php?title=Mingw#Other_developer_tools tools page], you'll be fine.&lt;br /&gt;
&lt;br /&gt;
The zip program coming with cygwin will ''not'' work properly. You do ''not'' need WinZip.&lt;br /&gt;
&lt;br /&gt;
Make sure the zip binary is in your PATH so the &amp;lt;tt&amp;gt;update.bat&amp;lt;/tt&amp;gt; script will be able to find it (alternatively, you can edit the batch file, setting the ZIPCMD variable to something else).&lt;br /&gt;
&lt;br /&gt;
The easiest way is to put zip.exe into &amp;lt;tt&amp;gt;bin&amp;lt;/tt&amp;gt; inside your MinGW installation directory (that folder is normally in the path).&lt;br /&gt;
&lt;br /&gt;
=== Code::Blocks sources ===&lt;br /&gt;
&lt;br /&gt;
You will also (obviously) need the Code::Blocks sources. &lt;br /&gt;
&lt;br /&gt;
Using ''TortoiseSVN'', make a folder where you want to store the sources, right-click on the folder, and select &amp;quot;SVN Checkout...&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Image:Win svn checkout.png]]&lt;br /&gt;
&lt;br /&gt;
In the top box, enter svn://svn.berlios.de/codeblocks/trunk and hit the OK button.&lt;br /&gt;
&lt;br /&gt;
Using ''svn'', you have to open a command prompt (&amp;quot;DOS Window&amp;quot;). Make a folder, change directory, and run svn:&lt;br /&gt;
&lt;br /&gt;
  mkdir codeblocks-head&lt;br /&gt;
  cd codeblocks-head&lt;br /&gt;
  svn checkout svn://svn.berlios.de/codeblocks/trunk&lt;br /&gt;
&lt;br /&gt;
== Building ==&lt;br /&gt;
&lt;br /&gt;
=== Unicode Build ===&lt;br /&gt;
&lt;br /&gt;
==== Compile wxWidgets in Unicode mode ====&lt;br /&gt;
&lt;br /&gt;
After unpacking the zip file to a directory of your choice, open a cmd prompt, and navigate to the folder build/msw inside the wxWidgets folder. Use the following commands to compile wxWidgets:&lt;br /&gt;
&lt;br /&gt;
  set path=c:\mingw\bin;c:\mingw\mingw32\bin&lt;br /&gt;
  mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1  clean&lt;br /&gt;
  mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1&lt;br /&gt;
&lt;br /&gt;
This assumes your MinGW installation is in C:\mingw. Use a different path if you installed MinGW somewhere else.&lt;br /&gt;
&lt;br /&gt;
You will see a lot of warning messages during compilation. Don't worry, this is normal, you are compiling wxWidgets. The build process may take 10-30 minutes, depending on your computer's speed.&lt;br /&gt;
&lt;br /&gt;
''remark: If you want to use wxWidgets not only for building Code::Blocks, but also for writing wxWidgets programs, and if you want to use the debugger in those programs, you have to compile a debug build of wxWidgets as well.''&lt;br /&gt;
''Use the same commands as for the release build, but replace &amp;quot;release&amp;quot; by &amp;quot;debug&amp;quot;.''&lt;br /&gt;
&lt;br /&gt;
'''Optional:'''&lt;br /&gt;
&lt;br /&gt;
To reduce the size of your wxWidgets library, you can disable features which are not used by Code::Blocks. However, you should not do this unless you know what you are doing. You have to delete the generated setup.h from lib/gcc_dll/msw/wx before building, because your changes to include/wx/msw will otherwise not be honoured.&lt;br /&gt;
&lt;br /&gt;
==== Compile Code::Blocks ====&lt;br /&gt;
&lt;br /&gt;
Now, before this step, you have prepared all the stuff to build code::blocks. It's very interesting that we use code::blocks to build code::blocks binaries.&lt;br /&gt;
&lt;br /&gt;
*'''Open project:''' Open the project file '''CodeBlocks.cbp'''. You will be prompted to define the global variable $(#wx). Enter the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_variable.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Global_variable2.png]]&lt;br /&gt;
&lt;br /&gt;
*'''Compile project:''' Hit the blue gear and lean back. Compilation may take 3-5 minutes, depending on the speed of your computer.&lt;br /&gt;
&lt;br /&gt;
[[Image:Win build button.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Win build target.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Win build finish.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*'''Copy wxWidgets support DLL:''' After the compilation has finished, copy &amp;lt;tt&amp;gt;lib\gcc_dll\wxmsw28u_gcc_custom.dll&amp;lt;/tt&amp;gt; from the wxWidgets directory to the &amp;lt;tt&amp;gt;src\devel&amp;lt;/tt&amp;gt; directory inside the Code::Blocks source folder (it will also work if you keep a copy of that library in your Windows folder or anywhere in your system path, but this is generally not recommended because you can get into dll hell).&lt;br /&gt;
&lt;br /&gt;
[[Image:Win output folder.png]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Win copy dll.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* '''Runing script file:''' Run &amp;lt;tt&amp;gt;src\update.bat&amp;lt;/tt&amp;gt; (located in the root source directory). This will pack the resource files and copy libraries and plugins to their correct locations.&lt;br /&gt;
&lt;br /&gt;
[[Image:Win run bat.png]]&lt;br /&gt;
&lt;br /&gt;
The stripped (&amp;quot;production&amp;quot;) executable is found in &amp;lt;tt&amp;gt;output&amp;lt;/tt&amp;gt; together with all libraries and data files. If you want a version with debug symbols instead (caution: huge size!), use the one found in the &amp;lt;tt&amp;gt;devel&amp;lt;/tt&amp;gt; folder.&amp;lt;br&amp;gt;&lt;br /&gt;
Congratulations, you own a freshly built version of Code::Blocks!&lt;br /&gt;
&lt;br /&gt;
[[Image:Win final folder.png]]&lt;br /&gt;
&lt;br /&gt;
*'''Note for future updates:''' go into the Code::Blocks root directory and run &amp;lt;tt&amp;gt;svn update&amp;lt;/tt&amp;gt; (or use TurtoiseSVN to the same effect).&amp;lt;br/&amp;gt;&lt;br /&gt;
Then open and build the project as described before (and any contrib plugins that you wish to use), and re-run &amp;lt;tt&amp;gt;src\update.bat&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Install Code::Blocks ====&lt;br /&gt;
&lt;br /&gt;
Copy the folder output to where you want Code::Blocks to reside.&lt;br /&gt;
&lt;br /&gt;
==== Compile contributed (or your own) plugins ====&lt;br /&gt;
&lt;br /&gt;
The workspace file '''ContribPlugins.workspace''' contains the project files for all contributed plugins. Open that workspace and compile the plugins which you would like to use (or select &amp;quot;Build Workspace&amp;quot; from the context menu if you want them all).&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Contribute plugin.png]]&lt;br /&gt;
&lt;br /&gt;
When you open the contrib plugins workspace, you will be asked to define the &amp;lt;tt&amp;gt;$(#cb)&amp;lt;/tt&amp;gt; global compiler variable. This is the path that contains the sdk folder normally this is codeblocks\src. The build process uses this information to place the plugins and data files into the correct place. Enter the location of the Code::Blocks sources in the same way as for the &amp;lt;tt&amp;gt;$(#wx)&amp;lt;/tt&amp;gt; variable earlier.&lt;br /&gt;
&lt;br /&gt;
Don't forget to run update.bat again after building the contrib plugins.&lt;br /&gt;
&lt;br /&gt;
=== ANSI Build ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div style=&amp;quot;background-color: #f7d9d9; border: 1px solid #000&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;margin: 5px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== DEPRECATION WARNING: ====&lt;br /&gt;
As of February 2006, the official default build for Code::Blocks is '''Unicode''' (see above). Although ANSI builds are technically possible, we discourage their use unless there is a good reason.&amp;lt;br/&amp;gt;&lt;br /&gt;
''Support for ANSI builds is likely to be dropped after Version 1.0 is out.''&lt;br /&gt;
&lt;br /&gt;
There is hardly any good argument against using a Unicode build if your OS supports Unicode, even if you do not understand any other language than English, as a Unicode version guarantees that it will be able to work with whatever languages you may possibly encounter in the future -- at a very reasonable cost.&lt;br /&gt;
&lt;br /&gt;
However, if you absolutely don't care about Unicode or if you are bound to use Windows 95, then you may want to build an ANSI version nevertheless.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Compile wxWidgets in ANSI mode ====&lt;br /&gt;
&lt;br /&gt;
After unpacking the zip file to a directory of your choice, open a cmd prompt, and navigate to the folder build/msw inside the wxWidgets folder. Use the following commands to compile wxWidgets&lt;br /&gt;
&lt;br /&gt;
  set path=c:\mingw\bin;c:\mingw\mingw32\bin&lt;br /&gt;
  mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=0 clean&lt;br /&gt;
  mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=0&lt;br /&gt;
&lt;br /&gt;
This assumes your MinGW installation is in C:\mingw. Use a different path if you installed MinGW somewhere else.&lt;br /&gt;
&lt;br /&gt;
You will see a lot of warning messages during compilation. Don't worry, this is normal, you are compiling wxWidgets. The build process may take 10-30 minutes, depending on your computer's speed.&lt;br /&gt;
&lt;br /&gt;
'''Optional:'''&lt;br /&gt;
&lt;br /&gt;
To reduce the size of your wxWidgets library, you can disable features which are not used by Code::Blocks. However, you should not do this unless you know what you are doing. You have to delete the generated setup.h from lib/gcc_dll/msw/wx before building, because your changes to include/wx/msw will otherwise not be honoured.&lt;br /&gt;
&lt;br /&gt;
==== Compile Code::Blocks ====&lt;br /&gt;
&lt;br /&gt;
Open the project CodeBlocks.cbp. You will be prompted to define the global variable $(#wx) if you have not used it before. Enter the location where you unpacked wxWidgets.&lt;br /&gt;
&lt;br /&gt;
'''Important:'''  The project file is set to compile an Unicode version of Code::Blocks by default. To make an ANSI build, you have to make the following two changes to build options before compiling:&lt;br /&gt;
1. In the &amp;quot;Compiler&amp;quot; tab, under &amp;quot;#defines&amp;quot;, remove the entry wxUSE_UNICODE.&lt;br /&gt;
2. Under &amp;quot;Custom variables&amp;quot;, set the variable WX_SUFFIX to empty (default value: u).&lt;br /&gt;
&lt;br /&gt;
Hit the blue gear and lean back. Compilation may take 3-5 minutes, depending on the speed of your computer.&lt;br /&gt;
&lt;br /&gt;
After the compilation has finished, copy wxmsw28u_gcc_custom.dll from lib\gcc_dll inside the wxWidgets directory to the devel directory inside the Code::Blocks source folder (it will also work if you keep a copy of that library in your Windows folder or anywhere in your system path, but this is generally not recommended because you can get into [http://en.wikipedia.org/wiki/DLL_hell dll hell] ).&lt;br /&gt;
Run update.bat (located in the root source directory). This will pack the resource files and copy libraries and plugins to their correct locations.&lt;br /&gt;
The location of executable is src\output in C::B tree. From here you'll not need the nightly build anymore.&lt;br /&gt;
&lt;br /&gt;
One little note for svn updates and rebuilds : just go into the codeblocks root directory and do '''svn update''' (or use Turtoise svn).&lt;br /&gt;
&lt;br /&gt;
Then run the src/output/codeblocks.exe, reload project, build it, reload plugins workspace, build it, quit codeblocks and re-run update.bat. You'll have an up-to-date C::B in 3 minutes !&lt;br /&gt;
&lt;br /&gt;
==== Install Code::Blocks ====&lt;br /&gt;
&lt;br /&gt;
Copy the folder output to where you want Code::Blocks to reside.&lt;br /&gt;
&lt;br /&gt;
==== Compile contributed (or your own) plugins ====&lt;br /&gt;
&lt;br /&gt;
The workspace file ContribPlugins.workspace contains the project files for all contributed plugins. Open that workspace and compile the plugins which you would like to use (or select &amp;quot;Build Workspace&amp;quot; from the context menu if you want them all). Don't forget to run update.bat again after building the contrib plugins.&lt;/div&gt;</summary>
		<author><name>Frithjofh</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_the_latest_official_version_of_Code::Blocks_on_Windows&amp;diff=5867</id>
		<title>Installing the latest official version of Code::Blocks on Windows</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Installing_the_latest_official_version_of_Code::Blocks_on_Windows&amp;diff=5867"/>
		<updated>2009-03-05T18:40:49Z</updated>

		<summary type="html">&lt;p&gt;Frithjofh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installing Code::Blocks]]&lt;br /&gt;
[[Category:Installing the latest official version of Code::Blocks]]&lt;br /&gt;
&lt;br /&gt;
=== Install steps ===&lt;br /&gt;
&lt;br /&gt;
# [https://www.codeblocks.org/downloads/5 Download the Code::Blocks 8.02 installer]. If you know you don't have MinGW installed, download the package which has MinGW bundled.&lt;br /&gt;
# Run the installer, it's a standard installer for Windows; just press Next after reading each screen.&lt;br /&gt;
# If you're planning installing a compiler after you've installed Code::Blocks, read the information provided in the installer.&lt;br /&gt;
# If you downloaded the installer which doesn't come with MinGW, you may have to configure the compiler manually (usually Code::Blocks' auto detects the compiler).&lt;/div&gt;</summary>
		<author><name>Frithjofh</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks&amp;diff=5864</id>
		<title>Installing Code::Blocks</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks&amp;diff=5864"/>
		<updated>2009-03-04T22:59:04Z</updated>

		<summary type="html">&lt;p&gt;Frithjofh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installing Code::Blocks]]&lt;br /&gt;
&lt;br /&gt;
[[Compiled packages of Code::Blocks]]&lt;br /&gt;
&lt;br /&gt;
== MS Windows ==&lt;br /&gt;
&lt;br /&gt;
* [[Installing the latest official version of Code::Blocks on Windows]]&lt;br /&gt;
* [[Installing Code::Blocks nightly build on Windows]]&lt;br /&gt;
* [[Installing Code::Blocks from source on Windows]]&lt;br /&gt;
&lt;br /&gt;
== Linux ==&lt;br /&gt;
&lt;br /&gt;
* [[Installing Code::Blocks from source on Linux]] (applies to all distros)&lt;br /&gt;
* [[Installing Code::Blocks before SVN 3893 from source on Linux]] (applies to all distros)&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu ===&lt;br /&gt;
&lt;br /&gt;
:* [[Installing Code::Blocks nightly build on Ubuntu]]&lt;br /&gt;
&lt;br /&gt;
=== Debian ===&lt;br /&gt;
&lt;br /&gt;
:* [http://jens.lody.name/debian/ Installing Code::Blocks nightly build on Debian]&lt;br /&gt;
&lt;br /&gt;
=== Fedora ===&lt;br /&gt;
&lt;br /&gt;
:* [[Installing Code::Blocks nightly build on Fedora]]&lt;br /&gt;
&lt;br /&gt;
=== Blag ===&lt;br /&gt;
&lt;br /&gt;
:* [[Installing Code::Blocks nightly build on Blag]]&lt;br /&gt;
&lt;br /&gt;
=== Gentoo ===&lt;br /&gt;
&lt;br /&gt;
:* [[Installing Code::Blocks from source on Gentoo]]&lt;br /&gt;
&lt;br /&gt;
=== RPM based distributions ===&lt;br /&gt;
&lt;br /&gt;
Such as: Red Hat Linux, Yellow Dog Linux, Fedora Core, CentOS, etc. etc.&lt;br /&gt;
&lt;br /&gt;
:* [[Installing Code::Blocks nightly build on RPM based distributions]]&lt;br /&gt;
:* [[Installing Code::Blocks from source on RPM based distributions]]&lt;br /&gt;
&lt;br /&gt;
== BSD ==&lt;br /&gt;
&lt;br /&gt;
=== FreeBSD ===&lt;br /&gt;
&lt;br /&gt;
:* [[Installing Code::Blocks from source on FreeBSD]]&lt;br /&gt;
&lt;br /&gt;
== Solaris ==&lt;br /&gt;
&lt;br /&gt;
* [[Installing Code::Blocks from source on Solaris]]&lt;br /&gt;
&lt;br /&gt;
== Mac OS X ==&lt;br /&gt;
&lt;br /&gt;
* [[Installing Code::Blocks nightly build on Mac OS X]]&lt;br /&gt;
&lt;br /&gt;
* [[Installing Code::Blocks from source on Mac OS X]]&lt;br /&gt;
&lt;br /&gt;
==Working on Code::Blocks sources from within Code::Blocks!==&lt;br /&gt;
&lt;br /&gt;
The following applies for all platforms where you have Code::Blocks installed and working.&lt;br /&gt;
&lt;br /&gt;
After correct install of Code::Blocks you will find two folders under .../trunc/scr , a directory named &amp;quot;devel&amp;quot; and another one named &amp;quot;output&amp;quot;.&lt;br /&gt;
These two folders will contain the same files and directory structure and you can use the IDE from either of these two directories. This structure has been created so that you can work in Code::Blocks while editing Code::Blocks' sources ;).&lt;br /&gt;
Basically, you 'll be using the &amp;quot;output/CodeBlocks.exe&amp;quot; executable. Code::Blocks' project settings are such that all output goes under &amp;quot;devel&amp;quot;. So you can edit Code::Blocks' sources inside Code::Blocks and, when pressing &amp;quot;Run&amp;quot;, it will run the &amp;quot;devel/CodeBlocks.exe&amp;quot; executable ;). This way, you can't ruin the main executable you 're using (under &amp;quot;output&amp;quot;). When your changes satisfy you and all works well, quit Code::Blocks, run &amp;quot;make update&amp;quot; from command line and re-launch &amp;quot;output/CodeBlocks.exe&amp;quot;. You 'll be working on your brand new IDE!&lt;/div&gt;</summary>
		<author><name>Frithjofh</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks&amp;diff=5863</id>
		<title>Installing Code::Blocks</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks&amp;diff=5863"/>
		<updated>2009-03-04T22:58:23Z</updated>

		<summary type="html">&lt;p&gt;Frithjofh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installing Code::Blocks]]&lt;br /&gt;
&lt;br /&gt;
[[Compiled packages of Code::Blocks]]&lt;br /&gt;
&lt;br /&gt;
== MS Windows ==&lt;br /&gt;
&lt;br /&gt;
* [[Installing the latest official version of Code::Blocks on Windows]]&lt;br /&gt;
* [[Installing Code::Blocks nightly build on Windows]]&lt;br /&gt;
* [[Installing Code::Blocks from source on Windows]]&lt;br /&gt;
&lt;br /&gt;
== Linux ==&lt;br /&gt;
&lt;br /&gt;
* [[Installing Code::Blocks from source on Linux]] (applies to all distros)&lt;br /&gt;
* [[Installing Code::Blocks before SVN 3893 from source on Linux]] (applies to all distros)&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu ===&lt;br /&gt;
&lt;br /&gt;
:* [[Installing Code::Blocks nightly build on Ubuntu]]&lt;br /&gt;
&lt;br /&gt;
=== Debian ===&lt;br /&gt;
&lt;br /&gt;
:* [http://jens.lody.name/debian/ Installing Code::Blocks nightly build on Debian]&lt;br /&gt;
&lt;br /&gt;
=== Fedora ===&lt;br /&gt;
&lt;br /&gt;
:* [[Installing Code::Blocks nightly build on Fedora]]&lt;br /&gt;
&lt;br /&gt;
=== Blag ===&lt;br /&gt;
&lt;br /&gt;
:* [[Installing Code::Blocks nightly build on Blag]]&lt;br /&gt;
&lt;br /&gt;
=== Gentoo ===&lt;br /&gt;
&lt;br /&gt;
:* [[Installing Code::Blocks from source on Gentoo]]&lt;br /&gt;
&lt;br /&gt;
=== RPM based distributions ===&lt;br /&gt;
&lt;br /&gt;
Such as: Red Hat Linux, Yellow Dog Linux, Fedora Core, CentOS, etc. etc.&lt;br /&gt;
&lt;br /&gt;
:* [[Installing Code::Blocks nightly build on RPM based distributions]]&lt;br /&gt;
:* [[Installing Code::Blocks from source on RPM based distributions]]&lt;br /&gt;
&lt;br /&gt;
== BSD ==&lt;br /&gt;
&lt;br /&gt;
=== FreeBSD ===&lt;br /&gt;
&lt;br /&gt;
:* [[Installing Code::Blocks from source on FreeBSD]]&lt;br /&gt;
&lt;br /&gt;
== Solaris ==&lt;br /&gt;
&lt;br /&gt;
* [[Installing Code::Blocks from source on Solaris]]&lt;br /&gt;
&lt;br /&gt;
== Mac OS X ==&lt;br /&gt;
&lt;br /&gt;
* [[Installing Code::Blocks nightly build on Mac OS X]]&lt;br /&gt;
&lt;br /&gt;
* [[Installing Code::Blocks from source on Mac OS X]]&lt;br /&gt;
&lt;br /&gt;
==Working on Code::Blocks sources from within Code::Blocks!==&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------------&lt;br /&gt;
The following apply for all platforms where you have Code::Blocks installed and working.&lt;br /&gt;
&lt;br /&gt;
After correct install of Code::Blocks you will find two folders under .../trunc/scr , a directory named &amp;quot;devel&amp;quot; and another one named &amp;quot;output&amp;quot;.&lt;br /&gt;
These two folders will contain the same files and directory structure and you can use the IDE from either of these two directories. This structure has been created so that you can work in Code::Blocks while editing Code::Blocks' sources ;).&lt;br /&gt;
Basically, you 'll be using the &amp;quot;output/CodeBlocks.exe&amp;quot; executable. Code::Blocks' project settings are such that all output goes under &amp;quot;devel&amp;quot;. So you can edit Code::Blocks' sources inside Code::Blocks and, when pressing &amp;quot;Run&amp;quot;, it will run the &amp;quot;devel/CodeBlocks.exe&amp;quot; executable ;). This way, you can't ruin the main executable you 're using (under &amp;quot;output&amp;quot;). When your changes satisfy you and all works well, quit Code::Blocks, run &amp;quot;make update&amp;quot; from command line and re-launch &amp;quot;output/CodeBlocks.exe&amp;quot;. You 'll be working on your brand new IDE!&lt;/div&gt;</summary>
		<author><name>Frithjofh</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks&amp;diff=5862</id>
		<title>Installing Code::Blocks</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks&amp;diff=5862"/>
		<updated>2009-03-04T22:57:45Z</updated>

		<summary type="html">&lt;p&gt;Frithjofh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installing Code::Blocks]]&lt;br /&gt;
&lt;br /&gt;
[[Compiled packages of Code::Blocks]]&lt;br /&gt;
&lt;br /&gt;
== MS Windows ==&lt;br /&gt;
&lt;br /&gt;
* [[Installing the latest official version of Code::Blocks on Windows]]&lt;br /&gt;
* [[Installing Code::Blocks nightly build on Windows]]&lt;br /&gt;
* [[Installing Code::Blocks from source on Windows]]&lt;br /&gt;
&lt;br /&gt;
== Linux ==&lt;br /&gt;
&lt;br /&gt;
* [[Installing Code::Blocks from source on Linux]] (applies to all distros)&lt;br /&gt;
* [[Installing Code::Blocks before SVN 3893 from source on Linux]] (applies to all distros)&lt;br /&gt;
&lt;br /&gt;
=== Ubuntu ===&lt;br /&gt;
&lt;br /&gt;
:* [[Installing Code::Blocks nightly build on Ubuntu]]&lt;br /&gt;
&lt;br /&gt;
=== Debian ===&lt;br /&gt;
&lt;br /&gt;
:* [http://jens.lody.name/debian/ Installing Code::Blocks nightly build on Debian]&lt;br /&gt;
&lt;br /&gt;
=== Fedora ===&lt;br /&gt;
&lt;br /&gt;
:* [[Installing Code::Blocks nightly build on Fedora]]&lt;br /&gt;
&lt;br /&gt;
=== Blag ===&lt;br /&gt;
&lt;br /&gt;
:* [[Installing Code::Blocks nightly build on Blag]]&lt;br /&gt;
&lt;br /&gt;
=== Gentoo ===&lt;br /&gt;
&lt;br /&gt;
:* [[Installing Code::Blocks from source on Gentoo]]&lt;br /&gt;
&lt;br /&gt;
=== RPM based distributions ===&lt;br /&gt;
&lt;br /&gt;
Such as: Red Hat Linux, Yellow Dog Linux, Fedora Core, CentOS, etc. etc.&lt;br /&gt;
&lt;br /&gt;
:* [[Installing Code::Blocks nightly build on RPM based distributions]]&lt;br /&gt;
:* [[Installing Code::Blocks from source on RPM based distributions]]&lt;br /&gt;
&lt;br /&gt;
== BSD ==&lt;br /&gt;
&lt;br /&gt;
=== FreeBSD ===&lt;br /&gt;
&lt;br /&gt;
:* [[Installing Code::Blocks from source on FreeBSD]]&lt;br /&gt;
&lt;br /&gt;
== Solaris ==&lt;br /&gt;
&lt;br /&gt;
* [[Installing Code::Blocks from source on Solaris]]&lt;br /&gt;
&lt;br /&gt;
== Mac OS X ==&lt;br /&gt;
&lt;br /&gt;
* [[Installing Code::Blocks nightly build on Mac OS X]]&lt;br /&gt;
&lt;br /&gt;
* [[Installing Code::Blocks from source on Mac OS X]]&lt;br /&gt;
&lt;br /&gt;
===Working on Code::Blocks sources from within Code::Blocks!===&lt;br /&gt;
&lt;br /&gt;
---------------------------------------------------------&lt;br /&gt;
The following apply for all platforms where you have Code::Blocks installed and working.&lt;br /&gt;
&lt;br /&gt;
After correct install of Code::Blocks you will find two folders under .../trunc/scr , a directory named &amp;quot;devel&amp;quot; and another one named &amp;quot;output&amp;quot;.&lt;br /&gt;
These two folders will contain the same files and directory structure and you can use the IDE from either of these two directories. This structure has been created so that you can work in Code::Blocks while editing Code::Blocks' sources ;).&lt;br /&gt;
Basically, you 'll be using the &amp;quot;output/CodeBlocks.exe&amp;quot; executable. Code::Blocks' project settings are such that all output goes under &amp;quot;devel&amp;quot;. So you can edit Code::Blocks' sources inside Code::Blocks and, when pressing &amp;quot;Run&amp;quot;, it will run the &amp;quot;devel/CodeBlocks.exe&amp;quot; executable ;). This way, you can't ruin the main executable you 're using (under &amp;quot;output&amp;quot;). When your changes satisfy you and all works well, quit Code::Blocks, run &amp;quot;make update&amp;quot; from command line and re-launch &amp;quot;output/CodeBlocks.exe&amp;quot;. You 'll be working on your brand new IDE!&lt;/div&gt;</summary>
		<author><name>Frithjofh</name></author>
	</entry>
	<entry>
		<id>https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux&amp;diff=5861</id>
		<title>Installing Code::Blocks from source on Linux</title>
		<link rel="alternate" type="text/html" href="https://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Linux&amp;diff=5861"/>
		<updated>2009-03-04T22:54:58Z</updated>

		<summary type="html">&lt;p&gt;Frithjofh: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Installing Code::Blocks]]&lt;br /&gt;
[[Category:Installing Code::Blocks from source]]&lt;br /&gt;
These are instructions on how to build Code::Blocks under Linux. These instructions should work for all Linux distros, as we'll be installing from sources.&lt;br /&gt;
&lt;br /&gt;
===Prerequisites===&lt;br /&gt;
&lt;br /&gt;
In order to successfully compile Code::Blocks, the wxWidgets (&amp;lt;u&amp;gt;wxGTK-2.8.0 or later&amp;lt;/u&amp;gt;) cross-platform UI library &amp;lt;u&amp;gt;must be installed&amp;lt;/u&amp;gt;. In this document, it is not assumed that it is already installed in your system and instructions are given on how to download, build and install it.&lt;br /&gt;
What is '''not''' covered here, is the wxWidgets prerequisites. The most important being GTK2, of course!&lt;br /&gt;
Let me stress it here, while it's early: &amp;lt;u&amp;gt;GTK2 is required&amp;lt;/u&amp;gt;, not GTK1, for Code::Blocks to be operational.&lt;br /&gt;
&lt;br /&gt;
You do not need to Compile wxWidgets if your distribution has wxGTK 2.8 and wxGTK 2.8-dev package available.  A quick search for &amp;quot;wxGTK&amp;quot; through your respective package manager should show bring up the needed packages.  After you have installed successfully you can moving on the the Installing Code::Blocks portion.  If you are using Ubuntu and have installed the wxGTK package, you must also have the dev version as well as the &amp;quot;wx-common&amp;quot; package in order to successfully compile Code::Blocks.&lt;br /&gt;
&lt;br /&gt;
All the instructions below, assume an existing directory named &amp;lt;tt&amp;gt;~/devel&amp;lt;/tt&amp;gt;. If you 'll be using a different one, adjust the path to match.&lt;br /&gt;
As a first step create this directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;mkdir ~/devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===wxGTK installation===&lt;br /&gt;
&lt;br /&gt;
====Getting wxGTK====&lt;br /&gt;
&lt;br /&gt;
Visit the [http://www.wxwidgets.org wxWidgets web site]. Click the &amp;quot;Download&amp;quot; button at the top of the page. Under wxWidgets 2.8.7 downloads, select wxGTK. Save the file in &amp;lt;tt&amp;gt;~/devel&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
====Uncompressing the wxGTK sources====&lt;br /&gt;
&lt;br /&gt;
After the download finishes, switch to &amp;lt;tt&amp;gt;~/devel&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ~/devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, untar the wxGTK sources:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;tar zxf wxGTK-2.8.7.tar.gz&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Switch to the wxGTK directory&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd wxGTK-2.8.7&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====wxWidgets build====&lt;br /&gt;
&lt;br /&gt;
Here we will create a seperate build directory instead of building from the src directory, so that we can easily rebuild with different options (unicode / ansi, monolithic / many libs, etc).&lt;br /&gt;
&lt;br /&gt;
The documentation says the default is for gtk2 to use unicode and wx &amp;gt; 2.5 to build as a monolithic library.  This doesn't appear to be the case, so these flags are passed to configure.&lt;br /&gt;
&lt;br /&gt;
 mkdir build_gtk2_shared_monolithic_unicode&lt;br /&gt;
 cd build_gtk2_shared_monolithic_unicode&lt;br /&gt;
 ../configure --prefix=/opt/wx/2.8 \&lt;br /&gt;
        --enable-xrc \&lt;br /&gt;
        --enable-monolithic \&lt;br /&gt;
        --enable-unicode&lt;br /&gt;
 make&lt;br /&gt;
 su&lt;br /&gt;
 make install&lt;br /&gt;
 exit&lt;br /&gt;
&lt;br /&gt;
Add /opt/wx/2.8/bin to the PATH (if you're shell is bash then edit /etc/profile or ~/.bash_profile)&lt;br /&gt;
(On Suse 10.1 edit /etc/profile.local, it will only be available after a new login).  an example PATH&lt;br /&gt;
 export PATH=/usr/bin:/opt/wx/2.8/bin:$PATH&lt;br /&gt;
&lt;br /&gt;
'''Note:''' On Ubuntu Hoary it was necessary to check &amp;quot;Run command as login shell&amp;quot; &lt;br /&gt;
in the gnome-terminal profile-settings, otherwise the PATH changes are not available in a gnome-terminal window.&lt;br /&gt;
&lt;br /&gt;
add /opt/wx/2.8/lib to /etc/ld.so.conf (nano /etc/ld.so.conf)&lt;br /&gt;
then run:&lt;br /&gt;
 ldconfig&lt;br /&gt;
 source /etc/profile&lt;br /&gt;
&lt;br /&gt;
That's it.  Now the linker will look in /opt/wx/2.8/lib for wx libraries and you will have a monolithic shared library unicode build.&lt;br /&gt;
&lt;br /&gt;
To check that things are working, type:&lt;br /&gt;
 wx-config --prefix&lt;br /&gt;
which should give you /opt/wx/2.8&lt;br /&gt;
 wx-config --libs&lt;br /&gt;
which should have at least&lt;br /&gt;
 -L/opt/wx/2.8/lib -lwx_gtk2-2.8&lt;br /&gt;
but can contain other flags as well.&lt;br /&gt;
 which wx-config&lt;br /&gt;
should return /opt/wx/2.8/bin/wx-config&lt;br /&gt;
&lt;br /&gt;
===Code::Blocks installation===&lt;br /&gt;
&lt;br /&gt;
====Downloading Code::Blocks====&lt;br /&gt;
&lt;br /&gt;
You can get Code::Blocks source code in one way:&lt;br /&gt;
* Get the latest sources from the SVN repository.&lt;br /&gt;
This method is described below.&lt;br /&gt;
&lt;br /&gt;
=====Getting the latest sources from SVN=====&lt;br /&gt;
'''IMPORTANT NOTICE: The Sourceforge CVS is no longer used although it still exists'''&lt;br /&gt;
&lt;br /&gt;
Enter your development directory:&lt;br /&gt;
&amp;lt;pre&amp;gt;cd ~/devel&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then checkout the source using one of [https://www.codeblocks.org/downloads/7 these] methods.&lt;br /&gt;
&lt;br /&gt;
This will create the directory &amp;lt;tt&amp;gt;trunk&amp;lt;/tt&amp;gt;.&lt;br /&gt;
Change to the source code directory, by issuing the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;cd trunk&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Building Code::Blocks SVN====&lt;br /&gt;
If you are a Gentoo user, please see [[Compiling_Code::Blocks_in_Gentoo]].&lt;br /&gt;
&lt;br /&gt;
Before beginning, it is often a good idea to check you have recent versions of autoconf and automake - repositories versions are not always recent enough. (if you do not have automake, then you will get &amp;quot;cannot find aclocal&amp;quot; error).&lt;br /&gt;
&lt;br /&gt;
If you're compiling the svn trunk versions of CodeBlocks (or future versions) then the unix build has switched to autotools.  So first build wxWidgets as described above and then build CodeBlocks as follows:&lt;br /&gt;
&lt;br /&gt;
 ./bootstrap&lt;br /&gt;
&lt;br /&gt;
This sets up the configure script and its dependencies.  It only needs to be run once (after downloading the source from svn).  '''If you get errors like:'''&lt;br /&gt;
 aclocal:configure.in:61: warning: macro `AM_OPTIONS_WXCONFIG' not found in library&lt;br /&gt;
Then aclocal is having trouble finding the wxWidgets .m4 files.  You can do one of two things:&lt;br /&gt;
To just get bootstrap to find the path this time do:&lt;br /&gt;
&amp;lt;!-- *********** Bad syntax... removed 2006-08-28 by BentFX ****************************&lt;br /&gt;
 export ACLOCAL_FLAGS=&amp;quot;--acdir=`wx-config --prefix`/share/aclocal&amp;quot;&lt;br /&gt;
&lt;br /&gt;
: Note: The above command resulted in missing macros when running ./bootstrap for me. Setting an additional search path instead of overwriting like above worked for me. In case of missing macros try &lt;br /&gt;
***********************************************************************************--&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;export ACLOCAL_FLAGS=&amp;quot;-I `wx-config --prefix`/share/aclocal&amp;quot;&amp;lt;/pre&amp;gt; &amp;lt;!--[[User:Jabber|Jabber]] 06:24, 2 August 2006 (EDT)--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To change the aclocal search path more permanently do:&lt;br /&gt;
 echo `wx-config --prefix`/share/aclocal &amp;gt;&amp;gt; /usr/share/aclocal/dirlist&lt;br /&gt;
Then aclocal will also search somewhere like /opt/wx/2.6/share/aclocal&lt;br /&gt;
&lt;br /&gt;
'''Note for Ubuntu users:''' The above is not the correct way to fix the AM_* errors. Rather, you only need to install the package named &amp;quot;wx-common&amp;quot; (Universe repository).&lt;br /&gt;
&lt;br /&gt;
If you get something like&lt;br /&gt;
 The usual way to define `LIBTOOL' is to add `AC_PROG_LIBTOOL'&lt;br /&gt;
&lt;br /&gt;
it can be solved by something like: (adapt path, use `wx-config --prefix` is necessary)&lt;br /&gt;
&lt;br /&gt;
 ACLOCAL_FLAGS=&amp;quot;-I /usr/share/aclocal&amp;quot; ./bootstrap&lt;br /&gt;
&lt;br /&gt;
(*Note// '''If you run ./bootstrap and get errors like''':&lt;br /&gt;
 : bad interpreter: File not found&lt;br /&gt;
then there exists a problem with DOS line-endings. i had this error after i tried to build a  codeblocks from sources which were checked out with cvs on a windows machine. After i checked out a fresh copy of codeblocks from cvs under Ubuntu linux (see above topic: Downloading the latest source package fom SVN), all errors were gone. &lt;br /&gt;
//tiwag 051008*)&amp;lt;br&amp;gt;&lt;br /&gt;
Or, instead of downloading from SVN, you might consider using the little command line tool dos2unix, which normally comes with most distributions. //lizzarddude060103&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
If configure aborts with some unspecific error message(&amp;quot;.infig.status: error: cannot find input file: Makefile&amp;quot;), you might consider also running&lt;br /&gt;
 dos2unix bootstrap acinclude.m4 codeblocks.pc.in configure.in Makefile.am&lt;br /&gt;
before running bootstrap&lt;br /&gt;
&lt;br /&gt;
Once you've run the bootstrap script, installing is as simple as:&lt;br /&gt;
 ./configure&lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
If you have multiple versions of wxWidgets installed or kept them inplace, you can use&lt;br /&gt;
./configure --with-wx-config=/path/to/wx-config&lt;br /&gt;
&lt;br /&gt;
To uninstall you can later run:&lt;br /&gt;
 make uninstall&lt;br /&gt;
&lt;br /&gt;
If you want to recompile everything, first run:&lt;br /&gt;
 make clean&lt;br /&gt;
 make distclean&lt;br /&gt;
 make clean-bin&lt;br /&gt;
 make clean-zipfiles&lt;br /&gt;
and then follow the above sequence for installing.&lt;br /&gt;
&lt;br /&gt;
By default, CodeBlocks will install to /usr/local.  If you want it in its own tree (so you can have multiple versions of CodeBlocks, each in its own subdirectory of /opt) replace the above ./configure command with:&lt;br /&gt;
 ./configure --prefix=/opt/codeblocks-svn&lt;br /&gt;
or similar.  Then you can later install a different build like:&lt;br /&gt;
 ./configure --prefix=/opt/codeblocks2-svn&lt;br /&gt;
followed by 'make &amp;amp;&amp;amp; make install' as usual.&lt;br /&gt;
&lt;br /&gt;
By default, CodeBlocks will not compile the contributed plugins from SVN.  If you want to compile / install them too, replace the above ./configure command with:&lt;br /&gt;
 ./configure --with-contrib-plugins=all&lt;br /&gt;
followed by 'make &amp;amp;&amp;amp; make install' as usual.&lt;br /&gt;
&lt;br /&gt;
To see a list of other options available for configuring the build of CodeBlocks do:&lt;br /&gt;
 ./configure --help&lt;br /&gt;
&lt;br /&gt;
To compile under gentoo, use&lt;br /&gt;
 ./configure --with-wx-config=wx-config-2.8&lt;br /&gt;
&lt;br /&gt;
====Resolving issues with Code::Blocks SVN====&lt;br /&gt;
&lt;br /&gt;
When running Code::Blocks after the installation it might happen, that the system complains:&lt;br /&gt;
 codeblocks: error while loading shared libraries: libcodeblocks.so.0: cannot open shared object file: No such file or directory&lt;br /&gt;
In that case make sure the library path where the Code::Blocks libraries where installed into is &amp;quot;known&amp;quot; to the system. For example: On Ubuntu using a default build process on a clean system will install the Code::Blocks executables to /use/local/bin and the libraries to /usr/local/lib. The latter is usually not known to a &amp;quot;clean&amp;quot; Ubuntu system. To add it to the search path for libraries do the following (as root / using sudo respectively):&lt;br /&gt;
Add the following line to the file /etc/ld.so.conf:&lt;br /&gt;
 /usr/local/lib&lt;br /&gt;
...and run:&lt;br /&gt;
 ldconfig&lt;br /&gt;
That's it - Code::Blocks should now work just fine as all libraries are being found.&lt;/div&gt;</summary>
		<author><name>Frithjofh</name></author>
	</entry>
</feed>