And so there is a lab on Windows Forms (just calculate the arithmetic, geometric progressions and the Fibonacci number). The main logic (3 functions for calculating progressions) was rendered into a separate file and apparently made it very crooked. It generates an error LNK 1561 - the entry point was not found. Where and how to define it in such an application is a mystery to me. How and where to determine this entry point?
File MyForm.h (responsible for the form itself and the windows / buttons on it)
#pragma once #include "Progress_func.h" //куча кода по внешнему виду формы private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { double arif_first = System::Convert::ToDouble(textBox1->Text); double arif_znam = System::Convert::ToDouble(textBox2->Text); int arif_num = System::Convert::ToInt32(textBox3->Text); double arif_rez = ArifProgress(arif_first, arif_znam, arif_num); textBox8->Text = System::Convert::ToString(arif_rez); } private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) { double geom_first = System::Convert::ToDouble(textBox4->Text); double geom_znam = System::Convert::ToDouble(textBox5->Text); int geom_num = System::Convert::ToInt32(textBox6->Text); double geom_rez = ArifProgress(geom_first, geom_znam, geom_num); textBox9->Text = System::Convert::ToString(geom_rez); } private: System::Void button3_Click(System::Object^ sender, System::EventArgs^ e) { int fib_num= System::Convert::ToInt32(textBox7->Text); int fib_rez = FibProgress(fib_num); textBox10->Text = System::Convert::ToString(fib_rez); } }; } MyForm.cpp file
#include "MyForm.h" using namespace System; using namespace System::Windows::Forms; [STAThreadAttribute] void Main(array<String^>^ args) { Application::EnableVisualStyles(); Application::SetCompatibleTextRenderingDefault(false); Project1::MyForm form; Application::Run(%form); } Progress_func.cpp file
#pragma once #include "Progress_func.h" double ArifProgress(double arif_first, double arif_znam, int arif_num) { if (arif_num < 1) return 0; return arif_first + arif_znam*arif_num; } double GeomProgress(double geom_first, double geom_znam, int geom_num) { if (geom_num < 1) return 0; double rez = geom_first; for (int i = 0; i <geom_num; i++) rez = rez*geom_znam; return rez; } int FibProgress(int fib_num) { if (fib_num < 1) return 0; int x = 1; int y = 0; int z = 0; for (int i = 0; i < fib_num; i++) { z = x + y; x = y; y = z; } return z; } Progress_func.h file
#pragma once double ArifProgress(double arif_first, double arif_znam, int arif_num); double GeomProgress(double geom_first, double geom_znam, int geom_num); int FibProgress(int fib_num);