c++ project

rookie1010

Senior member
Mar 7, 2004
984
0
0
Hello
I have been given an exisiting c++ project to work on. I am not experienced at c++ at all and have a bit of C experience. the project is in Visual Studio and i am trying to make head and tail of it at the moment.

i am familiar with the compiling and linking process having worked with a bit of assembler in the past

I dont understand how can there be four proejects(that is what the number of .dsp/.dsw's indicate),

one of them is cmdrun.dsp

perhaps that is the main project which gets the other projects to run?

i looked around for a mak file which i thought would take objects created by the other projects and merge them, ended up with three mak files, their dates looked suspiciously old and i found that they all existed on the net

nm_b55.mak
nm_cc.mak
nm_gnu.mak

could there be a make file which does not have a .mak extension?

i also came across *.bat files, but they did not contain any lines of code which would suggest they did any compiling or linking.
 

sao123

Lifer
May 27, 2002
12,653
205
106
EZ solution ... upgrade to VS .net 2002 or 2003. it will convert your old projects into an easily managed solution. VC++ 6.0 is old technology... time to update.

Usually there are multiple projects (dsp) in a workspace (dsw) when your prgram is going to be multiple files.
program.exe
program1.dll
program2.dll
program3.dll


The main one would be the one which contains main() or winmain() in the code.
 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
Upgrading to VS.net just to simplify project organization is not a great idea if any other people working on the code are still using VS6. Also there are compiler and library differences between the versions that could potentially change the behavior of the application, though the odds of that are low.

But as sao123 said, each project is probably used to create a separate DLL, LIB, or EXE. To see what each one is doing, open the Workspace file (dsw) then click the Project menu and choose Settings. The Link tab will tell you what file is being created (output file name) and will also list included libraries it uses (object/library modules).

Also, using the workspaces you can toggle between building debugging versions (Build > set active configuration) and release versions.

For more about using the IDE (which you really should do) you'll have to Read The Friendly Help, or maybe pick up a book on VC++ 6.
 

rookie1010

Senior member
Mar 7, 2004
984
0
0
thanks guys
you guys have cleared a lot of my doubts

i worked with metroweks code warrior some time back and had three versions of project settings, code only(release version), code with debug info and code with lots of debug info (something like that)

do you think with VC++ 6 those would be three individual projects within one workspace, or would that be three workspaces?
 

rookie1010

Senior member
Mar 7, 2004
984
0
0
Hello
I just looked at the files that i have been supplied with and i found out that there are four *.dsp's and five *.dsw's.
the four .dsp's match up to four of the .dsw's namewise.

what i mean to say is that say i have foo1.dsp, then there is a corresponding foo1.dsw
& so on till foo4.dsp which matches up to a foo4.dsw

but the fifth .dsw stands alone

the fifth .dsw , the fifth one contains two of the previous .dsp's within the work space(left hand pane)

so i guess it is a new work space to include the functionality of the previous two workspaces and the remaining two workspaces remain independent.

however when i checked the link properties i found out that it was linked to three libraries, two of which had their files included in the workspace and a fifth which was just linked through the library.

can you guys shed some light on why this would be the case?



 

rookie1010

Senior member
Mar 7, 2004
984
0
0
two more questions

first one is that when i look at the build it says foo5.exe, does the project always build according to the name of the the dsw, cause in this case tha nem of the dsw is foo5.dsw

my second question is that does c++ also start of from the main, like C does
i looked for the main, in the main, i found out that the following lines of code

Code:
	CTaskManager TM(argv[1]);
	TM.Run();

is there any way i can develop some sort of execution file of my own and i can step through the functions so that i have an idea of the sequence the execution goes through.



 

DaveSimmons

Elite Member
Aug 12, 2001
40,730
670
126
have been given an exisiting c++ project to work on.
Didn't it come with any kind of internal documentation on how you are supposed to be using it?

Are there comments in the source code that explain anything?

Can you talk to the people who worked on the code before you?

For some of these questions, there are many possible guesses we could make without actually seeing the code, but most of those guesses would be wrong.

I enjoy helping people here, but I'm not going to spend an hour thinking about and typing up every possible way this set of projects could be related to each other.

I could look at the code, but I charge at least $125/hour for that :)
 

rookie1010

Senior member
Mar 7, 2004
984
0
0
internal documentation. hehehe
you got to be kidding

comments in the coce, i have seen worse, but the code is not really self explanatory.

i think the way forward is to generate some sort of debug version and single step through the code which will enable me to understand the code to some extent.

hey 125 bucks per hour, can i join your company, dude

can you guys help me with generating a debug version which i can step through.
 

EagleKeeper

Discussion Club Moderator<br>Elite Member
Staff member
Oct 30, 2000
42,589
5
0
Originally posted by: rookie1010
internal documentation. hehehe
you got to be kidding

comments in the coce, i have seen worse, but the code is not really self explanatory.

i think the way forward is to generate some sort of debug version and single step through the code which will enable me to understand the code to some extent.

hey 125 bucks per hour, can i join your company, dude

can you guys help me with generating a debug version which i can step through.

Set your build options for all projects to Debug;
Compile all.

Have fun.