473,657 Members | 2,378 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to determine which files are used in a c++ project

1 New Member
I have a Visual Studio 2003 solution with multiple projects (3 C++, 2 C#, and 2 VB).
The code has been maintained and upgraded since VC 6.0 by several developers. There are litarally several hundred files in the solution (the majority in the C++ projects.)

I want to find out what files are REALLY used by the C++ projects. I know that the project file has a list of all files included in the specific project but I also know that I do not need every file that is listed.

1. Is there some type of compiler setting or program that I can run to determine which files are orphaned (or actively used) by a project? (primary task for me)

2. Is there a program that can determine which include files should not be used in each of my .cpp/.h files? (nice to do)

I have access to all the MS Visual Studio version starting with 6.0 and including 2008 beta and I am not afraid to use other tools (even *nix tools) :D


Thanks in advanced,
redjoy
Aug 9 '07 #1
1 1547
weaknessforcats
9,208 Recognized Expert Moderator Expert
There are several way to proceed.

Method A:
Create a new project and add the file with main(), or the equivalent.
Build.
Fix the first error by adding the correct file.
Repeat untilk you have a error free build.

Method B:
Remove a file from the project and rebuild.
If no errors, that file is not required.
Repeat by removing each file to see what happens.

Header files, of course, are not part of the project necessarily since they are included by the preprocessor. To locate unneeded headers, you need to locate the header and rename it. Then create a new empty header with the original name and rebuild.

If there are no errors, then that header was not required.

Be sure you do not alter any of the header files that were installed with the compiler.

As long as you are careful and keep aaccurate accounting of what you have done, then you should be able to accomplish this.
Aug 10 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
5630
by: MAK | last post by:
Hello everyone, I know how to add images and icons etc to dll file. What I would like to know is there is a way to add those icons on the forms during the run time from the dll or to reference it to the dll during the design time, then when I compile the project and install it, then all the images still inside the dll file. not to be installed into winnet, or system or system32 or any directory, 1) is it possible ? and how ? link or...
21
39356
by: Sami Viitanen | last post by:
Hello, How can I check if a file is binary or text? There was some easy way but I forgot it.. Thanks in adv.
18
3166
by: JKop | last post by:
Here's what I know so far: You have a C++ project. You have source files in it. When you go to compile it, first thing the preprocessor sticks the header files into each source file. So now you have your ".cpp" files all ready, without any "#include" or "#define" in them. Let's assume that there's 2 source files in this project, "a.cpp" and
3
1908
by: Web Webon | last post by:
Hi everybody! I wonder if this is possible? I need to determine if a client is using "windows classic folders" or anything else. If I instantiate a Shell ActiveX object is there a way of obtaining this information from javascript? (I know that the user will get prompted about allowing such an operation, but I am willing to live with this). Because of the way one of my pages work, I need to know this information in order to "cover up"...
2
2260
by: sudheervemana | last post by:
Dear all, In my main directory there are some source files and i have another directory which includes several folders,each contains the make files.Now i want to debug my source code in either VC++ or in Tornado 2.2 IDE,for that i need to create an work space and an project file.so that i can include my source and header files in my project.Before that i want to know is there any possibilty of debugging my source code using the MAK...
1
1537
by: Patrick Blackman | last post by:
How do you determine the default namespace of a project using code?
4
1560
by: Tom | last post by:
How can one determine if a .NET program is running in the developer IDE or running stand-alone? I am sure I saw something somewhere but I don't remember where or what. Thanks! Tom
3
1961
by: Dean Slindee | last post by:
I have a exception handling class that could be called from either a windows project app or a console project app. Is there any way for this class to determine which type of app called it without sending an window/console parameter from either app? Thanks, Dean Slindee
5
6530
by: DCDev | last post by:
I have a solution with multiple projects. One project is a windows forms project. I have report files (.rdlc) in a separate project that are built as "Content" with the "Copy Always" option. When I build the solution, these files are copied to the bin\Release directory, as they should be. However, when I publish the Windows Forms project, these content files are not copied. How can I make it so that these content files from the one...
0
8312
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8827
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8504
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8606
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7337
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4318
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1959
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.