vc6 to vc8 conversion [modified]
-
I need to write some projects both Vc6 and Vc8, so I'm searching to a way to easily convert a project between different compiler version. I create the project in vc6, then I update it in vc8 correctly. And the program is everytime correcly compiled and run. But the files and project are in the same folder, this is a problem because every project puts its output in the same Debub and Release subfolder. A temporary solution is to "clean all" before compile, but i'm not sotisfied because it isn't easy to have the 2 version of the project opened at the same time. The clean solution that I'm trying to use is to create some folders like
MyProjFolder
Sources (it contains every .cpp, .h and .rc files)
res
vc6 (it contains the project for vc6: files .dsw and .dsp)
Debug
Release
vc8 (it contains the project for vc8: files .sln and .vcproj)
Debug
ReleaseI linked all the resources (cpp and h files) in every project (contained into the Source folder) but when compiling this error comes:
fatal error C1083: Cannot open precompiled header file: '.\Debug/***.pch': No such file or directory
any tip?
Russell
modified on Wednesday, November 12, 2008 10:03 AM
-
I need to write some projects both Vc6 and Vc8, so I'm searching to a way to easily convert a project between different compiler version. I create the project in vc6, then I update it in vc8 correctly. And the program is everytime correcly compiled and run. But the files and project are in the same folder, this is a problem because every project puts its output in the same Debub and Release subfolder. A temporary solution is to "clean all" before compile, but i'm not sotisfied because it isn't easy to have the 2 version of the project opened at the same time. The clean solution that I'm trying to use is to create some folders like
MyProjFolder
Sources (it contains every .cpp, .h and .rc files)
res
vc6 (it contains the project for vc6: files .dsw and .dsp)
Debug
Release
vc8 (it contains the project for vc8: files .sln and .vcproj)
Debug
ReleaseI linked all the resources (cpp and h files) in every project (contained into the Source folder) but when compiling this error comes:
fatal error C1083: Cannot open precompiled header file: '.\Debug/***.pch': No such file or directory
any tip?
Russell
modified on Wednesday, November 12, 2008 10:03 AM
Russell' wrote:
any tip?
Perhaps you should use a Source Control program and share the source files into both projects. This does not account for the differences between the compiler support for C++. I don't know how you plan to deal with that but there is a lot of stuff available in VC2008 that is not in VC6. I highly recommend retiring VC6.
led mike
-
Russell' wrote:
any tip?
Perhaps you should use a Source Control program and share the source files into both projects. This does not account for the differences between the compiler support for C++. I don't know how you plan to deal with that but there is a lot of stuff available in VC2008 that is not in VC6. I highly recommend retiring VC6.
led mike
Perhaps you are right, but the problem doesn't seems a problem regarding the compiler version: simply seems that every version of visual studio doesn't like that you put the source files out of the default folder. As I told before, the project are correctly compiled with every compilers (I tested it)...the problem comes when I try to use the same phisical files, this is necessary for me to go on this multiplatform develope. :(( thanks
Russell
-
Perhaps you are right, but the problem doesn't seems a problem regarding the compiler version: simply seems that every version of visual studio doesn't like that you put the source files out of the default folder. As I told before, the project are correctly compiled with every compilers (I tested it)...the problem comes when I try to use the same phisical files, this is necessary for me to go on this multiplatform develope. :(( thanks
Russell
-
I don't know for sure but it does sound like having separate projects and folder structures using Source Control to share the code files would be a simple solution.
led mike
led mike wrote:
...having separate projects and folder structures using Source Control to share the code files would be a simple solution.
I agree.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
-
Perhaps you are right, but the problem doesn't seems a problem regarding the compiler version: simply seems that every version of visual studio doesn't like that you put the source files out of the default folder. As I told before, the project are correctly compiled with every compilers (I tested it)...the problem comes when I try to use the same phisical files, this is necessary for me to go on this multiplatform develope. :(( thanks
Russell
Russell' wrote:
every version of visual studio doesn't like that you put the source files out of the default folder.
Not true at all!
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
I need to write some projects both Vc6 and Vc8, so I'm searching to a way to easily convert a project between different compiler version. I create the project in vc6, then I update it in vc8 correctly. And the program is everytime correcly compiled and run. But the files and project are in the same folder, this is a problem because every project puts its output in the same Debub and Release subfolder. A temporary solution is to "clean all" before compile, but i'm not sotisfied because it isn't easy to have the 2 version of the project opened at the same time. The clean solution that I'm trying to use is to create some folders like
MyProjFolder
Sources (it contains every .cpp, .h and .rc files)
res
vc6 (it contains the project for vc6: files .dsw and .dsp)
Debug
Release
vc8 (it contains the project for vc8: files .sln and .vcproj)
Debug
ReleaseI linked all the resources (cpp and h files) in every project (contained into the Source folder) but when compiling this error comes:
fatal error C1083: Cannot open precompiled header file: '.\Debug/***.pch': No such file or directory
any tip?
Russell
modified on Wednesday, November 12, 2008 10:03 AM
I have several projects shared between VC6 and VC8. The solution I use is after opening the solution in VS 2005, go to the properties of each project and change the "Output Directory" and "Intermediate Directory" to something like Debug8 (for debug builds obviously.) This causes problems with .ncb files, but there's no reason to be actually editing both versions of the project at the same time. Despite the pain, I tend to edit in VC6 since that's what most the releases are in (we deploy to embedded devices which only have the VC6 runtimes.)
Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke
-
Russell' wrote:
every version of visual studio doesn't like that you put the source files out of the default folder.
Not true at all!
Mark Salsbery Microsoft MVP - Visual C++ :java:
That's Perfect!!! :-D then tell me how I can do this (in Vs2005) please. Because... I just created a test-project, I moved every .cpp and .h files in a different folder(d:\test\src), of course I delete the links to the old files in the project placing there the new links. Then compiling I got some errors: [Of course, you first need to 'clean' the contents of the debug folder, elseway obviously the error doesn't came]
Error 1 d:\test\src\stdafx.cpp 5 error C2859: d:\test\test\test\debug\vc80.pdb is not the pdb file that was used when this precompiled header was created, recreate the precompiled header.
or (if you delete by hand every files in the debug folder):Error 1 d:\test\src\stdafx.cpp 5 fatal error C1083: Cannot open precompiled header file: 'Debug\test.pch': No such file or directory
Please let me know
Russell
-
I have several projects shared between VC6 and VC8. The solution I use is after opening the solution in VS 2005, go to the properties of each project and change the "Output Directory" and "Intermediate Directory" to something like Debug8 (for debug builds obviously.) This causes problems with .ncb files, but there's no reason to be actually editing both versions of the project at the same time. Despite the pain, I tend to edit in VC6 since that's what most the releases are in (we deploy to embedded devices which only have the VC6 runtimes.)
Anyone who thinks he has a better idea of what's good for people than people do is a swine. - P.J. O'Rourke
Thank you, that was my 'temporary' solution...I'm searching for something more 'clean', because place all the project files in the same folders is not good. Elseway I'll continue to create VC6 projects and update they to Vc8, as before, as you suggest. thanks
Russell
-
That's Perfect!!! :-D then tell me how I can do this (in Vs2005) please. Because... I just created a test-project, I moved every .cpp and .h files in a different folder(d:\test\src), of course I delete the links to the old files in the project placing there the new links. Then compiling I got some errors: [Of course, you first need to 'clean' the contents of the debug folder, elseway obviously the error doesn't came]
Error 1 d:\test\src\stdafx.cpp 5 error C2859: d:\test\test\test\debug\vc80.pdb is not the pdb file that was used when this precompiled header was created, recreate the precompiled header.
or (if you delete by hand every files in the debug folder):Error 1 d:\test\src\stdafx.cpp 5 fatal error C1083: Cannot open precompiled header file: 'Debug\test.pch': No such file or directory
Please let me know
Russell
The first one - the pdb file - is easy. If clean doesn't remove it, delete it by hand. That file probably has full paths to source files so attached debuggers can magically find the corresponding source code. It has to be regenerated for the new source locations. The PCH is a little trickier. After moving your source files and re-adding them to the project in their new location: 1) From the solution explorer, right click on the project and choose properties. 2) Navigate to the C/C++ Precompiled Headers section. Typical setting should be Use Precompiled Header (/Yu) StdAfx.h $(IntDir)\$(TargetName).pch 3) With the properties window still open, click on the stdafx.cpp file in the solution explorer. The properties window will change to show that individual file's settings. Change the Create/Use Precompiled Header setting to create. The settings should look like this.
Create Precompiled Header (/Yc)
StdAfx.h $(IntDir)\$(TargetName).pch That should be all you have to do. MarkMark Salsbery Microsoft MVP - Visual C++ :java:
-
The first one - the pdb file - is easy. If clean doesn't remove it, delete it by hand. That file probably has full paths to source files so attached debuggers can magically find the corresponding source code. It has to be regenerated for the new source locations. The PCH is a little trickier. After moving your source files and re-adding them to the project in their new location: 1) From the solution explorer, right click on the project and choose properties. 2) Navigate to the C/C++ Precompiled Headers section. Typical setting should be Use Precompiled Header (/Yu) StdAfx.h $(IntDir)\$(TargetName).pch 3) With the properties window still open, click on the stdafx.cpp file in the solution explorer. The properties window will change to show that individual file's settings. Change the Create/Use Precompiled Header setting to create. The settings should look like this.
Create Precompiled Header (/Yc)
StdAfx.h $(IntDir)\$(TargetName).pch That should be all you have to do. MarkMark Salsbery Microsoft MVP - Visual C++ :java:
-
very helpfull, I found also that StdAfx.h and StdAfx.cpp are the main problem when moving a project, maybe they can be copied, not moved, also because different with different compiler version. thank you, now the problem is solved ;)
Russell
Russell' wrote:
I found also that StdAfx.h and StdAfx.cpp are the main problem when moving a project,
They're only a problem because if you use precompiled headers, and those are the files that implement the precompiled headers, then their compile settings need to be set properly. Without the special PCH settings, they are just source files like any others :) You actually don't have to use those files - you are free to use precompiled headers through any named source file, or not use precompiled headers at all. It's the compiler settings that make the difference.
Russell' wrote:
now the problem is solved
Cool! :)
Mark Salsbery Microsoft MVP - Visual C++ :java: