So, I was developing in visual c++ a small windows forms application to prototype some hardware, and, after working on it for a few days where it was working fine, suddenly when I tried to compile it, the IDE threw this at me:
"Error C2084 function 'void Main(cli::array ^)' already has a body."
It also threw a few other errors, each having to do with a line in my main function. Unfortunately, I have yet to even touch the main function because the program is so simple I really haven't had to. All of the code right now in the main function is just the generated code that comes standard with all windows forms applications. I'm a bit at a loss, but here is the .cpp file and maybe I accidentally changed something without realizing it. I've tried cleaning and rebuilding, but it didn't change anything. Maybe somebody can see something I'm not, so thanks in advance.
#include "MyForm.h"
#include "fftw3.h"
using namespace System;
using namespace System::Windows::Forms;
[STAThread]
void Main(array<String^>^ args)
{
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
BCI_FFTPrototyping::MyForm form;
Application::Run(%form);
}
Ok, despite the fact that all the errors in both the errors tab and the output tab indicated that the answer was somewhere in the Main function, or at least in the .cpp file, this appears not to be the case at all. The issue turned out to be that I had accidentally put a #include in the header file for the .cpp, which was causing it to perceive that there were two main functions, but after deleting that, it compiled fine and the error went away. Figured I'd put this as an answer in case anybody else comes across something similar, you might have made the same mistake I did.