Author Topic: Having Problems with code completion  (Read 4182 times)

Offline weaver4

  • Single posting newcomer
  • *
  • Posts: 9
Having Problems with code completion
« on: April 10, 2015, 09:11:20 pm »
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?


Code
#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.

}


Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5914
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Having Problems with code completion
« Reply #1 on: April 11, 2015, 04:20:01 pm »
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.

Offline weaver4

  • Single posting newcomer
  • *
  • Posts: 9
Re: Having Problems with code completion
« Reply #2 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,

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Having Problems with code completion
« Reply #3 on: April 13, 2015, 08:44:41 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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5914
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Having Problems with code completion
« Reply #4 on: April 14, 2015, 05:14:35 am »
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.

Offline weaver4

  • Single posting newcomer
  • *
  • Posts: 9
Re: Having Problems with code completion
« Reply #5 on: April 21, 2015, 04:50:59 pm »
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?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5914
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Having Problems with code completion
« Reply #6 on: April 27, 2015, 05:11:15 am »
Hi, I just download the log4cpp and try to test it.

I have a very simple code:
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.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Having Problems with code completion
« Reply #7 on: April 27, 2015, 07:49:53 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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ