![]() Please Note I understand duplicating code is not best practice and my situation is purely a learning/hobby project. It boiled down to the files not being physically in the Project folder/directory even though they were shown correctly within the IDE. Alternatively, open a folder inside VS containing one of your existing CMake projects. ![]() To start, create a simple CMakeLists.txt file in the same folder with your cpp file as in the example below. I then referenced the other solutions posted here to "include files in project" by showing all files and this resolved the problem. Getting started with CMake in Visual Studio. I deleted the files from the Project view within Visual Studio and I used File Explorer to copy the files that I needed to the project folder/directory. For some reason, my copy and paste of the header file and CPP file were just a reference? (I assume) and did not physically copy the file into the new project file. ![]() ![]() Intellisense displayed an error suggesting it could not resolve the reference to the header file and compiling the code failed with the same error too.Īfter reading the posts here, I checked the project folder with Windows File Explorer and only the main.cpp file was found. I created a new project within an existing solution and copy & pasted the Header and CPP file from another project within that solution that I needed to include in my new project through the IDE. I encountered this issue, but the solutions provided didn't directly help me, so I'm sharing how I got myself into a similar situation and temporarily resolved it. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |