Author Topic: Code completion problem  (Read 11383 times)

Offline Pelleschi

  • Multiple posting newcomer
  • *
  • Posts: 11
Code completion problem
« on: July 11, 2011, 04:21:27 pm »
Hello,
I inform, i am not well in english, so scuse me !
Before, i solved the problem of the backspace, i have modified the xorg.conf ...
Now, I have a problem with the Code completion, it doesnt work automatically.
In C++, with an object, when i write the ".", it doesnt list all methods of the object, you see ?
Even if i type Ctrl+Backspace it doesnt work ... (but if i type Ctrl+Backspace in front of nothing, it list all type, all object ...)
How can I resolve my problem ?
Thanks !

ps : I am 13 and in france at shcool, the english level is so bad ...

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Code completion problem
« Reply #1 on: July 11, 2011, 04:26:56 pm »
welcome!!
please post the sample/test code, and tell us how to reproduce such kind of bug, so that we can fix it.
Also, which version of c::b did you use???
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 Pelleschi

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Code completion problem
« Reply #2 on: July 11, 2011, 05:50:35 pm »
I use Code::blocks 10.05, finally the last release (64 bit, Archlinux).
All example doesnt work with me, in C++, a point (.) after an object doesnt list them methods, you see ?


Offline Folco

  • Regular
  • ***
  • Posts: 343
    • Folco's blog (68k lover)
Re: Code completion problem
« Reply #3 on: July 11, 2011, 09:27:03 pm »
You can give the code of a sample project which reproduce that please ? I'm french too, that's not so hard to understand :p
Kernel Extremist - PedroM power ©

Offline Pelleschi

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Code completion problem
« Reply #4 on: July 12, 2011, 12:50:01 pm »
Its a default SFML project
Code
#include <SFML/Graphics.hpp>

int main()
{
    // Create the main window
    sf::RenderWindow App(sf::VideoMode(800, 600), "SFML window");

    // Load a sprite to display
    sf::Image Image;
    if (!Image.LoadFromFile("cb.bmp"))
        return EXIT_FAILURE;
    sf::Sprite Sprite(Image);
    Sprite. //   /!\ list doesnt appear

// Start the game loop
    while (App.IsOpened())
    {
        // Process events
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Closed)
                App.Close();
        }

        // Clear screen
        App.Clear();

        // Draw the sprite
        App.Draw(Sprite);

        // Update the window
        App.Display();
    }

    return EXIT_SUCCESS;
}
to understand who ?  :mrgreen:

Offline Pelleschi

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Code completion problem
« Reply #5 on: July 13, 2011, 02:23:03 pm »
an idea ? :(

Offline Manolo

  • Multiple posting newcomer
  • *
  • Posts: 47
Re: Code completion problem
« Reply #6 on: July 13, 2011, 08:17:23 pm »
Sometimes I also have this problem :(
Sometimes it gets solved after the file compilation is done :)
Sorry, no more ideas.
HTH
Manolo

Offline Pelleschi

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Code completion problem
« Reply #7 on: August 12, 2011, 01:36:39 pm »
It is a bug of code::blocks ?

Offline Pelleschi

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Code completion problem
« Reply #8 on: August 12, 2011, 03:45:05 pm »
Good news, code completion work with a personnal class.
It doesnt work with an extern lib (SFML, iostream ...).

Offline Freem

  • Almost regular
  • **
  • Posts: 219
Re: Code completion problem
« Reply #9 on: August 12, 2011, 04:18:03 pm »
Did you add the path somewhere?
Maybe C::B's don't know where to search the headers...

Or maybe try the nigthlies, CC has been greatly improved since 2010.

Offline Pelleschi

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Code completion problem
« Reply #10 on: August 12, 2011, 05:06:25 pm »
No i didnt, where i can add it ?
Nightlies, its only for windows no ?

Offline Pelleschi

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Code completion problem
« Reply #11 on: August 12, 2011, 08:04:57 pm »
How can I configure "code completion" consider SFML and standar library ?
Thanks !

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Code completion problem
« Reply #12 on: August 12, 2011, 08:10:59 pm »
We have nightlies for debian/ubuntu.
Or you could build the svn verison. It is way easier on linux.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Pelleschi

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Code completion problem
« Reply #13 on: August 12, 2011, 11:11:06 pm »
I have the 7363 SVN version, with the bug too ...
Quote
Did you add the path somewhere?
Maybe C::B's don't know where to search the headers...
Yes probably, where can I add manually the headers please ?

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Code completion problem
« Reply #14 on: August 13, 2011, 04:03:17 am »
How can I configure "code completion" consider SFML and standar library ?
Thanks !
I guess mostly SFML library use some special macro definitions, I will check it today and give you the direction.
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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Code completion problem
« Reply #15 on: August 13, 2011, 04:47:08 am »
I followed this page
http://www.sfml-dev.org/tutorials/1.6/start-cb.php
and works here:(see screen shot)
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 Pelleschi

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Code completion problem
« Reply #16 on: August 13, 2011, 10:04:02 am »




i have Code::Blocks 7363 svn and archlinux.
Quote
http://www.sfml-dev.org/tutorials/1.6/start-cb.php
its for windows only :s ...
and standard lib didnt list also

Offline Pelleschi

  • Multiple posting newcomer
  • *
  • Posts: 11
Re: Code completion problem
« Reply #17 on: August 13, 2011, 07:17:36 pm »
after reinstalling codeblocks, code completion work on a local class only.
SFML or other lib didnt auto-complete.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Code completion problem
« Reply #18 on: August 14, 2011, 05:04:59 am »
after reinstalling codeblocks, code completion work on a local class only.
SFML or other lib didnt auto-complete.
I only have Win system, so I can't help you further more. :(
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 Loaden

  • Lives here!
  • ****
  • Posts: 1014
Re: Code completion problem
« Reply #19 on: August 14, 2011, 09:12:27 am »
after reinstalling codeblocks, code completion work on a local class only.
SFML or other lib didnt auto-complete.
I only have Win system, so I can't help you further more. :(
Works well on Linux Mint 11.