0

I wrote a small code generator but I dont know how to automagically include the generated files in the project automatically.

My first try was to write into the .vcxproj file, but this prompted a windows saying that the project file was modified and I want to auto-reload (there is an option to auto-reload changed files, but this only works for existing files in the solution )

My second attempt was to add a wildcard to the .vcxproj file to compile all .cpp files in a given folder. This worked but as soon as I tried to add a new .cpp normally from within VS I got an internal error.

Any ideas?

5
  • Do you generate C++ file from C++ program? Or C++ files from a C# program (or other .NET language)? Commented Nov 18, 2019 at 14:02
  • @JoseMaria I generate from C++, but if i need a C# project to import the files without too much hassle I can work with that. Commented Nov 18, 2019 at 14:18
  • I don't think you can work around VS's need to reload your file, the best you could do is automate it. Commented Nov 18, 2019 at 14:58
  • Then, this link could help you stackoverflow.com/questions/18544354/… Commented Nov 18, 2019 at 15:17
  • Porting existing code files into a C++ project enables the use of native MSBuild project management features built into the IDE. If you prefer to use your existing build system, such as nmake makefiles, CMake, or alternatives, you can use the Open Folder or CMake options instead. I suggest you could refer to the link:learn.microsoft.com/en-us/cpp/build/… Commented Nov 19, 2019 at 3:23

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.