简体   繁体   中英

Why can't I automatically create definition files in Visual Studio?

I am making my first steps in C++ and after creating a class header file I want to automatically create a definition file by pressing Ctrl+., but Visual Studio tells me that it couldn't create one. I always have to manually create one and then it works. Also, when I put the headers and source files in separate folders, Visual Studio tells me that the file is write protected. All files are located in my profile folder, so there should be no write protection.

Any ideas why this could be?

I suggest you could refer to the Doc: Create Declaration / Definition

When: You have a function that needs a declaration, or vice-versa.

As far as I'm concerned, first of all, you should have a function that needs a declaration.

Simply because Visual studio is just total garbage compared to Clion. Unfortunately I am forced to use it,so I have to spend atleast 2 hours to fix those things and write declarations manually and that process is quite slow since I'm new to C++. Wouldn't recommend it to my worst enemy.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM