Martin Heller
Contributing Writer

Getting Cross-References

analysis
Apr 13, 20073 mins

Every once in a while, I have the experience of needing to do something that I knew how to do very well 5 or 10 or 20 years ago, but have forgotten. Take getting cross-references in C++ programs. It used to be that the Microsoft C++ build process would run a separate step to generate cross-reference files, so that when you were editing you could quickly find all the places that you had called the

Every once in a while, I have the experience of needing to do something that I knew how to do very well 5 or 10 or 20 years ago, but have forgotten. Take getting cross-references in C++ programs.

It used to be that the Microsoft C++ build process would run a separate step to generate cross-reference files, so that when you were editing you could quickly find all the places that you had called the Foo() function, to make sure that the redesign you had in mind for that function would actually work. When some version of Visual C++ added a class browser, there wasn’t nearly as much need for the hard-core cross-references, so the step to build the rarely-needed cross-reference files was turned off by default.

Visual Studio .NET 2003 C++ Property Pages
The other day, I needed to turn that on again in Visual Studio .NET 2003. It took me forever to find the user interface for it, which was right under my nose, in the Configuration Properties dialog under General/Build Browser Information. I had been looking much lower down in the properties, where there were other things that controlled Browser Information, but none of those mattered a whit until the top-level switch had been thrown.

By the way, the secret keys for finding the next and previous references in VS03 are Ctrl-Shift-1 and Ctrl-Shift-2. They aren’t documented anywhere, as far as I know: Dave Methvin found them in an Internet search.

Part of the reason I couldn’t find the Build Browser Information is that when I really want to understand someone else’s C++ project, I usually either fire up SlickEdit or Source Insight. Both of these editors build their own tags files and use them to help you navigate source files.

My copy of Source Insight 3.5 dated from 2003. It still worked fine on Windows XP. There’s a new version available that works on Windows Vista and fixes a bunch of bugs that I never encountered. I downloaded it and upgraded on general principles. The Source Insight folks generate updates every couple of months, but I have never felt the need to upgrade. Source Insight is probably the best editor around for understanding big projects.

My copy of SlickEdit 2007 is fresh, and adds a few nice features, like a new class view, and more Python language support. SlickEdit is still the only editor around that does a creditable job of C++ refactoring. It can also open and build existing Visual Studio projects, so I tend to use it a lot for C++ programming.

So why didn’t I use one of these rather than Visual Studio .NET 2003? I did, for myself, but the other two programmers working on the project didn’t have them.

Along the way, I found a bunch of other cross-reference tools that might do someone some good:

https://www.codeproject.com/dotnet/GoBackAddin.asp

https://www.codeproject.com/macro/kingstools.asp

https://www.stack.nl/~dimitri/doxygen/

https://www.ph.unimelb.edu.au/~ssk/kde/kdoc/

https://home.att.net/~srschmitt/xref/xref_dos_3.html

Martin Heller

Martin Heller is a contributing writer at InfoWorld. Formerly a web and Windows programming consultant, he developed databases, software, and websites from his office in Andover, Massachusetts, from 1986 to 2010. From 2010 to August of 2012, Martin was vice president of technology and education at Alpha Software. From March 2013 to January 2014, he was chairman of Tubifi, maker of a cloud-based video editor, having previously served as CEO.

Martin is the author or co-author of nearly a dozen PC software packages and half a dozen Web applications. He is also the author of several books on Windows programming. As a consultant, Martin has worked with companies of all sizes to design, develop, improve, and/or debug Windows, web, and database applications, and has performed strategic business consulting for high-tech corporations ranging from tiny to Fortune 100 and from local to multinational.

Martin’s specialties include programming languages C++, Python, C#, JavaScript, and SQL, and databases PostgreSQL, MySQL, Microsoft SQL Server, Oracle Database, Google Cloud Spanner, CockroachDB, MongoDB, Cassandra, and Couchbase. He writes about software development, data management, analytics, AI, and machine learning, contributing technology analyses, explainers, how-to articles, and hands-on reviews of software development tools, data platforms, AI models, machine learning libraries, and much more.

More from this author