Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. vc6 to vc8 conversion [modified]

vc6 to vc8 conversion [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
announcementhelpc++algorithmsdebugging
12 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Russell

    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
    Release

    I 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

    L Offline
    L Offline
    led mike
    wrote on last edited by
    #2

    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

    R 1 Reply Last reply
    0
    • L 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

      R Offline
      R Offline
      Russell
      wrote on last edited by
      #3

      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

      L M 2 Replies Last reply
      0
      • R 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

        L Offline
        L Offline
        led mike
        wrote on last edited by
        #4

        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

        D 1 Reply Last reply
        0
        • L led mike

          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

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #5

          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

          1 Reply Last reply
          0
          • R 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

            M Offline
            M Offline
            Mark Salsbery
            wrote on last edited by
            #6

            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:

            R 1 Reply Last reply
            0
            • R Russell

              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
              Release

              I 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

              J Offline
              J Offline
              Joe Woodbury
              wrote on last edited by
              #7

              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

              R 1 Reply Last reply
              0
              • M Mark Salsbery

                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:

                R Offline
                R Offline
                Russell
                wrote on last edited by
                #8

                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

                M 1 Reply Last reply
                0
                • J Joe Woodbury

                  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

                  R Offline
                  R Offline
                  Russell
                  wrote on last edited by
                  #9

                  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

                  1 Reply Last reply
                  0
                  • R 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

                    M Offline
                    M Offline
                    Mark Salsbery
                    wrote on last edited by
                    #10

                    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. Mark

                    Mark Salsbery Microsoft MVP - Visual C++ :java:

                    R 1 Reply Last reply
                    0
                    • M Mark Salsbery

                      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. Mark

                      Mark Salsbery Microsoft MVP - Visual C++ :java:

                      R Offline
                      R Offline
                      Russell
                      wrote on last edited by
                      #11

                      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

                      M 1 Reply Last reply
                      0
                      • R Russell

                        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

                        M Offline
                        M Offline
                        Mark Salsbery
                        wrote on last edited by
                        #12

                        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:

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups