News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

Having Problems with code completion

Started by weaver4, April 10, 2015, 09:11:20 PM

Previous topic - Next topic

weaver4

I am using CB version 13.12 under Ubuntu.

I have the following code:

This code compiles correctly and runs correctly.  But when I type:

"s." The code competion come up and shows me all of the functions for string.

But when I type:
"tmp."  Nothing comes up, even after pressing cntr-j or cntr-space.  If I hover over the tmp variable it knows that it is type "Category".  The compiler can find the log4cpp/*.hh files.

Is there something that I am not setting up correctly?



#include <iostream>
#include <string>
#include "log4cpp/Category.hh"
#include "log4cpp/Appender.hh"
#include "log4cpp/FileAppender.hh"
#include "log4cpp/OstreamAppender.hh"
#include "log4cpp/Layout.hh"
#include "log4cpp/BasicLayout.hh"
#include "log4cpp/Priority.hh"
#include "log4cpp/PropertyConfigurator.hh"

using namespace std;

int main()
{
    cout << "Hello world!" << endl;
   
    string s;
   
    log4cpp::PropertyConfigurator::configure("/etc/jps-audioproc/log4cpp.properties");
    log4cpp::Category& tmp = log4cpp::Category::getRoot();
   
    s.      // shows me all of the choices
    tmp.  // shows me no choices.

}


ollydbg

Would you mind to try a more recent version of C::B? Such as the nightly build version or you can build it yourself.
It may be already fixed in the trunk.
If the bug still exists, please file a ticket to our Tickets system in: http://sourceforge.net/projects/codeblocks/
Thank you.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

weaver4

I should of mentioned ... I am using Ubuntu for ARM, not Intel.

So I don't think there are binaries for me; so I need to a build.

But I could not find the correct place to get the nightly source code.

Unfortunately my company's firewall makes it very difficult to work with external subversion servers.

Is there a link?

Thanks,

MortenMacFly

Quote from: weaver4 on April 13, 2015, 01:48:35 PM
Is there a link?
Just install C::B on a stick, make it portable (see the Wiki) and then you can copy it to any PC. Actually there is no installation not internet access required.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

ollydbg

Quote from: weaver4 on April 13, 2015, 01:48:35 PM
I should of mentioned ... I am using Ubuntu for ARM, not Intel.

So I don't think there are binaries for me; so I need to a build.

But I could not find the correct place to get the nightly source code.

Unfortunately my company's firewall makes it very difficult to work with external subversion servers.

Is there a link?

Thanks,
In this page: https://sourceforge.net/p/codeblocks/code/HEAD/tree/
Download the source package by click the "Download Snapshot" key.

Also, I think you can download from the mirror, like: https://github.com/obfuscated/codeblocks_sf
Just click the "Download Zip" button.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

weaver4

I downloaded the latest version (April 14th) and got it up and running.

But I still have the same issue.  It is odd that it seems to know the myLog is a * to Category but does not know how to parse it.

Here is the way that myLog it is initialized, it is a static variable:

log4cpp::Category* CSipStack::myLog = LogUtil::getLogger("CSipStack");

What else should I try?

ollydbg

Hi, I just download the log4cpp and try to test it.

I have a very simple code:

#include "log4cpp/Category.hh"

int main()
{
    log4cpp::Category a;
    a.
}


I also don't see the suggestion list.
So, I debugged our CC under C::B, and I finally found that we did miss the option here, see image below:

After setting this "hh" to the options, I have now solved the issue, see the image show below:
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

MortenMacFly

Quote from: ollydbg on April 27, 2015, 05:11:15 AM
So, I debugged our CC under C::B, and I finally found that we did miss the option here, see image below:
OK, but then you should also add *.hxx because its another obscure ending for C++ header files.
Edit: BTW, I have "h,hpp,hxx,hh,h++,tcc,xpm" there...?!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]