Thread: Question about Projects in visual C++

  1. #1
    Ethernal Noob
    Join Date
    Nov 2001
    Posts
    1,901

    Question about Projects in visual C++

    I was just wondering if you can create one project, with a bunch of source files, withought having to create seperate projects and still have them compile correctly. Lets say I am doing examples in a book, and I make one project for the chapter's examples in the book, and I make several source files for that chapter and add them to my project. Will it still accept and compile the source files correctly?

    I have .NET btw.

  2. #2
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    I think you're asking about one workspace (dsw) and several projects (dsp). Yes, I do it all the time. a workspace to me usually represents a product and a project is all dll's and exe's. It's nice to do it that way actually because you can do "batch builds" within a workspace and your breakpoints work a little nicer too.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  3. #3
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    oh and I didn't notice that you were using .NET. I assume they carried that over but I don't know much beyond VC++ 6
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  4. #4
    Ethernal Noob
    Join Date
    Nov 2001
    Posts
    1,901
    Well, In .NET I don't see a create workspace anywhere in the program. All I see in the File > New is Project & file.

  5. #5
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    oh ok. I'll look around. I'm not sold on the idea of switching to VC++.NET just yet.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  6. #6
    Registered User shuesty's Avatar
    Join Date
    Oct 2002
    Posts
    21
    After you create your initial project (managed c++ application) you'll notice that in your solution explorer there is a c++ folder. Access the menu for that folder and click on the add new item tab. Inside you will find that you can add a new c++ file. From there you just have to link everything properly and it should work. Lemme know if you need some more help.

  7. #7
    Ethernal Noob
    Join Date
    Nov 2001
    Posts
    1,901
    Well, not I got a question, what is the difference between the solution, workspace, and project. BTW, I just want the c++ files independent, not really connected or linked too each other.

  8. #8
    Registered User shuesty's Avatar
    Join Date
    Oct 2002
    Posts
    21
    Originally posted by indigo0086
    Well, not I got a question, what is the difference between the solution, workspace, and project. BTW, I just want the c++ files independent, not really connected or linked too each other.
    Solution : that's it the high king of your program. Everything that is opened is inside the solution. From the solution you can decide which project gets compiled first, which project is dependent on another and so on. Different project have to be in the same solution for them to interact with each other.

    Workspace : I don't really know. It could be VB 6.0 language but I'm not sure.

    Project : The individual programs. I'm running a Managed C++ Application (VC++), Managed C++ Class Library (VC++) and Windows Application (VB) right now and they are all different projects. However they are all connected by the solution that contains them all.


    As for getting two C++ files running. If you want them completely independent then create two projects. I just recently began working with VC++ .Net and I'm pretty sure if you don't start a full project, you won't have a makefile written to compile your code.

  9. #9
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    this "solution" must be new to .NET

    It seems to serve much the same purpose that workspace did in version 6. Workspaces contain projects and solutions seems to add projects across different languages?
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  10. #10
    Registered User shuesty's Avatar
    Join Date
    Oct 2002
    Posts
    21
    Yeah the 'Solution' has taken the place of the 'Workspace' ... I think. It's main function is to allow you to create a program that has many different projects in it that are able to be linked together. It doesn't always have to be different languages though so yeah.

  11. #11
    Ethernal Noob
    Join Date
    Nov 2001
    Posts
    1,901
    Ok thanks. I was showing my professor the code I had so far, but he couldn't find a workspace file so he had to create a new workspace. He said that it didn't transfer over to 7.0. I guess I just have to save it from 6.0, unless there is a way to export the solution as a workspace.

  12. #12
    Ethernal Noob
    Join Date
    Nov 2001
    Posts
    1,901
    I am still having problems. I am doing examples from the book you seel. I make one solution, and make a project for each example. The first project ran fine, but when I got to build > build (second project name) it builds, but when I try to run it it gives me this warning. I select no and when I try to run it says it cannot find the exe, when I select yes it compiles but it only runs the first project.

  13. #13
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    that's normal, you should rebuild-all probably. but choose yes and you'll have your exe
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  14. #14
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    oh and you have to either select current project (current project in bold) and build or do a batch build. That's what I usually do is set up a nice batch build for everything that I've modified.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  15. #15
    Ethernal Noob
    Join Date
    Nov 2001
    Posts
    1,901
    I am saying that is what I did, and it will only give the exe from the first project. I cannot get teh second project exe to open.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can we have vector of vector?
    By ketu1 in forum C++ Programming
    Replies: 24
    Last Post: 01-03-2008, 05:02 AM
  2. more then 100errors in header
    By hallo007 in forum Windows Programming
    Replies: 20
    Last Post: 05-13-2007, 08:26 AM
  3. Templates and Macros plus more...
    By Monkeymagic in forum C++ Programming
    Replies: 8
    Last Post: 01-20-2007, 05:53 PM
  4. Learning OpenGL
    By HQSneaker in forum C++ Programming
    Replies: 7
    Last Post: 08-06-2004, 08:57 AM
  5. Erros in Utility Header File
    By silk.odyssey in forum C++ Programming
    Replies: 4
    Last Post: 12-22-2003, 06:17 AM