Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 C++ Include Directories
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Jacobi
Junior Member

23 Posts

Posted - Jan 13 2011 :  6:15:13 PM  Show Profile  Reply with Quote
Hello,

For our projects we have very specific include directories that dictate how an #include can reference a file. Specifically you can only reference files relative to the root of the make project. For example, given:


\\src
  \\src\\game
    \\src\\game\\root.h
    \\src\\game\\root.cpp

    \\src\\game\\foo
      \\src\\game\\foo\\foo.h
      \\src\\game\\foo\\foo.cpp

    \\src\\game\\bar
      \\src\\game\\bar\\bar.h
      \\src\\game\\bar\\bar.cpp


Including "foo.h" from root.cpp should look exactly like:

#include "game\\foo\\foo.h"


To make this work I have set the C++ include directory in VS to be only "c:\\src" and turned off inheriting defaults.





However there is something visual assist is assuming or I am missing in configuring our tools that is causing confusion when visual assist generates it's include suggestions. From root.cpp the initial include suggestions are:



Besides all of those being invalid for our purposes the biggest problem is that the 'game' folder is missing, the source code type item in the root of the include directory I specified.

If I type #include "game/" and hit alt-space, then the suggestions actually look correct:



How can I make this the default behavior when suggesting includes? If you want I can send you the sample project I created to replicate this problem.

One last wrinkle... This is really only a problem if we have our solution/project files in a subfolder of src (e.g. /src/vcproj). Moving them to the root (/src) yields nearly ideal results:



Having those extra includes I can write off as just the nature of dealing with C++, but it seems visual assist is dependent on the location of the vcproj file when it comes to assembling a complete suggestion list.

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jan 13 2011 :  8:49:54 PM  Show Profile  Reply with Quote
>If you want I can send you the sample project I created to replicate this problem.
Thanks. You can send via the following form:

http://www.wholetomato.com/support/contact.asp

Please include the URL of this topic so we can match it up.
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jan 15 2011 :  02:41:45 AM  Show Profile  Reply with Quote
I got the project, thank you. I've been playing with your and some of my newly created projects and found that the philosophy is the following:

Visual Assist does not list the files with these settings, if set under VC++ Directories because these are directories for libraries (it was under Tools -> Options... in older Visual Studios). Too many result would clutter the list. For example, if you add boost library's directory, you only get its files when you type
#include "boost/"
which makes sense. This is why VA only listed the files when you typed "game/".

The good news is however is that if you set the directory under "Configuration Properties -> NMake -> Include Search Path" (in project properties dialog), VA will list "game" as a directory. I tried it and works These directories are for project-specific include dirs, so this is why VA handles it differently.

You don't need to modify VA's directories, VA will pickup these settings once you restarted Visual Studio.

"NMake -> Include Search Path" is for Makefile Projects. For non-makefile projects you could use the "Configuration Properties -> C/C++ -> General -> Additional Include Directories"

Edited by - accord on Jan 15 2011 02:42:43 AM
Go to Top of Page

Jacobi
Junior Member

23 Posts

Posted - Jan 17 2011 :  2:35:14 PM  Show Profile  Reply with Quote
Hi accord,

Thanks for looking into this for me. I'm having trouble reproducing your solution. I've tried both adding \\src and \\src\\game to the NMake include search path but neither had any effect. I cleaned cache/rebuilt solution/reloaded solution after each try to be sure.

Since the field is listed under IntelliSense I thought the issue might be my disabling of intellisense, but that also seems to have made no difference.

Is there a step I'm missing?
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jan 18 2011 :  4:08:23 PM  Show Profile  Reply with Quote
Intriguing, it should work. I have replied by email because I sent you something.
Go to Top of Page

Jacobi
Junior Member

23 Posts

Posted - Jan 24 2011 :  5:09:46 PM  Show Profile  Reply with Quote
Hi Accord,

Apologies for the delayed reply. I got your project files and they worked as advertised. I had trouble replicating the results on my end until I caught that I need to close and reopen the solution for my changes to include directories to take effect (whoops).

Switching from VC++ Directories to NMake now works in my main project file as well. Thanks for helping me resolve this.
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Jan 27 2011 :  4:19:28 PM  Show Profile  Reply with Quote
Sounds good. I'm glad it helped.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000