tags:

views:

449

answers:

4

I've got a really large project I made for myself and rece3ntly a client asked for their own version of it with some modifications. The project name was rather silly and my client wants the source so I figured it'd be best if I renamed all my files from

sillyname.h sillyname.cpp sillyname.dsp

etc.. Unfortunatly after I added everything back together I can't see any way to change the project name itself. Plus now I'm getting this error on compilation.

main.obj : error LNK2001: unresolved external symbol __imp__InitCommonControls@0 Debug/New_Name_Thats_not_so_silly.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe.

There has to be an easier way to change all this, right?

A: 

You can simply rename the .vcproj or .dsp file and then either create a new workspace (sln dsw) and include the renamed project or simply chnage the name inside the sln file (it's just xml) I can't remember the format of the old workspace but it's still text.

You can either manually rename and reinclude all the .cpp of edit the project file and rename them in there.

sorry don't know of refactoring tool that will do all this but there probably is one.

Martin Beckett
+2  A: 

Here is a Step by Step on Steve Andrews' blog (he works on Visual Studio at Microsoft)

Ray Hayes
"When you rename a project, most likely you will want to rename the output assembly and/or the root namespace for the project. To do this, right-click on the project node and choose Properties. You can also double-click on the Properties (C#) or My Project (VB) node. "Where is Solution Explorer?
que que
If it's not already on screen (looking like que's link) try the menu item "View | Solution Explorer" OR type Ctrl+Alt+L
Ray Hayes
+1  A: 

I haven't verified this, but I've done this a number of times and if my memory serves me right, you can actually use the search-and-replace functionality in VS2005 to rename all instances of the string "X" to "Y" in any type of file. Then you need to close the solution and change the project (and any other file with the same name regardless of extension) file name(s).

You will obviously need to do a full rebuild afterwards.

Niklas
Actually this is what I did initially. The worst part is I just found a tool that does this and I'm still getting the same error on compile.. grr
A: 
que que