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
 Add include generates relative paths
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

tangens
New Member

Belgium
7 Posts

Posted - Nov 10 2011 :  08:03:46 AM  Show Profile  Reply with Quote
We work with a project directory structure that contains quite some (sub)folders.
When making use of the Add include functionality, the include that is added always contains a relative path.

Consider following directory structure:
project\\package1\\class1.h
project\\package1\\implementation\\class1.cpp
project\\package2\\class2.h
project\\package2\\implementation\\class2.cpp

when doing a Add include for Class1 and Class2 in class1.cpp,
the following include statements are generated:
#include "..\\class1.h"
#include "..\\..\\package2\\class2.h"

What we would like to have is the following:
#include "package1\\class1.h"
#include "package2\\class2.h"

as we have a a INCLUDEPATH which is set to the root of our project.

Is there anyway to force VAX to generate the includes in this fashion?

Bart

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Nov 10 2011 :  3:23:45 PM  Show Profile  Reply with Quote
Which Visual Assist version are you using? We had fixed a similar bug in 1854. From the history:
quote:

Fixed Add Include when root directory is specified as an additional include directory. (case=58426)


http://www.wholetomato.com/support/history.asp
Go to Top of Page

tangens
New Member

Belgium
7 Posts

Posted - Nov 14 2011 :  04:05:16 AM  Show Profile  Reply with Quote
system info:
VA_X.dll file version 10.6.1859.0 built 2011.10.02
DevEnv.exe version 10.0.40219.1 Professional
msenv.dll version 10.0.40219.1
Comctl32.dll version 6.10.7601.17514
Windows 7 6.1 Build 7601 Service Pack 1
4 processors (x86-64;WOW64)

I must say we have this issue for quite a while already..
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Nov 14 2011 :  8:32:01 PM  Show Profile  Reply with Quote
I was able to create a test project where I am seeing the same effect as you:

case=62702

Thank you for the clear description.
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Nov 14 2011 :  9:18:03 PM  Show Profile  Reply with Quote
where is your INCLUDEPATH defined?
Go to Top of Page

tangens
New Member

Belgium
7 Posts

Posted - Nov 16 2011 :  11:53:19 AM  Show Profile  Reply with Quote
we have some (old) custom make system...
So the /I parameters are then eventuall passed to the cl throught this make system.
Our makesystem is triggered by using in VisualStudio the project type Makefile.

In the NMake Configuration Properties we then specify following properties:
Build Command Line: makeit.cmd build Debug
Rebuild All Command Line: makeit.cmd rebuild Debug
Clean Command Line: makeid.cmd clean Debug

So what we would need is something in VAX where we can configure these include paths ourselves... (something like the stable includes or so...)

Edited by - tangens on Nov 16 2011 11:54:38 AM
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Nov 16 2011 :  12:36:42 PM  Show Profile  Reply with Quote
Have you added .\\ (or the full project root directory) to Project | Properties | Configuration Properties | NMake | Include Search path?
Go to Top of Page

tangens
New Member

Belgium
7 Posts

Posted - Nov 17 2011 :  03:59:55 AM  Show Profile  Reply with Quote
we didn't have that...

I just added . as value for Include Search Path and the includes are generated correctly!

Thanks a lot!!
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Nov 17 2011 :  10:04:37 AM  Show Profile  Reply with Quote
Great!

In the test solution that we built, adding "." fixed the include of class2.h but the include of class1.h still used a relative path (..\\class1.h) since it was shorter than "package1\\class1.h". The next build will give you the option of overriding the bias towards shorter paths that use ".." (when possible, given the include directories).
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Dec 16 2011 :  2:12:48 PM  Show Profile  Reply with Quote
case=62702 is fixed in build 1862
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Dec 16 2011 :  2:31:36 PM  Show Profile  Reply with Quote
In build 1862 and higher, you can change the default behavior of preferring the shortest possible string for use in generated #include directive paths. There is a new binary registry value named AddIncludePreferShortestRelativePath. It defaults to 01. Change to 00 to to give preference to non ..\\ dirs.
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