CLR必須定義入口點


在VS2013中創建CLR空項目;在點擊“項目”創建“Windows 窗體”;完成MyForm設計后,按F5運行跳出錯誤“必須定義入口點”。

解決方案:

在MyForm.cpp中,添加如下代碼:

 1 using namespace Project1;
 2 
 3 [STAThreadAttribute]
 4 int main(array<System::String ^> ^args)
 5 {
 6     Application::EnableVisualStyles();
 7     Application::SetCompatibleTextRenderingDefault(false);
 8 
 9     Application::Run(gcnew MyForm());
10 
11     return 0;
12 }

那么問題就解決了。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM