Help with a build error in Visual Studio

Click For Summary
The discussion revolves around a build error in a simple C++ program involving class definitions in Visual Studio. The primary issue identified is a missing semicolon after the class definition in the Inventory.h file, which leads the compiler to misinterpret the subsequent code. Participants emphasize the importance of understanding how header files are merged into source files during compilation, which can obscure error messages. The conversation also touches on the challenges of managing multiple files in Visual Studio and the need for better error messaging from the compiler. Overall, the thread highlights common pitfalls in C++ programming and the learning curve associated with using integrated development environments effectively.
  • #31
Jarvis323 said:
Have you seen this yet?
https://www.physicsforums.com/threads/today-i-learned.783257/page-137#post-6398917
Turns out Bulls are pretty graceful in china shops. lol
Hi Jarvis

I know you don't use VS, what IDE are you using? Does it have free download version? I want to take a second look at other options as I have to spend a lot more time on VS as I get deeper in C++. On top of deleting folders, like you said, it is very slow for doing very simple job and the projects are so so huge. I don't know what they put in it.

thanks
 
Technology news on Phys.org
  • #32
yungman said:
No I did not say I delete things haphazardly,

Post #16 -
yungman said:
But, of cause, I screwed up, I managed to delete both the Header Files and Source Files folders.
Post #16 -
yungman said:
I have to delete the .h from Header Files folder and put it in the Source Files folder as shown below.
Post #21 -
yungman said:
It is not that I want to create new folders( filters), I accidentally deleted them. My mouse/computer is funny,
These sound pretty haphazard to me.
yungman said:
That's really not a serious problem if I can just create a new project and copy all my .h and .cpp files over. BUT the STUPID VS...I repeat...THE STUPID VS remember what I deleted.
An old saying, "It's a poor craftsman who blames his tools" - https://idioms.thefreedictionary.co...n taking responsibility for their own failure.
Are you copying all of the files, including the ones that VS uses to layout the structure in Solution Explorer?
Or are you creating new projects from scratch?
If you are reusing the .vxproj and .vxproj.filters files from an older project, where you deleted a bunch of stuff, and copying them to a new project, then the new project is going to have missing folders as well.
yungman said:
that when I choose say the .h file to delete, sometimes it will highlight the other stuffs, when I hit the delete button, it's too late.
Like I said before, if you're about to hit the delete button, you need to look at what you're about to delete.
Furthermore, why are you deleting all these files? VS allows you to Remove a file (which deletes it) or Exclude from Project, which doesn't delete it, but just keeps it from participating in the build.
yungman said:
I never thought about changing the mouse because it is NOT a problem with any other programs That I use, everyone one of them just restart from the beginning when I close the program and re-open it.
Restarting from the beginning is not a function of the mouse. If the mouse isn't working right for you with the computer you have, then you either need to adjust the settings on the mouse, or get one that works well for you. I think you're working with a laptop. If the screen is too small for you to see well, then maybe you should get an external monitor so you can see things better. A lot of programmers work with large screens, up to four or five of them, and only work on laptops for making small changes to code they've already written.
yungman said:
Like I said, I use plenty of programs from free ones to 10K+ programs through out the years, never have I once encounter this. Don't tell me this one is special.
As someone told you in another thread, using an application is very different from writing an application. The fact that an application was free or cost $10,000 is irrelevant.
I've been using VS for 23 years, and I have never run across any of the problems that you are running into.
 
  • #33
yungman said:
Hi Jarvis

I know you don't use VS, what IDE are you using? Does it have free download version? I want to take a second look at other options as I have to spend a lot more time on VS as I get deeper in C++. On top of deleting folders, like you said, it is very slow for doing very simple job and the projects are so so huge. I don't know what they put in it.

thanks
I'm usually not using an IDE. Lately I've been mostly using Sublime Text (a fancy text editor), and various command line tools. The OS I use is a version of Linux.

If you want to develop in Windows without an IDE, you could use a text editor and use the compiler (cl) directly from the command line. I guess that will be a hurdle because you need to learn to use the command line. It might be a good learning experience though, because you can learn what VS actually is and what it is doing. You'll understand why you had the problems you had, when you know what the compiler is and how it works.

You could also try Qt creator, which is an IDE and GUI library. But I'm not sure it will be that much easier than VS.

Most developer tools are free.

You might be better off sticking with VS and keeping it simple though, and be careful to stop breaking things. Focus on learning C++ at this stage rather than all of the features of VS. It's up to you.
 
  • Like
Likes yungman
  • #34
Hi Jarvis

Thanks, I am not worry about how hard it is to learn, unless there is a way to recover things that is deleted, It is very inconvenient that whenever I screw up, it will affect all the older projects I did in the pass and everything I'll be doing in the future. Like I said, it's not that I am no careless, the new mouse and computer combination jump all the time. It's like I can type on this line and the cursor might jump somewhere else all of a sudden.

It is not a big problem if Ctrl-Z can recover as the rest of the program including Windows file explorer. The worst is even if I exit VS, the damage is done on the past projects and the future ones. How can VS don't have an option to NOT taking changes beyond the current project, that if I delete a folder, the same folder disappears in ALL my old projects like I showed in post 29.

Maybe you have idea how to prevent anything done to one project to affect all the other projects. That would solve all the problems. Worst case is just create a new undamaged project, copy all the files in and delete the damaged project.

Thanks
 
Last edited:
  • #35
Mark44 said:
Post #16 -
Post #16 -
Post #21 -
These sound pretty haphazard to me.
An old saying, "It's a poor craftsman who blames his tools" - https://idioms.thefreedictionary.com/a+poor+craftsman+blames+his+tools#:~:text=a poor craftsman blames his tools proverb Said,rather than taking responsibility for their own failure.
Are you copying all of the files, including the ones that VS uses to layout the structure in Solution Explorer?
Or are you creating new projects from scratch?
If you are reusing the .vxproj and .vxproj.filters files from an older project, where you deleted a bunch of stuff, and copying them to a new project, then the new project is going to have missing folders as well.
Like I said before, if you're about to hit the delete button, you need to look at what you're about to delete.
Furthermore, why are you deleting all these files? VS allows you to Remove a file (which deletes it) or Exclude from Project, which doesn't delete it, but just keeps it from participating in the build.
Restarting from the beginning is not a function of the mouse. If the mouse isn't working right for you with the computer you have, then you either need to adjust the settings on the mouse, or get one that works well for you. I think you're working with a laptop. If the screen is too small for you to see well, then maybe you should get an external monitor so you can see things better. A lot of programmers work with large screens, up to four or five of them, and only work on laptops for making small changes to code they've already written.
As someone told you in another thread, using an application is very different from writing an application. The fact that an application was free or cost $10,000 is irrelevant.
I've been using VS for 23 years, and I have never run across any of the problems that you are running into.

You actually stop and delete the Header Files in one project and look at your older projects to see whether the Header Files is gone? Read my post 29, I did not open those project for over a month, it had at least Source Files folder at the time because I always Add-->New source .cpp into the Source Files folder. The folder is gone in both that I opened. Do you have a way to prevent any accident from rippling to other projects?

NO, accident delete something is NOT a big deal if Ctrl-Z can recover. Usually the worst case is create a new project and copy over the files and delete the damage project. But VS do not allow you to do that, the damage will follow to the new project and affect all the old project just sitting there.

I am surprised you don't know that. I notice that in the first installment of VS2019, then there were too many problems and from you advice, I delete and reinstalled VS2019 the second time like 3 weeks ago. It sure works better. BUT this changes in one project ripple to other projects are always there...Of cause I could have done something wrong again.

Yes, this is a NEW project I just created to show you. No Header Files and Source Files folder. This is all I have:
New project.jpg


VS remember I deleted the folders and it WOULD NOT show up when I create a new project.
 
Last edited by a moderator:
  • #36
yungman said:
It is not a big problem if Ctrl-Z can recover as the rest of the program including Windows file explorer. The worst is even if I exit VS, the damage is done on the past projects and the future ones. How can VS don't have an option to NOT taking changes beyond the current project, that if I delete a folder, the same folder disappears in ALL my old projects like I showed in post 29.
I really doubt any damage is done to the projects. It sounds like maybe you just accidentally changed some settings in VS? Usually when someone changes global settings, they intend the changes to persist. It's like if you change the color settings on your TV, it will affect every movie you watch. But you haven't damaged your DVDs. You just need to figure out how to reset those settings to what they were before.

Have you tried resetting the settings?

https://stackoverflow.com/questions/26863/how-do-i-really-reset-the-visual-studio-window-layout

Maybe you toggled "show all files"?

Screenshot_2020-10-09_00-11-51.png


https://stackoverflow.com/questions/52633866/project-files-hidden-in-visual-studio
 
Last edited:
  • Like
Likes yungman
  • #37
Jarvis323 said:
I really doubt any damage is done to the projects. It sounds like maybe you just accidentally changed some settings in VS? Usually when someone changes global settings, they intend the changes to persist. It's like if you change the color settings on your TV, it will affect every movie you watch. But you haven't damaged your DVDs. You just need to figure out how to reset those settings to what they were before.

Have you tried resetting the settings?

https://stackoverflow.com/questions/26863/how-do-i-really-reset-the-visual-studio-window-layout

Maybe you toggled "show all files"?

View attachment 270681

https://stackoverflow.com/questions/52633866/project-files-hidden-in-visual-studio

You really did it! Thank you! Thanks a Billion!
I have to watch it again to take down notes. I opened a new project, They are there! I looked at another old file, it's there.

I can't thank you enough. You just save VS for me. You are the expert in VS!
 
  • #38
yungman said:
You really did it! Thank you! Thanks a Billion!
I have to watch it again to take down notes. I opened a new project, They are there! I looked at another old file, it's there.

I can't thank you enough. You just save VS for me. You are the expert in VS!
Yeah, actually I notice in your post #16, in one of the images you have the "show all files" button and some other button pressed (yellow highlighted buttons) and the others you don't. I guess that was the problem?

I am just good at googling I guess? It's a skill you pick up as a programmer. You will run into problems all the time, and you have to know how to figure out the solutions by looking things up.
 
  • Like
Likes yungman
  • #39
Jarvis323 said:
Yeah, actually I notice in your post #16, in one of the images you have the "show all files" button and some other button pressed (yellow highlighted buttons) and the others you don't. I guess that was the problem?

I am just good at googling I guess? It's a skill you pick up as a programmer. You will run into problems all the time, and you have to know how to figure out the solutions by looking things up.
Remember the nose?! I watched that 1 minute video so many times as it's blur, also the tittle just blocked the top manual. Had to watch it over and over and guess. This is the steps:
-Tools-->Import and Export setting-->Reset all setting-->No, just reset setting, overwriting my current setting-->General-->click Finish.

I swear I saw the page Import and Export setting-->Reset all setting before. It just didn't click in my head as I never relate this to import and export setting. When I saw that part, I started to know where to look for that and found it.

You really make my day. I cannot live with one mistake and change everything in all projects. I don't blame the mouse, $hit happens, it's how you recover from it that matters. Now this is 1/2 minutes job, I can live with it.

While you are here, can you look at the last few lines of post 27 in how to declare const int d_size = 31; for the structure?

Thanks you so much.

Alan
 
  • #41
yungman said:
My only question I cannot resolve is if you look at the Inventory.h file, I try to use const int d_size to declare the size of the char array. It just would not work, it just didn't like it when I put in private, public, in the source.cpp. I tried everything
Here's from Inventory.h:
C++:
class Inventory
{
private:
    int d_size = 31;
public:
        struct invItem
        {
            const int d_size = 31;
            char desc[31];
            int qty;
            double price;
        };
Does it make sense that you have a public member, InvItem, that can be accessed outside of the class, but with a member that is private (d_size)?

Also, I don't know why you have a class with a nested struct inside it.
Since you're learning about classes right now, it makes more sense to start with simple examples and get a better understanding of how to work with classes and OOP in general. No need to add complications like file I/O and so on.

Here's a simpler version of your inventory program.
Inventory.h
Notice that there is no more struct, and that the three private members have member access functions to get or set the private members. Also, I'm using the STL string class rather than a C-style char array. If I want to be able to store objects on disk, I might go back to a fixed-size char array, but I think it's more important to get a better understanding of how classes work at this point.
C++:
#include <iostream>
#include <string>
using namespace std;

class InventoryItem
{
private:
    string desc;
    int qty;
    double price;

public:        
    string get_Desc();
    void set_Desc(string);
    int get_Qty();
    void set_Qty(int);
    double get_Price();
    void set_Price(double);
    void displayRec();    
};

Implementation of class member functions, Inventory.cpp
C++:
#include <iostream>
#include "Inventory.h"

#include <iomanip>
using namespace std;

string InventoryItem::get_Desc()
{
    return desc;
}

void InventoryItem::set_Desc(string str)
{
    desc = str;
}

int InventoryItem::get_Qty()
{
    return qty;
}

void InventoryItem::set_Qty(int number)
{ 
    qty = number;
}

double InventoryItem::get_Price()
{
    return price;
}

void InventoryItem::set_Price(double pr)
{
    price = pr;
}

void InventoryItem::displayRec()
{
    cout << setw(25) << left << " Description: " << desc << endl;
    cout << setw(25) << left << " Quantity: " << qty << endl;
    cout << setw(25) << left << " Price: " << "$" << price << "\n\n";
}

The driver, main.cpp
Short and sweet.
C++:
#include "Inventory.h"

int main()
{
    InventoryItem Inv;

    Inv.set_Desc("doodad");
    Inv.set_Qty(5);
    Inv.set_Price(8.0);

    Inv.displayRec();    
}
Output:
Code:
 Description:            doodad
 Quantity:               5
 Price:                  $8
yungman said:
You actually stop and delete the Header Files in one project and look at your older projects to see whether the Header Files is gone?
In 22 years I have never needed to do this. I have deleted files from many projects, but have never seen any side effects in other projects.
Jarvis323 said:
Have you tried resetting the settings?
And as Jarvis showed, have you (Alan) tried looking at the VS documentation or googling for answers?
 
  • Like
Likes yungman
  • #42
Mark44 said:
Here's from Inventory.h:
C++:
class Inventory
{
private:
    int d_size = 31;
public:
        struct invItem
        {
            const int d_size = 31;
            char desc[31];
            int qty;
            double price;
        };
Does it make sense that you have a public member, InvItem, that can be accessed outside of the class, but with a member that is private (d_size)?

Also, I don't know why you have a class with a nested struct inside it.
Since you're learning about classes right now, it makes more sense to start with simple examples and get a better understanding of how to work with classes and OOP in general. No need to add complications like file I/O and so on.

Here's a simpler version of your inventory program.
Inventory.h
Notice that there is no more struct, and that the three private members have member access functions to get or set the private members. Also, I'm using the STL string class rather than a C-style char array. If I want to be able to store objects on disk, I might go back to a fixed-size char array, but I think it's more important to get a better understanding of how classes work at this point.
C++:
#include <iostream>
#include <string>
using namespace std;

class InventoryItem
{
private:
    string desc;
    int qty;
    double price;

public:     
    string get_Desc();
    void set_Desc(string);
    int get_Qty();
    void set_Qty(int);
    double get_Price();
    void set_Price(double);
    void displayRec(); 
};

Implementation of class member functions, Inventory.cpp
C++:
#include <iostream>
#include "Inventory.h"

#include <iomanip>
using namespace std;

string InventoryItem::get_Desc()
{
    return desc;
}

void InventoryItem::set_Desc(string str)
{
    desc = str;
}

int InventoryItem::get_Qty()
{
    return qty;
}

void InventoryItem::set_Qty(int number)
{
    qty = number;
}

double InventoryItem::get_Price()
{
    return price;
}

void InventoryItem::set_Price(double pr)
{
    price = pr;
}

void InventoryItem::displayRec()
{
    cout << setw(25) << left << " Description: " << desc << endl;
    cout << setw(25) << left << " Quantity: " << qty << endl;
    cout << setw(25) << left << " Price: " << "$" << price << "\n\n";
}

The driver, main.cpp
Short and sweet.
C++:
#include "Inventory.h"

int main()
{
    InventoryItem Inv;

    Inv.set_Desc("doodad");
    Inv.set_Qty(5);
    Inv.set_Price(8.0);

    Inv.displayRec(); 
}
Output:
Code:
 Description:            doodad
Quantity:               5
Price:                  $8
In 22 years I have never needed to do this. I have deleted files from many projects, but have never seen any side effects in other projects.
And as Jarvis showed, have you (Alan) tried looking at the VS documentation or googling for answers?
Thanks for you reply. I intentionally make it more complicate for the program just to make it more difficult. That's what I usually do. If I just follow the book, I would have a lot less questions as they are very easy. I know, the program is stupid, it was a program I wrote when I was in advanced file chapter, that was an improvised program already, this take it to the next level. My goal is to put a struct into the header file.

I find if I google, I have to know what key words I type in. If I put in wrong words, different things will come out and going nowhere. Believe me, I spent a lot of time googling this and the d_size issue. I tried not to ask question here until I spent a few hours searching. Even looking at VS document from MS, I have to know what to ask. You cannot just say I delete the header files, how can I get it back!

I would have never seen the issue of deleting the folder until very lately. Remember I was working on putting .h files using Add-->Existing and it doesn't work on mixed with Add-->New? When I start running into problem in building solution, I had to delete the .h file and put it somewhere. That's when I started to see the folder disappears. I experiment a lot, adding things, try it out, now working, delete them and try again. I find that's the best way to learn. You ever actually try deleting the folder and see your other project. If that doesn't happen to you, then I have to question whether I have problem in installing the VS again.

I forgot to delete the const int d_size = 31. It's not being used as I put [31] in.

Anyway, thanks so much to have the patience to help me. I feel very lazy today, have not even try doing any C++. This is the first day in at least the last 3 weeks that I have not done any C++ yet. that's why I have time to blow some hot air in the other thread. Usually I am too drown in C++ for any of that. I spent a lot of time, at least 4 to 8 hours a day, 7 days a week in the last 3 months on C++.

Alan
 
  • #43
yungman said:
Thanks for you reply. I intentionally make it more complicate for the program just to make it more difficult. That's what I usually do.
Yes, that's what you usually do, but in my experience, that's not a good way to learn things. Many times you have made things so difficult that you don't understand what you're doing. You're at the very beginning of learning about classes -- why make things harder on yourself? You have to crawl before you can walk, and you have to walk before you can run.
yungman said:
When I start running into problem in building solution, I had to delete the .h file and put it somewhere. That's when I started to see the folder disappears. I experiment a lot, adding things, try it out, now working, delete them and try again. I find that's the best way to learn. You ever actually try deleting the folder and see your other project. If that doesn't happen to you, then I have to question whether I have problem in installing the VS again.
I think your installation is probably just fine. Things would work a lot better if you stopped deleting this and that at random. I can't think of any good reason to delete a Solution Explorer "folder" like Header Files or Source Files. As I mentioned before, there are two options in VS for getting rid of your program files -- on the right-click menu for a program file (.cpp or .h) there are Remove and Exclude from Project. The Remove option actually deletes the file, and Exclude from Project leaves the file in place, but doesn't use it in the build. All of this information can be found the the Help for VS.
 
  • Like
Likes Jarvis323 and Vanadium 50
  • #44
yungman said:
When I start running into problem in building solution, I had to delete the .h file and put it somewhere. That's when I started to see the folder disappears. I experiment a lot, adding things, try it out, now working, delete them and try again. I find that's the best way to learn. You ever actually try deleting the folder and see your other project. If that doesn't happen to you, then I have to question whether I have problem in installing the VS again.

I don't think it was deleting things alone that caused your problem. I think you toggled the "show all files" button that I put a green box around. You can see in your post 16, you had it unpressed, then had it pressed (compare the two images). Try pressing it ON/OFF and see what happens.

Here it is unpressed.

unpressed.png


Here it is pressed.

pressed.png


Of course deleting things you're not supposed to, or in ways you're not supposed to might have messed things up as well, if that's what you did. But deleting something in one project alone would not have changed your other projects (unless it was a file that both projects are using).
 
Last edited:
  • #45
Mark44 said:
Yes, that's what you usually do, but in my experience, that's not a good way to learn things. Many times you have made things so difficult that you don't understand what you're doing. You're at the very beginning of learning about classes -- why make things harder on yourself? You have to crawl before you can walk, and you have to walk before you can run.
I think your installation is probably just fine. Things would work a lot better if you stopped deleting this and that at random. I can't think of any good reason to delete a Solution Explorer "folder" like Header Files or Source Files. As I mentioned before, there are two options in VS for getting rid of your program files -- on the right-click menu for a program file (.cpp or .h) there are Remove and Exclude from Project. The Remove option actually deletes the file, and Exclude from Project leaves the file in place, but doesn't use it in the build. All of this information can be found the the Help for VS.

Actually programming wise, it's very smooth. I spent so much time on VS, but after I resolved the file folder issue, it only took me like 15 minutes to make the program work exactly what I want the program to do. I was actually working in the car waiting for my big boss's doctor appointment, I bring up the program step by step and 15 minutes it worked. I had to take a double take to make sure.

The exercise in the book mostly very easy, I don't think I learn too much from the book if I don't venture out. Funny now that I got through all these, I looked at the next sample program, the book is doing the same Inventory like my program. I don't know whether it is as difficult as mine. I find going out of comfort zone and venture out is the best way to learn, Like I spent so much time on pointers and pointer to pointers. Now I feel very comfortable with it.

A lot of times, I look at the sample briefly in the book, then I just make up my own program and try to add what I learn from the pass chapters in. Like I added files, structures into this program and I add seekp() and seekg(). As I get older, memory is fading, I need to keep practice what I learn to make it part of me.

Speaking about learning, I just found out my Gaddis book is only the brief version. It stop after Inheritance and Polymorphism. I just bought the same book but not the brief version. It contains 4 more chapters on data structure on Exceptions, Function Templates, List, STL stack, queue and binary trees.
https://www.amazon.com/gp/product/0321545885/?tag=pfamazon01-20 I also bought bought this book by Gaddis on graphic and gaming:
https://www.amazon.com/gp/product/032151291X/?tag=pfamazon01-20
This one seems a lot easier, a lot of memory mapping of screen, drawing stuffs. Doesn't get to Class until later chapters..

I wonder which way to go first. I bet the data structure is going to be harder, the graphic is more fun and easier. What is your opinion on which one to first? I remember you advice to study minimum to Chapter 14 on Classes up to overload. I decided to finish at least the whole book to Inheritance and Polymorphism before I stop. It's only two chapters away, why stop. Just what is the next step.

Thanks
 
  • #46
Jarvis323 said:
I don't think it was deleting things alone that caused your problem. I think you toggled the "show all files" button that I put a green box around. You can see in your post 16, you had it unpressed, then had it pressed (compare the two images). Try pressing it ON/OFF and see what happens.

Here it is unpressed.

View attachment 270712

Here it is pressed.

View attachment 270713

Of course deleting things you're not supposed to, or in ways you're not supposed to might have messed things up as well, if that's what you did. But deleting something in one project alone would not have changed your other projects (unless it was a file that both projects are using).
I just went back and toggle that button. Now I see Header Files and Source Files either way. It was not like this before. I think I deleted the files. I cannot say for sure whether I press that before, but it started out deleting the .h file when I was experimenting with Add-->Existing vs Add-->New. That's when I deleted the .h and create new one back and fore.

BTW, I still need to try your last post#40. I am on strike today, just being bad. I have not tough any C++, just here yapping. I'll be back on this later or tomorrow.

Thanks for your help.
 
  • #47
yungman said:
I cannot say for sure whether I press that before
Yeah you can. There is conclusive proof that you did in post #16.
 
  • #49
In the process of playing with the last declaration, I notice something about the Header and Source Files. I can open and close the folders in the Solution Explorer. I don't know what view you call, please let me know. Here are the 4 pictures( I actually had to use a camera to take pictures as it won't show what view I was in if I click the screen capture apt.

This is the picture of both Header and Source Files closed as you can see the icon(folder closed). All the .h and .cpp files disappeared. Program ran but garbage in the record.
SE top Files closed.jpg


This is still with folder closed, just the .sln view as shown. Notice in the Header Files, there supposed to have Inventory.h in it. I NEVER put it there. This is the project that work from yesterday before I learn how to reset the VS. I have all 3 files in the Source File folder. You'll see later when I open the folders below.
SE bottom Files closed.jpg
This is the view with both folders opened. Notice all 3 files are in Source Files folder? This is what I put in.
SE top Files open.jpg


This is the view after I opened the folders. It looks pretty much the same as when the folders are closed. Notice in both close and open, the folders in this view looks open.
SE bottom Files open.jpg
This is something new to me. The program won't run right if the both Files folders are closed. What do you call this open and close folders. Does that means I have to look to make sure the folders is open?

Also, I don't know where the Inventory.h in the Header Files folder comes from. I did not put it there for sure. Last I worked on the program before resetting VS, I had all 3 in Source Files folder.

What do you call the two views, one is pointing to the top Inventory(C:...) and the bottom Inventory.sln. If I go on google to look, what should I type in? I am not having much luck doing searching. I don't know these terms, I don't think it helps if I type in " Header folder open and close in Solution Explorer"!

I never know to look at each folder icon.

Thanks
 
Last edited:
  • #50
yungman said:
This is something new to me. The program won't run right if the both Files folders are closed. What do you call this open and close folders. Does that means I have to look to make sure the folders is open?
"Collapsing" and "expanding" the folders is what you call this. These have nothing to do with whether the program runs or not. They are just views of the hierarchy that VS shows you. The program files are still there (unless you deleted them).
 
  • #51
Mark44 said:
"Collapsing" and "expanding" the folders is what you call this. These have nothing to do with whether the program runs or not. They are just views of the hierarchy that VS shows you. The program files are still there (unless you deleted them).

Funny it doesn't do that anymore.

What is the purpose of opening and closing the folders?

Thanks
 
  • #52
yungman said:
What is the purpose of opening and closing the folders?
(Sigh...)
What's the purpose of opening and closing a door?
 
  • Like
Likes Vanadium 50
  • #53
Mark44 said:
(Sigh...)
What's the purpose of opening and closing a door?
But if you close the door, you cannot access inside. You can access the folder whether it's open or not, that's the difference. If you close the folder, you cannot run the program, then it makes the whole world of sense. That's just common sense. Right?
 
  • #54
yungman said:
If you close the folder, you cannot run the program, then it makes the whole world of sense.
If you open the folder or the door, you can see inside. Having a folder open or closed in Solution Explorer makes exactly zero difference as to whether you can run the program.
yungman said:
That's just common sense. Right?
Nope.
 
  • #55
Mark44 said:
If you open the folder or the door, you can see inside. Having a folder open or closed in Solution Explorer makes exactly zero difference as to whether you can run the program.
Nope.
I guess we have a different definition of common sense. If the door is close, I cannot see inside, BUT I can just walk in and take anything I want and change anything I want? ....Anyway, this is off the subject, now I know. Maybe that's part of why I find it so difficult to read in CS stuff on line.

I actually took the time last night to read the VS site, it is very hard to read, same as going online and search.
 
  • #56
yungman said:
If the door is close, I cannot see inside, BUT I can just walk in and take anything I want and change anything I want?

No, but you can still press a button outside the room that makes a machine inside run.
 
  • #57
yungman said:
guess we have a different definition of common sense.
Apparently.
yungman said:
If the door is close, I cannot see inside, BUT I can just walk in and take anything I want and change anything I want?
If the door is closed, you can't see inside. If the door is open, you can see inside. It's the same idea with the open (expanded) or closed (collapsed) folders in Solution Explored. Again, whether the folders are collapsed or expanded, it makes no difference as far as whether the program will run. If your program won't run, it's because of something else entirely.
yungman said:
I actually took the time last night to read the VS site, it is very hard to read, same as going online and search.
This page in the docs -- https://docs.microsoft.com/en-us/visualstudio/get-started/visual-studio-ide?view=vs-2019 -- would be a good place to start. Other topics in this section are:
  • About the code editor
  • About projects and solutions (which would have answered a lot of the questions you've had)
  • More Visual Studio features
There are also tutorials that focus on the different languages that VS supports. If you want to learn how to use Visual Studio, going to the source is better than some random online search. That's common sense ...
 
  • Like
Likes yungman
  • #58
@yungman, please start a new thread with this question. Your post has nothing to do with build errors in VS.
 
  • Like
Likes Vanadium 50

Similar threads

  • · Replies 8 ·
Replies
8
Views
2K
Replies
10
Views
2K
  • · Replies 22 ·
Replies
22
Views
3K
  • · Replies 6 ·
Replies
6
Views
12K
Replies
12
Views
2K
Replies
5
Views
2K
  • · Replies 75 ·
3
Replies
75
Views
6K
Replies
6
Views
2K
  • · Replies 30 ·
2
Replies
30
Views
4K
Replies
4
Views
2K