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
 Feature Requests
 #include Stack?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jmatthias
Senior Member

26 Posts

Posted - Apr 04 2006 :  3:44:15 PM  Show Profile  Reply with Quote
This problem has bugged me for a long time.

The compiler tells me that there is a symbol conflict and it gives me the name of a .h file. But this include file is included by a nested include file. Is there anything VA can do for me. I just want a list of files starting with the .CPP file showing me how the included file reported in the compiler error got included e.g.

I'm compiling foo.cpp and the compiler reports an error in bar.h, the list would look like

foo.cpp
a.h
b.h
bar.h

i.e. foo.cpp includes a.h which includes b.h which includes bar.h

Thanks - Joel

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Apr 04 2006 :  4:26:54 PM  Show Profile  Reply with Quote
this might help

http://www.codeproject.com/tools/includefinder.asp

zen is the art of being at one with the two'ness
Go to Top of Page

jmatthias
Senior Member

26 Posts

Posted - Apr 04 2006 :  4:33:14 PM  Show Profile  Reply with Quote
I did find this utility before I posted but it didn't do what I wanted it to. If I gave it the name of the include file stated in the compiler error message it didn't find anything and if I gave it the name of the source .CPP file it gave me a huge tree of every include file and I would have to examine the whole tree to find the file.

Thanks anyway.
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Apr 04 2006 :  4:50:21 PM  Show Profile  Reply with Quote
This one is hard to resolve since final includes paths, order of files compiled, and what is and is not #defined (and hence #included,) isn't determined until compile time.

We appreciate the request but we think the solution fail with any project beyond simple.
Go to Top of Page

rhummer
Tomato Guru

USA
527 Posts

Posted - Apr 04 2006 :  5:04:04 PM  Show Profile  Reply with Quote
You can have the Compiler show all the includes per file when it compiles a file.

Configuration Properties -> C/C++ -> Advanced -> Show Includes it will list the includes in a tabed tree forum in the out put window.

Hope that may be of some he lp.

Tools Engineer - Raven Software
VS2005 SP2/VS2008 SP1 - VAX <LATEST> - Win 7 x64

Go to Top of Page

jmatthias
Senior Member

26 Posts

Posted - Apr 04 2006 :  5:07:35 PM  Show Profile  Reply with Quote
Which version of Visual Studio are you using?
Go to Top of Page

jmatthias
Senior Member

26 Posts

Posted - Apr 04 2006 :  5:12:09 PM  Show Profile  Reply with Quote
Looks like it's VS.NET, alas we are stuck in the 20th century and are using VS6.
Go to Top of Page

rhummer
Tomato Guru

USA
527 Posts

Posted - Apr 04 2006 :  5:21:46 PM  Show Profile  Reply with Quote
Ah, sorry forgot to mention its in .NET :/

Tools Engineer - Raven Software
VS2005 SP2/VS2008 SP1 - VAX <LATEST> - Win 7 x64

Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Apr 04 2006 :  5:42:13 PM  Show Profile  Reply with Quote
when you say a "symbol conflict" what do you mean? if ultimately you are trying to find where something is defined, or referenced, then this *might* be an easier problem.

zen is the art of being at one with the two'ness
Go to Top of Page

rhummer
Tomato Guru

USA
527 Posts

Posted - Apr 04 2006 :  5:44:31 PM  Show Profile  Reply with Quote
I would presume its a circular include problem?

Tools Engineer - Raven Software
VS2005 SP2/VS2008 SP1 - VAX <LATEST> - Win 7 x64

Go to Top of Page

jmatthias
Senior Member

26 Posts

Posted - Apr 04 2006 :  5:53:48 PM  Show Profile  Reply with Quote
No it's not as complicated as a circular include. It just a deeply nested include and sometimes it's hard to figure out how the duplicate symbols were included.

The /showincludes option mentioned solves the problem because you can find the include file mentioned in the compiler error and see how the the conflicting symbol (in a different include file) was included.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Apr 05 2006 :  2:54:36 PM  Show Profile  Reply with Quote
when the 15xx builds reach beta they include a "find references" tool as part of the C++ refactoring support. this should help you to identify all .h files with the duplicate symbol. the real question becomes, will this help, since it will not provide the include path.

do you address these problems by trying to remove the duplicate symbols, or are you limited to trying to fix the #include list?

zen is the art of being at one with the two'ness
Go to Top of Page

peterchen
Tomato Guru

126 Posts

Posted - Apr 20 2006 :  04:08:31 AM  Show Profile  Reply with Quote
I used IncludeFinder a few times for that, starting with the .cpp file the compiler is currently working at. Yes, it'sa huge tree, maybe you want to give it another try :)
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