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. Visual Studio
  4. Visual C++ project physical directory [solved]

Visual C++ project physical directory [solved]

Scheduled Pinned Locked Moved Visual Studio
c++csharpvisual-studiotutorialquestion
11 Posts 3 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.
  • E Offline
    E Offline
    econy
    wrote on last edited by
    #1

    I want to make a directory structure for my project, like: project1\header \source \Lib \resource etc.. On my disk, I created the folders. but I don't know how to import the structure to my visual studio virtual groups. I mean, when I moved .h files to \header folder, visual studio could not found .h files then. Is there a method to let visual studio work with physical directory structures?

    L 1 Reply Last reply
    0
    • E econy

      I want to make a directory structure for my project, like: project1\header \source \Lib \resource etc.. On my disk, I created the folders. but I don't know how to import the structure to my visual studio virtual groups. I mean, when I moved .h files to \header folder, visual studio could not found .h files then. Is there a method to let visual studio work with physical directory structures?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Yes it is possible but once you have the files in place you then need to add them to the project in Solution Explorer, from their source locations.

      Use the best guess

      E 1 Reply Last reply
      0
      • L Lost User

        Yes it is possible but once you have the files in place you then need to add them to the project in Solution Explorer, from their source locations.

        Use the best guess

        E Offline
        E Offline
        econy
        wrote on last edited by
        #3

        I tried, but the .cpp files can't find .h files. #include "stdafx.h" for example, even I changed it to: #include "Header/stdafx.h" IDE gives: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?

        L 1 Reply Last reply
        0
        • E econy

          I tried, but the .cpp files can't find .h files. #include "stdafx.h" for example, even I changed it to: #include "Header/stdafx.h" IDE gives: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4
          1. Do a Clean of your project and delete all the Debug and Release folders.
          2. Make sure that you have added all the files into the project correctly.
          3. Check that all #include statements have the correct path prefix where necessary.
          4. Rebuild the project and correct any errors.
          5. Repeat as necessary.

          Use the best guess

          E 1 Reply Last reply
          0
          • L Lost User
            1. Do a Clean of your project and delete all the Debug and Release folders.
            2. Make sure that you have added all the files into the project correctly.
            3. Check that all #include statements have the correct path prefix where necessary.
            4. Rebuild the project and correct any errors.
            5. Repeat as necessary.

            Use the best guess

            E Offline
            E Offline
            econy
            wrote on last edited by
            #5

            I changed the project directory structure like the following: project1\Header\StdAfx.h project1\Source\StdAfx.cpp project1\project1.vcproj; project1.sln Now I got error message: fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source? In StdAfx.cpp, only one statement: #include "..\Header\stdafx.h" Could you give me some tip?

            D L 2 Replies Last reply
            0
            • E econy

              I changed the project directory structure like the following: project1\Header\StdAfx.h project1\Source\StdAfx.cpp project1\project1.vcproj; project1.sln Now I got error message: fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source? In StdAfx.cpp, only one statement: #include "..\Header\stdafx.h" Could you give me some tip?

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              Hre's a tip. Try pasting that error message into Google. It's very easy to fix.

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak

              E 1 Reply Last reply
              0
              • D Dave Kreskowiak

                Hre's a tip. Try pasting that error message into Google. It's very easy to fix.

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak

                E Offline
                E Offline
                econy
                wrote on last edited by
                #7

                Tried,Can't find solution

                D 1 Reply Last reply
                0
                • E econy

                  Tried,Can't find solution

                  D Offline
                  D Offline
                  Dave Kreskowiak
                  wrote on last edited by
                  #8

                  Bullshit. You're going to do some work for this one. Do what I told you and the very first link will solve it.

                  A guide to posting questions on CodeProject[^]
                  Dave Kreskowiak

                  1 Reply Last reply
                  0
                  • E econy

                    I changed the project directory structure like the following: project1\Header\StdAfx.h project1\Source\StdAfx.cpp project1\project1.vcproj; project1.sln Now I got error message: fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source? In StdAfx.cpp, only one statement: #include "..\Header\stdafx.h" Could you give me some tip?

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    I already told you what to do in my previous response. However, given the fact that you do not really seem to understand how this works, I would suggest you forget this idea and stick with the standard project structure as created by Visual Studio.

                    Use the best guess

                    E 1 Reply Last reply
                    0
                    • L Lost User

                      I already told you what to do in my previous response. However, given the fact that you do not really seem to understand how this works, I would suggest you forget this idea and stick with the standard project structure as created by Visual Studio.

                      Use the best guess

                      E Offline
                      E Offline
                      econy
                      wrote on last edited by
                      #10

                      I understand your previous post. and I created a test project, sure, it works. But, the project I am working with, it seems remove old, add new location, clean, IDE still give error messages. This is a WinCE template project, supplied by one company, will ask them how to solve it. Thank you for your help

                      L 1 Reply Last reply
                      0
                      • E econy

                        I understand your previous post. and I created a test project, sure, it works. But, the project I am working with, it seems remove old, add new location, clean, IDE still give error messages. This is a WinCE template project, supplied by one company, will ask them how to solve it. Thank you for your help

                        L Offline
                        L Offline
                        Lost User
                        wrote on last edited by
                        #11

                        The error message indicates that the project has not been cleaned properly, as Visual Studio thinks that there should be a precompiled header somewhere. Clean and rebuild should fix this. Since this project is not your own it would make more sense to leave it as is.

                        Use the best guess

                        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