Object 'X' already exists - c++

I'm learning C++ and am redoing a tutorial that I did before. I deleted the project folder and recreated it. I right clicked on the solution, clicked Add Class and entered my class name, but I get the error that 'Object 'X' already exists' even though I deleted the previous folder. I'm just learning C++ so I guess I don't understand how C++ creates objects.

Probably some stored data are still there from the previous project.
1st solution: I would suggest you to change from the name tag, your project name. Maybe something was still there.
Then, second option: restart Visual studio
2nd solution: Watch also to the solution explorer, if there are hidden folder named as your class name. If so, delete them and create the class again
Let me know.

To solve this problem I created a file with the name that did not work via windows explorer in my project folder. I then dragged the file into visual studio and it worked.

Related

How to add folder reference(folder group) using xcode file template?

I'm trying to create some template to simplify some boring repeating stuff in existing project.
I need to create something like entity and it's behavior classes, e.g. I want to add new entity "Hero" and I need the following structure in the end:
Entities/Hero/Hero.h
Entities/Hero/Hero.cpp
Entities/Hero/StateControllers/HeroStateController.h
Entities/Hero/StateControllers/HeroStateController.cpp
So I've created the following structure in my xcode template
The problem is when I use "New file..." and create "Hero" all files are added but folders are blue what means that this folder will be considered as assets folder. But I don't need it. I need it to be group referenced to folder(yellow one). I've searched the whole internet and could not find anything for file templates.
Can anybody please help me?
Thanks in advance!

How to undo move files from filezilla

I have one problem about filezilla. I accidentally move one folder to wrong directory, so it shows the errors when I view my website.
How can I solve it? Please help me.
Many thanks in advance for your answer.
You cannot undo, but you should understand why that happened and how to prevent that from happening again in the future.
This happened because Filezilla allows Drag-and-drop move functionality on both folders (directories) and files, very dangerous on production servers.
There is actually a feature-request for 11 years now, please add your vote to the list to get this done: https://trac.filezilla-project.org/ticket/2191
In the mean time, please consider using another software that allows the user to set this behavior as an option:
WinSCP: http://winscp.net/eng/docs/screenshots
WS-FTP Pro: https://trac.filezilla-project.org/attachment/ticket/2191/ws_ftp-professional-options.gif
EDIT: Filezilla team responded (sort of) to the feature request and you can block drag and drop in the xml config file. It's better than nothing.
You cannot undo ftp moves. The only way to rectify the problem is to manually move the folder to it's original location.
I suggest you be more careful from next time.
If you don't know where the folder belongs, download the x-cart script package and check where the directory belongs.
Sorry for late, but I am up to date. I get logs from filezilla of moved files.
Status: Renaming '/var/www/html/brb/abc.js' to '/var/www/html/brb/node_modules/abc.js'
Status: /var/www/html/brb/abc.js -> /var/www/html/brb/node_modules/abc.js
Status: Renaming '/var/www/html/brb/xyz.html' to '/var/www/html/brb/node_modules/xyz.html'
Status: /var/www/html/brb/xyz.html -> /var/www/html/brb/node_modules/xyz.html
I write script in js to build command
let x = ['/var/www/html/brb/abc.js -> /var/www/html/brb/node_modules/abc.js',
'/var/www/html/brb/xyz.html -> /var/www/html/brb/node_modules/xyz.html'];
let cmd = [];
x.forEach(p => {
let path = p.split('->');
cmd.push(`mv ${path[1]} ${path[0]}`);
})
console.log(cmd);
Output:
['mv /var/www/html/brb/node_modules/abc.js /var/www/html/brb/abc.js'
'mv /var/www/html/brb/node_modules/xyz.html /var/www/html/brb/xyz.html']
Use any editor like vscode etc and remove string quotes and execute command in server terminal etc
mv /var/www/html/brb/node_modules/abc.js /var/www/html/brb/abc.js
mv /var/www/html/brb/node_modules/xyz.html /var/www/html/brb/xyz.html
A simple answer is,
Copy the folder into the desired location and then delete from the current location where you moved it mistakenly.
Now, what if you overwrite a file.
I just edited a file in local, then downloaded the file from my server into the local, and my all the local updated data is gone. There seems no solution of this, but there may be one possibility, I may be the lucky enough that this is my case.
If you were working on that local file, so most probably it is opened in your browser. Do not refresh it. Copy the content one by one, and update the file again. You can also open developers tools of both old and new page. Compare them line by line and do the job.
I had the same issue and resolved it manually.
The log panel was helpful in this. It is the large panel below the connection form in the top menu.
From that log panel, I was able to figure out all the files which were moved with their current and previous location.
I copied those all log lines and paste them somewhere in notepad and then manually selected all files and move those all at once to their original directory.
Screenshot: The log panel showing last actions

How do I turn off the auto message on a new file in Webstorm IDE?

When I create a new file in a webstorm project I get a superfluous message telling the next person 'who made the file and when'. Since the invention of source control I really don't see why jetBrains have decided to make this default anyway how do I turn it off?
This is probably because you have USER and DATE as part of your file template:
Just get rid of the the stuff in the template and you should be good to go. In other words, get rid of 3 and 4, and you will no longer be prompted.
Usually webstorm will not prompt you for this, but for some reason in the installation the username was not added to its list of macros.

VS2012 migration "HasTrailingSlash" issue

I am trying to migrate a VS 2005 project to VS 2012. But it reports the following error.
The "HasTrailingSlash" function only accepts a scalar value, but its
argument "$(IntDir)" evaluates to
"C:\Users\Mahesh\HelloWorld_obj\DebugW7-Win32;\" which is not a
scalar value. C:\Program Files
(x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.targets
I understand its a string literal and not a scalar value. But how to resolve the issue. Can anyone please share your ideas. Googling didn't help much.
Failed attempt : Though changing the delimeter to / from ; for the macro serving as intermediate directory in the property sheet did not work.
Success: I opened the property sheet in Notepad and removed the following lines for the user macro "ObjOut" which serves as an intermediate directory for my project.
InheritsFromParent="true"
Delimiter=";"
The same can be achieved via IDE as well when "Macro inherits from parent property sheets" is unchecked for the macro.
Hope this is useful to someone in future. I posted the same on MSDN forum as well.

Visual Studio C++ project error re: LOCALAPPDATA

I'm trying to create a new C++ project in VS 10, and can't even get an empty project to load from the template. I get an error...
The "exists" function only accepts a scalar value but its argument "$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" evaluates to "{~}" which is not a scalar value.
The {~} value is what I have stored in the LOCALAPPDATA variable in the computer Environment Variables, concatenated with "\Microsoft\MSBuild\v4.0\Microsoft.Cpp.Win32.user.props" at the end.
I'm reluctant to go changing any template files without understanding what's going on.
Well, it looks like Windows XP doesn't provide any default value for this variable and "~" is definitely not a valid directory on your PC. Try to set it as described here, and maybe you'll get lucky. VS2010 had some bug related to this. Perhaps you also need to upgrade it to SP1.
The links provided by #Mihai gave the information I needed to find a solution. The problem was that LocalAppData didn't have the value it was looking for (just what the error message says). I couldn't change that data because other apps had modified it for their own purposes (the value wasn't "~", that was a placeholder for this post).
Instead, I opened the .vcxproj file in Notepad, and modified the ImportGroup nodes causing the error. Instead of the attribute:
Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')"
... it now reads
Condition="exists('$(UserProfile)\Local Settings\Application Data\Microsoft.Cpp.$(Platform).user.props')"
The project now loads.