Visual Studio, pls

Started by
1 comment, last by matt77hias 6 years, 6 months ago

Ok, short but sweet. I was simplifying the code regarding my plugins DLL-entry point export-functions, mainly going from a h/cpp-pair to just a cpp (the header was pretty redudant). Two plugins to test with, one with only one entry-point (game code), the other with two (game code + editor code). The first generates the symbols, the second doesn't even process the Export.cpp-file. What the hell?

Long story short, I went through a lot of nonsensical options, when it turns out that Visual Studio has an "element type" attribute for files. Turns out I deleted Export.cpp, afterwards renamed Export.h to Export.cpp and then this internal flag was still set to "C/C++ header" instead of "C/C++ compiler". Yes, thats how VS determines if it compiles the file and not the ending. And no, that flag doesn't change when you rename the file, even in the IDE. Thanks for wasting an hour of my life, the moral here is - never change your filetypes? Yikes :S

Advertisement

Idd. I experienced some similar issues when converting from source to header file and vice versa. Changing between associated extensions such as .h and .hpp is fine.

Changing the file name (and keeping the extension) in the IDE is fine. Changing extensions or moving files is best done outside of the IDE and remove + re-add the files afterwards. Alternatively, you can modify the .xml kind of configuration files of your projects which is much safer, but unfortunately cumbersome for large code bases.

🧙

This topic is closed to new replies.

Advertisement