Cout not working as a regular user for Visual C ++ Express 2010 on Windows 7

This is the code:

#include <iostream> int main() { using namespace std; cout << "========================" << "\n" << flush; return 0; } 

If I build, using Visual Express 2010 in Windows 7, the above code as an administrator, and then run the executable as a regular user in the cmd shell, it prints the expected result. If I clean and create the same code as a regular user and then run the executable as a regular user in the cmd shell, it does not print anything.

Any ideas as to why this is happening?

+4
source share
2 answers

I do not have an exact answer, but I will try to help.

1) As a regular user, right-click the Visual Studio command prompt and select Run as administrator. Thus, you can start Visual Studio as a regular user and use only the command line as an administrator.

2) The location of the Debug folder is not the default. I use Visual C ++ 2010 Express as a regular user and use location / user / visual studio 2010 / projects by default. I can run the program without problems. Also verify that you have executable privileges in the file by right-clicking it.

Also, why don't you just use "Ctrl + F5" to run the program from the IDE? This method is much faster if you just want to run the program. One more thing, try opening the cmd shell from outside of Visual Studio, cd into a folder and run it, and see if this has changed.

0
source

I think this is a problem due to inappropriate rights. Try to give the normal user administrative rights. Also, check to see if the file is in your documents and not in the C: \ program files. Due to the proper right, you cannot change the settings. And thus, debugging will not be performed in the prescribed directory.

0
source

Source: https://habr.com/ru/post/1389958/


All Articles