Intellisense issue in VC 2008 express

A place for Ogre users to discuss non-Ogre subjects with friends from the community.
Post Reply
mrmclovin
Gnome
Posts: 324
Joined: Sun May 11, 2008 9:27 pm
x 20

Intellisense issue in VC 2008 express

Post by mrmclovin »

Hello, I've encountered a problem with Intellisense. It cant find all of my classes, spread over a few files. After time of search and research, i deleted an 'Additional include directories' entry. The entry defined a path to the local projects include files where all my classheaders are defined and poof, intellisense found all classes. The problem now is that i cant compile since i removed the include dir... :P

Has someone experince regarding this why intellisense acts like this?
User avatar
RedEyeCoder
Gnome
Posts: 344
Joined: Sat Jun 16, 2007 7:29 am
Location: Brisbane, Australia

Post by RedEyeCoder »

Visual Assist X is the answer to all your problems :)
User avatar
xavier
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 9481
Joined: Fri Feb 18, 2005 2:03 am
Location: Dublin, CA, US
x 22

Re: Intellisense issue in VC 2008 express

Post by xavier »

mrmclovin wrote:Hello, I've encountered a problem with Intellisense. It cant find all of my classes, spread over a few files. After time of search and research, i deleted an 'Additional include directories' entry. The entry defined a path to the local projects include files where all my classheaders are defined and poof, intellisense found all classes. The problem now is that i cant compile since i removed the include dir... :P

Has someone experince regarding this why intellisense acts like this?
Put the directory back. I don't know where you saw that advice but you must have misinterpreted it.

Delete the .ncb file in the same directory as your .sln. That's Intellisense's database. You have to do the same thing with VAX, btw (albeit with a different method) -- anything that parses code to help you with it, can get confused with lots of code changes.
Do you need help? What have you tried?

Image

Angels can fly because they take themselves lightly.
User avatar
RedEyeCoder
Gnome
Posts: 344
Joined: Sat Jun 16, 2007 7:29 am
Location: Brisbane, Australia

Post by RedEyeCoder »

Aye, VAX just screws up a whole lot less :)
mrmclovin
Gnome
Posts: 324
Joined: Sun May 11, 2008 9:27 pm
x 20

Re: Intellisense issue in VC 2008 express

Post by mrmclovin »

xavier wrote:
mrmclovin wrote:Hello, I've encountered a problem with Intellisense. It cant find all of my classes, spread over a few files. After time of search and research, i deleted an 'Additional include directories' entry. The entry defined a path to the local projects include files where all my classheaders are defined and poof, intellisense found all classes. The problem now is that i cant compile since i removed the include dir... :P

Has someone experince regarding this why intellisense acts like this?
Put the directory back. I don't know where you saw that advice but you must have misinterpreted it.

Delete the .ncb file in the same directory as your .sln. That's Intellisense's database. You have to do the same thing with VAX, btw (albeit with a different method) -- anything that parses code to help you with it, can get confused with lots of code changes.
I've already tried to delete the .ncb but to no avail. If I am editing the file where a class which intellisense not recognize, the class popups in the class list but will disappear again after 2 seconds ..

more suggentions/hints?
User avatar
Chris Jones
Lich
Posts: 1742
Joined: Tue Apr 05, 2005 1:11 pm
Location: Gosport, South England
x 1

Post by Chris Jones »

I've already tried to delete the .ncb but to no avail.
are you closing visual studio before deleting the file?

also, VAX does occaisionally get problems, but it has built-in features for clearing the cache etc rather than having to find the file to delete. It's also possible to get it to reparse a file.
mrmclovin
Gnome
Posts: 324
Joined: Sun May 11, 2008 9:27 pm
x 20

Post by mrmclovin »

Chris Jones wrote:
I've already tried to delete the .ncb but to no avail.
are you closing visual studio before deleting the file?

also, VAX does occaisionally get problems, but it has built-in features for clearing the cache etc rather than having to find the file to delete. It's also possible to get it to reparse a file.
Yes, I've tried all "common" solutions (like deleted .ncb, rebuild, resave etc.). I suspect that it's possible that it has to do with how all files/classes are connected to eachother due to #include, #ifndef-#define, and which directories you set in VC++. It's just my theory atm, and I was therefore wondering if someone can give me hints/experience about what I should try to do.

I'm using the conventional anti-redefine:

Code: Select all

#ifndef CLASS_H
#defined CLASS_H
#include some_include_files
namespace my_namespace{
   class a_class {};
}
#endif

(and the source/defintion goes in .cpp-files)

 
what in this does intellisense not understand? :P
mrmclovin
Gnome
Posts: 324
Joined: Sun May 11, 2008 9:27 pm
x 20

Post by mrmclovin »

I'm still looking for a solution for this as not even Google can help me. The closest clue I've got into is what I said in the first post. When I delete the local include path entry, intellisense recognize every class and method I've defined! It even know in what file the class is defined. While intellisense knows, VC++ does not .. since I cant open a file via the #include statement. Looking for new ideas !!?? I will not let intellisense win
User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16
Contact:

Post by KungFooMasta »

As mentioned above, you should only need to do the following:

1. Clean all projects.
2. Close Visual Studio
3. Delete .ncb file
4. Open Project/Solution in Visual Studio
5. Build all projects.
6. Give a little time for intellisense database to be built in background. Sometimes you can see intellisense being updated in the status bar.

If all else fails, commit to SVN, wipe your disk of all traces of this app, grab code from SVN, and build project(s).
Creator of QuickGUI!
User avatar
Fish
Greenskin
Posts: 131
Joined: Fri Aug 22, 2008 6:12 pm

Post by Fish »

I had a similar issue with VS2008 when I tried to reuse project files created with VS2003. Many classes were not visible and occasionally intellisense would hang. I used the process KungFooMasta wrote above and that fixed the problem with the invisible classes, however intellisense would hang each time I updated a class with a simple variable (like int foo;).

In the end I reverted to VS2005 express and have not had any problems.
User avatar
syedhs
Silver Sponsor
Silver Sponsor
Posts: 2703
Joined: Mon Aug 29, 2005 3:24 pm
Location: Kuala Lumpur, Malaysia
x 51

Post by syedhs »

Fish wrote:I had a similar issue with VS2008 when I tried to reuse project files created with VS2003. Many classes were not visible and occasionally intellisense would hang. I used the process KungFooMasta wrote above and that fixed the problem with the invisible classes, however intellisense would hang each time I updated a class with a simple variable (like int foo;).
Just wondering, have you applied SP1 for VC8? I didn't use VC8, but I think it may have solved the problem.
A willow deeply scarred, somebody's broken heart
And a washed-out dream
They follow the pattern of the wind, ya' see
Cause they got no place to be
That's why I'm starting with me
mrmclovin
Gnome
Posts: 324
Joined: Sun May 11, 2008 9:27 pm
x 20

Post by mrmclovin »

As mentioned above, you should only need to do the following:

1. Clean all projects.
2. Close Visual Studio
3. Delete .ncb file
4. Open Project/Solution in Visual Studio
5. Build all projects.
6. Give a little time for intellisense database to be built in background. Sometimes you can see intellisense being updated in the status bar.

If all else fails, commit to SVN, wipe your disk of all traces of this app, grab code from SVN, and build project(s).
As I said, I've tried all _common_ solutions like the one you are suggesting. Intellisense behaves the same on 2 diffrent computers with 2 diffrent OS's and tested on VC++ 2005 and 2008. I'm quite sure it has to do something with my code and how intellisense interprets it.

My files generally have the structure:
Prereq.h

Code: Select all

namespace myNamespace {
class Foo;
class Bar;
}
Foo.h

Code: Select all

#include "Prereq.h"
namespace myNamespace {
class Foo {
  public:
    Bar* bar;
}
}
Foo.cpp

Code: Select all

#include "Foo.h"
namespace myNamespace {
#include "Bar.h"
[...]
}

So, I'm looking for new ideas that goes outside of the _common_ solutions as they don't work out for me!

Thanks!
User avatar
syedhs
Silver Sponsor
Silver Sponsor
Posts: 2703
Joined: Mon Aug 29, 2005 3:24 pm
Location: Kuala Lumpur, Malaysia
x 51

Post by syedhs »

I dont know if this solves your problem, but in Foo.h, the class declaration should be terminated by ;. In VC2005, Intellisense will not function properly if your code doesn't compile.
A willow deeply scarred, somebody's broken heart
And a washed-out dream
They follow the pattern of the wind, ya' see
Cause they got no place to be
That's why I'm starting with me
mrmclovin
Gnome
Posts: 324
Joined: Sun May 11, 2008 9:27 pm
x 20

Post by mrmclovin »

My misstake. There are ; after each class declartion in the actual code. Everything compiles and run.
mrmclovin
Gnome
Posts: 324
Joined: Sun May 11, 2008 9:27 pm
x 20

Re: Intellisense issue in VC 2008 express

Post by mrmclovin »

Now, a couple of months later, Intellisense has gone less of a pain in the ass. Most of my classes and methods are recognized. I did not make any major changes in my code layout but I remember one thing I did and that was that I changed name on my core classes which were named like Application, Input, Physics etc to ApplicationManager, InputManager and so on. It could've been a name collision with Intellisense but Im not really sure.
Post Reply